diff options
| author | Werner Sembach <wse@tuxedocomputers.com> | 2025-11-20 22:49:41 +0100 |
|---|---|---|
| committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2025-11-24 19:07:53 +0200 |
| commit | 3330367128f54142e5cfd568fc44c48da2036536 (patch) | |
| tree | 60d62a461a8dbdefef36e9bd09dedeae42f249d3 | |
| parent | 3c79c2e28a24a86199fa83bb80dc1a1c33f996c5 (diff) | |
platform/x86/uniwill: Handle more WMI events required for TUXEDO devices
Handle more WMI events that are triggered on TUXEDO devices.
Testing the TUXEDO InfinityBook Pro 15 Gen9 Intel, the Stellaris 16 Gen5
Intel, the Stellaris 16 Gen5 AMD and going through the out of tree
tuxedo-drivers dkms package I identified more WMI events that are used by
Uniwill.
This patch binds them to their respective function, or marks them as
KE_IGNORE when they are send in addition to other actions, to make clear
that they don't need special handling. This also avoids warnings in dmesg.
The events with descriptions from memory:
UNIWILL_OSD_RADIOON and UNIWILL_OSD_RADIOOFF - Sent in addition to the
already handled UNIWILL_OSD_RFKILL on some devices.
UNIWILL_OSD_PERFORMANCE_MODE_TOGGLE - Physical button on some devices. Bind
it to a button so userspace can receive the keypress and do stuff with it.
UNIWILL_OSD_MUTE - Sent in addition to an already handled keypress.
UNIWILL_OSD_KB_LED_LEVEL0 - UNIWILL_OSD_KB_LED_LEVEL4 - Some devices sent
these instead of UNIWILL_OSD_KBDILLUMTOGGLE.
UNIWILL_OSD_WEBCAM_TOGGLE - Sent in addition to deactivating the Webcam on
firmware level.
UNIWILL_OSD_DC_ADAPTER_CHANGED - No special handling required here atm, but
will be for the charging priority feature.
Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Link: https://patch.msgid.link/20251120215240.436835-2-wse@tuxedocomputers.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
| -rw-r--r-- | drivers/platform/x86/uniwill/uniwill-acpi.c | 21 | ||||
| -rw-r--r-- | drivers/platform/x86/uniwill/uniwill-wmi.h | 2 |
2 files changed, 22 insertions, 1 deletions
diff --git a/drivers/platform/x86/uniwill/uniwill-acpi.c b/drivers/platform/x86/uniwill/uniwill-acpi.c index 014960d16211..e0d356dfc74c 100644 --- a/drivers/platform/x86/uniwill/uniwill-acpi.c +++ b/drivers/platform/x86/uniwill/uniwill-acpi.c @@ -371,9 +371,11 @@ static const struct key_entry uniwill_keymap[] = { /* Reported in manual mode when toggling the airplane mode status */ { KE_KEY, UNIWILL_OSD_RFKILL, { KEY_RFKILL }}, + { KE_IGNORE, UNIWILL_OSD_RADIOON, { KEY_UNKNOWN }}, + { KE_IGNORE, UNIWILL_OSD_RADIOOFF, { KEY_UNKNOWN }}, /* Reported when user wants to cycle the platform profile */ - { KE_IGNORE, UNIWILL_OSD_PERFORMANCE_MODE_TOGGLE, { KEY_UNKNOWN }}, + { KE_KEY, UNIWILL_OSD_PERFORMANCE_MODE_TOGGLE, { KEY_F14 }}, /* Reported when the user wants to adjust the brightness of the keyboard */ { KE_KEY, UNIWILL_OSD_KBDILLUMDOWN, { KEY_KBDILLUMDOWN }}, @@ -382,11 +384,19 @@ static const struct key_entry uniwill_keymap[] = { /* Reported when the user wants to toggle the microphone mute status */ { KE_KEY, UNIWILL_OSD_MIC_MUTE, { KEY_MICMUTE }}, + /* Reported when the user wants to toggle the mute status */ + { KE_IGNORE, UNIWILL_OSD_MUTE, { KEY_MUTE }}, + /* Reported when the user locks/unlocks the Fn key */ { KE_IGNORE, UNIWILL_OSD_FN_LOCK, { KEY_FN_ESC }}, /* Reported when the user wants to toggle the brightness of the keyboard */ { KE_KEY, UNIWILL_OSD_KBDILLUMTOGGLE, { KEY_KBDILLUMTOGGLE }}, + { KE_KEY, UNIWILL_OSD_KB_LED_LEVEL0, { KEY_KBDILLUMTOGGLE }}, + { KE_KEY, UNIWILL_OSD_KB_LED_LEVEL1, { KEY_KBDILLUMTOGGLE }}, + { KE_KEY, UNIWILL_OSD_KB_LED_LEVEL2, { KEY_KBDILLUMTOGGLE }}, + { KE_KEY, UNIWILL_OSD_KB_LED_LEVEL3, { KEY_KBDILLUMTOGGLE }}, + { KE_KEY, UNIWILL_OSD_KB_LED_LEVEL4, { KEY_KBDILLUMTOGGLE }}, /* FIXME: find out the exact meaning of those events */ { KE_IGNORE, UNIWILL_OSD_BAT_CHARGE_FULL_24_H, { KEY_UNKNOWN }}, @@ -395,6 +405,9 @@ static const struct key_entry uniwill_keymap[] = { /* Reported when the user wants to toggle the benchmark mode status */ { KE_IGNORE, UNIWILL_OSD_BENCHMARK_MODE_TOGGLE, { KEY_UNKNOWN }}, + /* Reported when the user wants to toggle the webcam */ + { KE_IGNORE, UNIWILL_OSD_WEBCAM_TOGGLE, { KEY_UNKNOWN }}, + { KE_END } }; @@ -1248,6 +1261,12 @@ static int uniwill_notifier_call(struct notifier_block *nb, unsigned long action mutex_unlock(&data->battery_lock); return NOTIFY_OK; + case UNIWILL_OSD_DC_ADAPTER_CHANGED: + /* noop for the time being, will change once charging priority + * gets implemented. + */ + + return NOTIFY_OK; default: mutex_lock(&data->input_lock); sparse_keymap_report_event(data->input_device, action, 1, true); diff --git a/drivers/platform/x86/uniwill/uniwill-wmi.h b/drivers/platform/x86/uniwill/uniwill-wmi.h index 2bf69f2d8038..48783b2e9ffb 100644 --- a/drivers/platform/x86/uniwill/uniwill-wmi.h +++ b/drivers/platform/x86/uniwill/uniwill-wmi.h @@ -113,6 +113,8 @@ #define UNIWILL_OSD_BENCHMARK_MODE_TOGGLE 0xC0 +#define UNIWILL_OSD_WEBCAM_TOGGLE 0xCF + #define UNIWILL_OSD_KBD_BACKLIGHT_CHANGED 0xF0 struct device; |
