]>
Commit | Line | Data |
---|---|---|
27d6b7f2 SL |
1 | From c7ecc3c23595c548487cbc0ed32e60285cf070f3 Mon Sep 17 00:00:00 2001 |
2 | From: Dmitry Torokhov <dmitry.torokhov@gmail.com> | |
3 | Date: Fri, 18 Jan 2019 14:35:45 -0800 | |
4 | Subject: HID: input: add mapping for "Toggle Display" key | |
5 | ||
6 | [ Upstream commit c01908a14bf735b871170092807c618bb9dae654 ] | |
7 | ||
8 | According to HUT 1.12 usage 0xb5 from the generic desktop page is reserved | |
9 | for switching between external and internal display, so let's add the | |
10 | mapping. | |
11 | ||
12 | Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> | |
13 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
14 | --- | |
15 | drivers/hid/hid-input.c | 8 ++++++++ | |
16 | 1 file changed, 8 insertions(+) | |
17 | ||
18 | diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c | |
19 | index 302a24931147b..9f7b1cf726a8d 100644 | |
20 | --- a/drivers/hid/hid-input.c | |
21 | +++ b/drivers/hid/hid-input.c | |
22 | @@ -607,6 +607,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |
23 | break; | |
24 | } | |
25 | ||
26 | + if ((usage->hid & 0xf0) == 0xb0) { /* SC - Display */ | |
27 | + switch (usage->hid & 0xf) { | |
28 | + case 0x05: map_key_clear(KEY_SWITCHVIDEOMODE); break; | |
29 | + default: goto ignore; | |
30 | + } | |
31 | + break; | |
32 | + } | |
33 | + | |
34 | /* | |
35 | * Some lazy vendors declare 255 usages for System Control, | |
36 | * leading to the creation of ABS_X|Y axis and too many others. | |
37 | -- | |
38 | 2.20.1 | |
39 |