Skip to content

Commit 276d915

Browse files
committed
platform/x86: thinkpad_acpi: Drop KEY_RESERVED special handling
The input core already filters out EV_KEY events for KEY_RESERVED, remove the check for this in tpacpi_input_send_key() and rely on the input core filtering instead. Also change tpacpi_input_send_key() to only report the scancode once instead of reporting it on both press and release. Together these 2 changes make tpacpi_input_send_key() behave the same as sparse_keymap_report_event(). The goal of this patch is to have a separate commit with the slightly different behavior from sparse_keymap_report_event() before switching over to using the sparse-keymap helpers. Tested-by: Mark Pearson <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Mark Pearson <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 31456ff commit 276d915

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2283,19 +2283,17 @@ static bool tpacpi_input_send_key(const u32 hkey, bool *send_acpi_ev)
22832283
}
22842284

22852285
keycode = hotkey_keycode_map[scancode];
2286-
if (keycode != KEY_RESERVED) {
2287-
mutex_lock(&tpacpi_inputdev_send_mutex);
22882286

2289-
input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN, scancode);
2290-
input_report_key(tpacpi_inputdev, keycode, 1);
2291-
input_sync(tpacpi_inputdev);
2287+
mutex_lock(&tpacpi_inputdev_send_mutex);
22922288

2293-
input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN, scancode);
2294-
input_report_key(tpacpi_inputdev, keycode, 0);
2295-
input_sync(tpacpi_inputdev);
2289+
input_event(tpacpi_inputdev, EV_MSC, MSC_SCAN, scancode);
2290+
input_report_key(tpacpi_inputdev, keycode, 1);
2291+
input_sync(tpacpi_inputdev);
22962292

2297-
mutex_unlock(&tpacpi_inputdev_send_mutex);
2298-
}
2293+
input_report_key(tpacpi_inputdev, keycode, 0);
2294+
input_sync(tpacpi_inputdev);
2295+
2296+
mutex_unlock(&tpacpi_inputdev_send_mutex);
22992297

23002298
return true;
23012299
}

0 commit comments

Comments
 (0)