[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<TYCPR01MB6851F2386BFB226052BB500DD192A@TYCPR01MB6851.jpnprd01.prod.outlook.com>
Date: Mon, 26 Jan 2026 04:27:30 +0800
From: Jesse Guo <jesseguotech@...look.com>
To: Hans de Goede <hansg@...nel.org>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
Gladyshev Ilya <foxido@...ido.dev>
Cc: platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] platform/x86: redmi-wmi: Add more hotkey mappings
On Sunday, 25 January 2026 22:59 UTC+8, Gladyshev Ilya wrote:
> On 1/25/26 16:42, Jesse Guo wrote:
> > This patch adds more Fn hotkeys (like Refresh rate toggle).
> > Additionally, remap the setup key from KEY_SETUP to KEY_CONFIG.
> > As KEY_CONFIG is supported by Desktop Environments for launching
> > system settings, whereas KEY_SETUP is often ignored by userspace.
> >
> > Signed-off-by: Jesse Guo <JesseGuoTech@...look.com>
> > ---
> > drivers/platform/x86/redmi-wmi.c | 25 ++++++++++++++++++++++++-
> > 1 file changed, 24 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/platform/x86/redmi-wmi.c b/drivers/platform/x86/redmi-wmi.c
> > index 949236b93a321a943a9cb8b0528d730dbaa2cd6f..27e593aa64cac8a11e8fbace16ac76ca059180b3 100644
> > --- a/drivers/platform/x86/redmi-wmi.c
> > +++ b/drivers/platform/x86/redmi-wmi.c
> > @@ -20,7 +20,10 @@
> > static const struct key_entry redmi_wmi_keymap[] = {
> > {KE_KEY, 0x00000201, {KEY_SELECTIVE_SCREENSHOT}},
> > {KE_KEY, 0x00000301, {KEY_ALL_APPLICATIONS}},
> > - {KE_KEY, 0x00001b01, {KEY_SETUP}},
> > + {KE_KEY, 0x00001b01, {KEY_CONFIG}},
> > + {KE_KEY, 0x00011b01, {KEY_CONFIG}},
> > + {KE_KEY, 0x00010101, {KEY_SWITCHVIDEOMODE}},
> > + {KE_KEY, 0x00001a01, {KEY_REFRESH_RATE_TOGGLE}},
> >
> > /* AI button has code for each position */
> > {KE_KEY, 0x00011801, {KEY_ASSISTANT}},
> > @@ -32,6 +35,26 @@ static const struct key_entry redmi_wmi_keymap[] = {
> > {KE_IGNORE, 0x00050501, {}},
> > {KE_IGNORE, 0x000a0501, {}},
> >
> > + /* Xiaomi G Command Center */
> > + {KE_KEY, 0x00010a01, {KEY_VENDOR}},
> > +
> > + /* OEM preset power mode */
> > + {KE_IGNORE, 0x00011601, {}},
> > + {KE_IGNORE, 0x00021601, {}},
> > + {KE_IGNORE, 0x00031601, {}},
> > + {KE_IGNORE, 0x00041601, {}},
> > +
> > + /* Fn Lock state */
> > + {KE_KEY, 0x00000701, {KEY_FN_ESC}},
> > + {KE_KEY, 0x00010701, {KEY_FN_ESC}},
> You probably want to extend KEY_ASSISTANT's exception in `notify`
> callback to properly map pressed / unpressed state.
>
I have tested this, and the behavior differs from the AI button.
The event is just a reflection of the mode change but not
pressed / unpressed state (similar to the keyboard backlight toggle).
> Also, wouldn't mapping Fn Lock introduce inconvenience (e.g., a user
> wouldn't expect a key event when just locking the Fn keys)?
>
Agreed. Since the Fn Lock state is primarily internal to the EC.
Mapping it might introduce unexpected behavior or confusion.
Do nothing is better than break something.
> Otherwise, great addition
Will drop the Fn Lock mapping in v2.
> > + /* Fn+`/1/2/3/4 */
> > + {KE_KEY, 0x00011101, {KEY_F13}},
> > + {KE_KEY, 0x00011201, {KEY_F14}},
> > + {KE_KEY, 0x00011301, {KEY_F15}},
> > + {KE_KEY, 0x00011401, {KEY_F16}},
> > + {KE_KEY, 0x00011501, {KEY_F17}},
> > +
> > {KE_END}
> > };
> >
> >
> > ---
> > base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
> > change-id: 20260125-redmi-wmi-hotkey-add-666af84b0eeb
> >
> > Best regards,
>
Powered by blists - more mailing lists