toshiba-acpi: fix multimedia keys on some machines
authorFrans Pop <elendil@planet.nl>
Mon, 1 Mar 2010 14:50:46 +0000 (09:50 -0500)
committerMatthew Garrett <mjg@redhat.com>
Mon, 1 Mar 2010 14:50:46 +0000 (09:50 -0500)
Some Toshibas only send ACPI events on key down, not key release. Ignore
any release events and send key down and key up events on every ACPI key
down event.

Signed-off-by: Frans Pop <elendil@planet.nl>
drivers/platform/x86/toshiba_acpi.c

index 26c211724acf7cb2374f46a7ddfcdeabe6e3a1d0..405b969734d6cd8a2dff5221c454f55041c62956 100644 (file)
@@ -814,21 +814,23 @@ static void toshiba_acpi_notify(acpi_handle handle, u32 event, void *context)
                if (hci_result == HCI_SUCCESS) {
                        if (value == 0x100)
                                continue;
-                       else if (value & 0x80) {
-                               key = toshiba_acpi_get_entry_by_scancode
-                                       (value & ~0x80);
-                               if (!key) {
-                                       printk(MY_INFO "Unknown key %x\n",
-                                              value & ~0x80);
-                                       continue;
-                               }
-                               input_report_key(toshiba_acpi.hotkey_dev,
-                                                key->keycode, 1);
-                               input_sync(toshiba_acpi.hotkey_dev);
-                               input_report_key(toshiba_acpi.hotkey_dev,
-                                                key->keycode, 0);
-                               input_sync(toshiba_acpi.hotkey_dev);
+                       /* act on key press; ignore key release */
+                       if (value & 0x80)
+                               continue;
+
+                       key = toshiba_acpi_get_entry_by_scancode
+                               (value);
+                       if (!key) {
+                               printk(MY_INFO "Unknown key %x\n",
+                                      value);
+                               continue;
                        }
+                       input_report_key(toshiba_acpi.hotkey_dev,
+                                        key->keycode, 1);
+                       input_sync(toshiba_acpi.hotkey_dev);
+                       input_report_key(toshiba_acpi.hotkey_dev,
+                                        key->keycode, 0);
+                       input_sync(toshiba_acpi.hotkey_dev);
                } else if (hci_result == HCI_NOT_SUPPORTED) {
                        /* This is a workaround for an unresolved issue on
                         * some machines where system events sporadically