diff options
author | Hans de Goede <[email protected]> | 2024-04-24 14:28:20 +0200 |
---|---|---|
committer | Hans de Goede <[email protected]> | 2024-04-29 11:44:12 +0200 |
commit | 33ecfb852280bdeee906015a7d171a40abf9683d (patch) | |
tree | 6e89ceab15d00f238306abc7f5cdc99cb1052547 | |
parent | ba69660627eadb0983483fff376dceb55a773562 (diff) |
platform/x86: thinkpad_acpi: Move hotkey_user_mask check to tpacpi_input_send_key()
Move hotkey_user_mask check to tpacpi_input_send_key(), this is
a preparation patch for further refactoring.
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]
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index f9615b1a28cc..f2655278ab8e 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -2256,6 +2256,10 @@ static void tpacpi_input_send_key(const unsigned int scancode) { const unsigned int keycode = hotkey_keycode_map[scancode]; + if (scancode < TP_ACPI_HOTKEYSCAN_ADAPTIVE_START && + !(hotkey_user_mask & (1 << scancode))) + return; + if (keycode != KEY_RESERVED) { mutex_lock(&tpacpi_inputdev_send_mutex); @@ -2275,8 +2279,7 @@ static void tpacpi_input_send_key(const unsigned int scancode) static void tpacpi_input_send_key_masked(const unsigned int scancode) { hotkey_driver_event(scancode); - if (hotkey_user_mask & (1 << scancode)) - tpacpi_input_send_key(scancode); + tpacpi_input_send_key(scancode); } #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL |