Merge branch 'drm-next-3.15-wip' of git://people.freedesktop.org/~deathsimple/linux...
[cascardo/linux.git] / drivers / platform / x86 / panasonic-laptop.c
index 609d387..3f87097 100644 (file)
@@ -449,6 +449,7 @@ static struct attribute_group pcc_attr_group = {
 
 /* hotkey input device driver */
 
+static int sleep_keydown_seen;
 static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
 {
        struct input_dev *hotk_input_dev = pcc->input_dev;
@@ -462,6 +463,16 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
                                 "error getting hotkey status\n"));
                return;
        }
+
+       /* hack: some firmware sends no key down for sleep / hibernate */
+       if ((result & 0xf) == 0x7 || (result & 0xf) == 0xa) {
+               if (result & 0x80)
+                       sleep_keydown_seen = 1;
+               if (!sleep_keydown_seen)
+                       sparse_keymap_report_event(hotk_input_dev,
+                                       result & 0xf, 0x80, false);
+       }
+
        if (!sparse_keymap_report_event(hotk_input_dev,
                                        result & 0xf, result & 0x80, false))
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,