HID: input: add mapping for "Toggle Display" key
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 18 Jan 2019 22:35:45 +0000 (14:35 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 27 Mar 2019 00:41:31 +0000 (17:41 -0700)
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>
drivers/hid/hid-input.c

index ecb1b6f268531753b634c53da15de6dd1882087b..da76358cde06fb4f8d01cc76e91ee5627af62db6 100644 (file)
@@ -677,6 +677,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
                        break;
                }
 
                        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.
                /*
                 * Some lazy vendors declare 255 usages for System Control,
                 * leading to the creation of ABS_X|Y axis and too many others.