Skip to contentSkip to conversation

toshiba_acpi: fix multimedia keys on Toshiba Sattelite A40

PATCH New Frans Pop 1 participant 1 message Feb 27, 2010

Subsystems (2)
lore
Share & tools
lore

Frans Pop

author
#0 lore raw

PATCH 1/1 toshiba_acpi: fix multimedia keys on Toshiba Sattelite A40

Commit 6335e4d56681f6f08f24f4b812a72d402793d393 added hotkey support, but fails to support the multimedia keys on some Toshiba laptops as they don't generate key release events.

This was previously discussed in http://lkml.org/lkml/2009/4/11/139 and a solution was found in private mail. The solution is to act on key press events instead of on key release events.

Also remove one level of indentation.

Cc Matthew Garrett <[email protected]>
drivers/platform/x86/toshiba_acpi.c +16 -14
index 26c2117..56e4556 100644
@@ -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