Skip to content

Commit 3ee5447

Browse files
thebongyjwrdegoede
authored andcommitted
platform/x86: hp-wmi: Handle Omen Key event
Add support to map the "HP Omen Key" to KEY_PROG2. Laptops in the HP Omen Series open the HP Omen Command Center application on windows. But, on linux it fails with the following message from the hp-wmi driver: [ 5143.415714] hp_wmi: Unknown event_id - 29 - 0x21a5 Also adds support to map Fn+Esc to KEY_FN_ESC. This currently throws the following message on the hp-wmi driver: [ 6082.143785] hp_wmi: Unknown key code - 0x21a7 There is also a "Win-Lock" key on HP Omen Laptops which supports Enabling and Disabling the Windows key, which trigger commands 0x21a4 and 0x121a4 respectively, but I wasn't able to find any KEY in input.h to map this to. Signed-off-by: Rishit Bansal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 83bcf3e commit 3ee5447

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/platform/x86/hp/hp-wmi.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ enum hp_wmi_event_ids {
9090
HPWMI_PEAKSHIFT_PERIOD = 0x0F,
9191
HPWMI_BATTERY_CHARGE_PERIOD = 0x10,
9292
HPWMI_SANITIZATION_MODE = 0x17,
93+
HPWMI_OMEN_KEY = 0x1D,
9394
HPWMI_SMART_EXPERIENCE_APP = 0x21,
9495
};
9596

@@ -216,6 +217,8 @@ static const struct key_entry hp_wmi_keymap[] = {
216217
{ KE_KEY, 0x213b, { KEY_INFO } },
217218
{ KE_KEY, 0x2169, { KEY_ROTATE_DISPLAY } },
218219
{ KE_KEY, 0x216a, { KEY_SETUP } },
220+
{ KE_KEY, 0x21a5, { KEY_PROG2 } }, /* HP Omen Key */
221+
{ KE_KEY, 0x21a7, { KEY_FN_ESC } },
219222
{ KE_KEY, 0x21a9, { KEY_TOUCHPAD_OFF } },
220223
{ KE_KEY, 0x121a9, { KEY_TOUCHPAD_ON } },
221224
{ KE_KEY, 0x231b, { KEY_HELP } },
@@ -810,6 +813,7 @@ static void hp_wmi_notify(u32 value, void *context)
810813
case HPWMI_SMART_ADAPTER:
811814
break;
812815
case HPWMI_BEZEL_BUTTON:
816+
case HPWMI_OMEN_KEY:
813817
key_code = hp_wmi_read_int(HPWMI_HOTKEY_QUERY);
814818
if (key_code < 0)
815819
break;

0 commit comments

Comments
 (0)