diff options
author | Matthew Garrett <matthew.garrett@nebula.com> | 2013-07-08 11:44:40 -0400 |
---|---|---|
committer | Matthew Garrett <matthew.garrett@nebula.com> | 2013-07-08 11:44:40 -0400 |
commit | b253c9d1d858a3f115f791ee4fe2b9399ae7dbbd (patch) | |
tree | 95bf736f6c5ab8e90e3af82d6f46425606990d8a /drivers/platform/x86 | |
parent | d2b4a646717153a1a180b64d4a8464054dbd700e (diff) | |
download | linux-b253c9d1d858a3f115f791ee4fe2b9399ae7dbbd.tar.bz2 |
hp-wmi: Enable hotkeys on some systems
Kyle Evans discovered that he needed to set some bits in an EC register in
order to receive hotkey events. Doing so blindly broke some otherwise
working HP laptops. It turns out that there's a WMI call that accesses
the same register, so let's try calling that instead.
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Cc: Kyle Evans <kvans32@gmail.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r-- | drivers/platform/x86/hp-wmi.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index d111c8687f9b..6e142c3b5e97 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -53,6 +53,7 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4"); #define HPWMI_ALS_QUERY 0x3 #define HPWMI_HARDWARE_QUERY 0x4 #define HPWMI_WIRELESS_QUERY 0x5 +#define HPWMI_BIOS_QUERY 0x9 #define HPWMI_HOTKEY_QUERY 0xc #define HPWMI_WIRELESS2_QUERY 0x1b @@ -291,6 +292,19 @@ static int hp_wmi_tablet_state(void) return (state & 0x4) ? 1 : 0; } +static int hp_wmi_enable_hotkeys(void) +{ + int ret; + int query = 0x6e; + + ret = hp_wmi_perform_query(HPWMI_BIOS_QUERY, 1, &query, sizeof(query), + 0); + + if (ret) + return -EINVAL; + return 0; +} + static int hp_wmi_set_block(void *data, bool blocked) { enum hp_wmi_radio r = (enum hp_wmi_radio) data; @@ -948,6 +962,8 @@ static int __init hp_wmi_init(void) err = hp_wmi_input_setup(); if (err) return err; + + hp_wmi_enable_hotkeys(); } if (bios_capable) { |