SIGN IN SIGN UP

platform/x86: redmi-wmi: report EC state change events

The Redmibook EC/firmware fully handles the keyboard backlight cycle,
the OEM preset power mode (Fn+K) and the Fn lock toggle by itself, and
sends a WMI event carrying the resulting state in the third payload
byte. These events are currently swallowed with KE_IGNORE, so userspace
never learns that the state changed and cannot give the user any
feedback (OSD), even though the WMI event is the only notification
channel for these EC-driven changes.

Report them as key presses instead:

  - keyboard backlight cycle -> KEY_KBDILLUMTOGGLE
  - OEM preset power mode    -> KEY_PERFORMANCE
  - Fn lock toggle           -> KEY_FN_ESC

Desktops that only look at the keycode get the usual hotkey behaviour;
since sparse-keymap emits MSC_SCAN with the raw payload before the key
event, an OSD daemon can additionally recover the exact new state from
byte 2 (e.g. backlight Off/Low/High/Auto is 0x00/0x05/0x0a/0x80).

Note that the power mode event must keep being read from the WMI device
in any case: on the TM2209 the ACPI event handler (EV20) applies the
mode change as a side effect of building the event payload for _WED.

Tested on Redmi Book Pro 15 2023 (TM2209).

Signed-off-by: Musaev Ibragim <atomicus.xyz@gmail.com>
Link: https://patch.msgid.link/178405473606.25865.4048095379503614221@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
M
Musaev Ibragim committed
e0d6312578e1fd03738fc2ac8ac21c8bd84e965e
Parent: 08ce055
Committed by Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> on 8/18/2026, 2:30:49 PM