Skip to content

Commit e3aa6fe

Browse files
JesseGuoTechij-intel
authored andcommitted
platform/x86: redmi-wmi: Add more hotkey mappings
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@outlook.com> Reviewed-by: Gladyshev Ilya <foxido@foxido.dev> Link: https://patch.msgid.link/TYCPR01MB6851636256C39B170F2312E5D192A@TYCPR01MB6851.jpnprd01.prod.outlook.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
1 parent bd5914c commit e3aa6fe

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

drivers/platform/x86/redmi-wmi.c

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
static const struct key_entry redmi_wmi_keymap[] = {
2121
{KE_KEY, 0x00000201, {KEY_SELECTIVE_SCREENSHOT}},
2222
{KE_KEY, 0x00000301, {KEY_ALL_APPLICATIONS}},
23-
{KE_KEY, 0x00001b01, {KEY_SETUP}},
23+
{KE_KEY, 0x00001b01, {KEY_CONFIG}},
24+
{KE_KEY, 0x00011b01, {KEY_CONFIG}},
25+
{KE_KEY, 0x00010101, {KEY_SWITCHVIDEOMODE}},
26+
{KE_KEY, 0x00001a01, {KEY_REFRESH_RATE_TOGGLE}},
2427

2528
/* AI button has code for each position */
2629
{KE_KEY, 0x00011801, {KEY_ASSISTANT}},
@@ -32,6 +35,26 @@ static const struct key_entry redmi_wmi_keymap[] = {
3235
{KE_IGNORE, 0x00050501, {}},
3336
{KE_IGNORE, 0x000a0501, {}},
3437

38+
/* Xiaomi G Command Center */
39+
{KE_KEY, 0x00010a01, {KEY_VENDOR}},
40+
41+
/* OEM preset power mode */
42+
{KE_IGNORE, 0x00011601, {}},
43+
{KE_IGNORE, 0x00021601, {}},
44+
{KE_IGNORE, 0x00031601, {}},
45+
{KE_IGNORE, 0x00041601, {}},
46+
47+
/* Fn Lock state */
48+
{KE_IGNORE, 0x00000701, {}},
49+
{KE_IGNORE, 0x00010701, {}},
50+
51+
/* Fn+`/1/2/3/4 */
52+
{KE_KEY, 0x00011101, {KEY_F13}},
53+
{KE_KEY, 0x00011201, {KEY_F14}},
54+
{KE_KEY, 0x00011301, {KEY_F15}},
55+
{KE_KEY, 0x00011401, {KEY_F16}},
56+
{KE_KEY, 0x00011501, {KEY_F17}},
57+
3558
{KE_END}
3659
};
3760

0 commit comments

Comments
 (0)