diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-01-18 14:35:45 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-16 19:41:19 +0200 |
commit | f7ab4818f74e4d7e796b59fe847de12beb7063b3 (patch) | |
tree | effd2c5cfd63aa815f0986b69ecad5e885b500e0 /drivers/hid | |
parent | bbdccc170adfd1ce1fb6c576b2cdf322ed959652 (diff) | |
download | linux-stable-f7ab4818f74e4d7e796b59fe847de12beb7063b3.tar.gz linux-stable-f7ab4818f74e4d7e796b59fe847de12beb7063b3.tar.bz2 linux-stable-f7ab4818f74e4d7e796b59fe847de12beb7063b3.zip |
HID: input: add mapping for "Toggle Display" key
[ Upstream commit c01908a14bf735b871170092807c618bb9dae654 ]
According to HUT 1.12 usage 0xb5 from the generic desktop page is reserved
for switching between external and internal display, so let's add the
mapping.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-input.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 55e6f18ff627..d988b92b20c8 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -677,6 +677,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel break; } + if ((usage->hid & 0xf0) == 0xb0) { /* SC - Display */ + switch (usage->hid & 0xf) { + case 0x05: map_key_clear(KEY_SWITCHVIDEOMODE); break; + default: goto ignore; + } + break; + } + /* * Some lazy vendors declare 255 usages for System Control, * leading to the creation of ABS_X|Y axis and too many others. |