HID: Add suport for the brightness control keys on HP keyboards
authorKeng-Yu Lin <kengyu@canonical.com>
Fri, 6 Jul 2012 10:06:11 +0000 (18:06 +0800)
committerJiri Kosina <jkosina@suse.cz>
Mon, 9 Jul 2012 14:23:33 +0000 (16:23 +0200)
The keys are found on the keyboards bundled with HP All-In-One machines
with USB VID/PID of 04ca:004d and 04f2:1061.

Signed-off-by: Keng-Yu Lin <kengyu@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-input.c
include/linux/hid.h

index 132b0019365eed9057eeaaf0a3b222eece0853ad..879443bf410f68770074017c54f02d1dc5a3037c 100644 (file)
@@ -834,6 +834,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
                }
                break;
 
+       case HID_UP_HPVENDOR2:
+               set_bit(EV_REP, input->evbit);
+               switch (usage->hid & HID_USAGE) {
+               case 0x003: map_key_clear(KEY_BRIGHTNESSDOWN);  break;
+               case 0x004: map_key_clear(KEY_BRIGHTNESSUP);    break;
+               default:    goto ignore;
+               }
+               break;
+
        case HID_UP_MSVENDOR:
                goto ignore;
 
index 449fa385703df5375db5cad0786bbc4a7f35b716..42970de1b40c50deb1584d8f7aa459ccd4173a08 100644 (file)
@@ -200,6 +200,7 @@ struct hid_item {
 #define HID_UP_DIGITIZER       0x000d0000
 #define HID_UP_PID             0x000f0000
 #define HID_UP_HPVENDOR         0xff7f0000
+#define HID_UP_HPVENDOR2        0xff010000
 #define HID_UP_MSVENDOR                0xff000000
 #define HID_UP_CUSTOM          0x00ff0000
 #define HID_UP_LOGIVENDOR      0xffbc0000