Commit 33ecfb85 authored by Hans de Goede's avatar Hans de Goede
Browse files

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: default avatarMark Pearson <mpearson-lenovo@squebb.ca>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: default avatarMark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240424122834.19801-11-hdegoede@redhat.com
parent ba696606
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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,7 +2279,6 @@ 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);
}