Skip to content

Commit 3330367

Browse files
tuxedo-wseij-intel
authored andcommitted
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>
1 parent 3c79c2e commit 3330367

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

drivers/platform/x86/uniwill/uniwill-acpi.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,11 @@ static const struct key_entry uniwill_keymap[] = {
371371

372372
/* Reported in manual mode when toggling the airplane mode status */
373373
{ KE_KEY, UNIWILL_OSD_RFKILL, { KEY_RFKILL }},
374+
{ KE_IGNORE, UNIWILL_OSD_RADIOON, { KEY_UNKNOWN }},
375+
{ KE_IGNORE, UNIWILL_OSD_RADIOOFF, { KEY_UNKNOWN }},
374376

375377
/* Reported when user wants to cycle the platform profile */
376-
{ KE_IGNORE, UNIWILL_OSD_PERFORMANCE_MODE_TOGGLE, { KEY_UNKNOWN }},
378+
{ KE_KEY, UNIWILL_OSD_PERFORMANCE_MODE_TOGGLE, { KEY_F14 }},
377379

378380
/* Reported when the user wants to adjust the brightness of the keyboard */
379381
{ KE_KEY, UNIWILL_OSD_KBDILLUMDOWN, { KEY_KBDILLUMDOWN }},
@@ -382,11 +384,19 @@ static const struct key_entry uniwill_keymap[] = {
382384
/* Reported when the user wants to toggle the microphone mute status */
383385
{ KE_KEY, UNIWILL_OSD_MIC_MUTE, { KEY_MICMUTE }},
384386

387+
/* Reported when the user wants to toggle the mute status */
388+
{ KE_IGNORE, UNIWILL_OSD_MUTE, { KEY_MUTE }},
389+
385390
/* Reported when the user locks/unlocks the Fn key */
386391
{ KE_IGNORE, UNIWILL_OSD_FN_LOCK, { KEY_FN_ESC }},
387392

388393
/* Reported when the user wants to toggle the brightness of the keyboard */
389394
{ KE_KEY, UNIWILL_OSD_KBDILLUMTOGGLE, { KEY_KBDILLUMTOGGLE }},
395+
{ KE_KEY, UNIWILL_OSD_KB_LED_LEVEL0, { KEY_KBDILLUMTOGGLE }},
396+
{ KE_KEY, UNIWILL_OSD_KB_LED_LEVEL1, { KEY_KBDILLUMTOGGLE }},
397+
{ KE_KEY, UNIWILL_OSD_KB_LED_LEVEL2, { KEY_KBDILLUMTOGGLE }},
398+
{ KE_KEY, UNIWILL_OSD_KB_LED_LEVEL3, { KEY_KBDILLUMTOGGLE }},
399+
{ KE_KEY, UNIWILL_OSD_KB_LED_LEVEL4, { KEY_KBDILLUMTOGGLE }},
390400

391401
/* FIXME: find out the exact meaning of those events */
392402
{ KE_IGNORE, UNIWILL_OSD_BAT_CHARGE_FULL_24_H, { KEY_UNKNOWN }},
@@ -395,6 +405,9 @@ static const struct key_entry uniwill_keymap[] = {
395405
/* Reported when the user wants to toggle the benchmark mode status */
396406
{ KE_IGNORE, UNIWILL_OSD_BENCHMARK_MODE_TOGGLE, { KEY_UNKNOWN }},
397407

408+
/* Reported when the user wants to toggle the webcam */
409+
{ KE_IGNORE, UNIWILL_OSD_WEBCAM_TOGGLE, { KEY_UNKNOWN }},
410+
398411
{ KE_END }
399412
};
400413

@@ -1247,6 +1260,12 @@ static int uniwill_notifier_call(struct notifier_block *nb, unsigned long action
12471260
}
12481261
mutex_unlock(&data->battery_lock);
12491262

1263+
return NOTIFY_OK;
1264+
case UNIWILL_OSD_DC_ADAPTER_CHANGED:
1265+
/* noop for the time being, will change once charging priority
1266+
* gets implemented.
1267+
*/
1268+
12501269
return NOTIFY_OK;
12511270
default:
12521271
mutex_lock(&data->input_lock);

drivers/platform/x86/uniwill/uniwill-wmi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@
113113

114114
#define UNIWILL_OSD_BENCHMARK_MODE_TOGGLE 0xC0
115115

116+
#define UNIWILL_OSD_WEBCAM_TOGGLE 0xCF
117+
116118
#define UNIWILL_OSD_KBD_BACKLIGHT_CHANGED 0xF0
117119

118120
struct device;

0 commit comments

Comments
 (0)