]> www.infradead.org Git - users/dwmw2/linux.git/commit
platform/x86: thinkpad_acpi: Move adaptive kbd event handling to tpacpi_driver_event()
authorHans de Goede <hdegoede@redhat.com>
Wed, 24 Apr 2024 12:28:18 +0000 (14:28 +0200)
committerHans de Goede <hdegoede@redhat.com>
Mon, 29 Apr 2024 09:44:12 +0000 (11:44 +0200)
commit0a1f7f576082cad93d2c663fc0a5f0108aad5105
tree99cd8189743ada5d3f2b77e041a9cb9a64af8baf
parent33dc2efda4e2ec48a77338c75b55325801492f09
platform/x86: thinkpad_acpi: Move adaptive kbd event handling to tpacpi_driver_event()

Factor out the adaptive kbd non hotkey event handling into
adaptive_keyboard_change_row() and adaptive_keyboard_s_quickview_row()
helpers and move the handling of TP_HKEY_EV_DFR_CHANGE_ROW and
TP_HKEY_EV_DFR_S_QUICKVIEW_ROW to tpacpi_driver_event().

This groups all the handling of hotkey events which do not emit
a key press event together in tpacpi_driver_event().

This also drops the returning of false as known-event value when
adaptive_keyboard_get_mode() / adaptive_keyboard_set_mode() fail.
These functions already log an error on failure, returning false just
leads to an extra messgae being logged about the hkey event being
unknown, which is wrong as the event is not unknown.

Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240424122834.19801-9-hdegoede@redhat.com
drivers/platform/x86/thinkpad_acpi.c