diff options
author | Hans de Goede <hdegoede@redhat.com> | 2024-04-24 15:28:21 +0300 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2024-04-29 12:44:12 +0300 |
commit | 4a3725d7612d67cace3390ce467544397d9a3f2d (patch) | |
tree | f7164b918892ab8e9b24081b6051812257f9f3d7 /drivers/platform | |
parent | 33ecfb852280bdeee906015a7d171a40abf9683d (diff) | |
download | linux-4a3725d7612d67cace3390ce467544397d9a3f2d.tar.xz |
platform/x86: thinkpad_acpi: Always call tpacpi_driver_event() for hotkeys
Call tpacpi_driver_event() at the top of hotkey_notify_hotkey() for all
(orig / adaptive / extended) hotkey types, rather then having the orig
code path call tpacpi_input_send_key_masked() which calls it through
hotkey_driver_event() and having the adaptive / extended helpers call
it separately.
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240424122834.19801-12-hdegoede@redhat.com
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index f2655278ab8e..9f0943498218 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -3713,9 +3713,6 @@ static void adaptive_keyboard_s_quickview_row(void) static bool adaptive_keyboard_hotkey_notify_hotkey(const u32 hkey) { - if (tpacpi_driver_event(hkey)) - return true; - if (hkey < TP_HKEY_EV_ADAPTIVE_KEY_START || hkey > TP_HKEY_EV_ADAPTIVE_KEY_END) { pr_info("Unhandled adaptive keyboard key: 0x%x\n", hkey); @@ -3729,9 +3726,6 @@ static bool adaptive_keyboard_hotkey_notify_hotkey(const u32 hkey) static bool hotkey_notify_extended_hotkey(const u32 hkey) { - if (tpacpi_driver_event(hkey)) - return true; - if (hkey >= TP_HKEY_EV_EXTENDED_KEY_START && hkey <= TP_HKEY_EV_EXTENDED_KEY_END) { unsigned int scancode = hkey - TP_HKEY_EV_EXTENDED_KEY_START + @@ -3757,6 +3751,9 @@ static bool hotkey_notify_hotkey(const u32 hkey, bool *send_acpi_ev) return true; } + if (tpacpi_driver_event(hkey)) + return true; + /* * Original events are in the 0x10XX range, the adaptive keyboard * found in 2014 X1 Carbon emits events are of 0x11XX. In 2017 @@ -3766,7 +3763,7 @@ static bool hotkey_notify_hotkey(const u32 hkey, bool *send_acpi_ev) case 0: if (hkey >= TP_HKEY_EV_ORIG_KEY_START && hkey <= TP_HKEY_EV_ORIG_KEY_END) { - tpacpi_input_send_key_masked(scancode); + tpacpi_input_send_key(scancode); return true; } break; |