Input: HID - add mapping for Powerbook USB keyboard
authorStelian Pop <stelian@popies.net>
Mon, 5 Sep 2005 06:57:33 +0000 (01:57 -0500)
committerDmitry Torokhov <dtor_core@ameritech.net>
Mon, 5 Sep 2005 06:57:33 +0000 (01:57 -0500)
Map custom HID events (such as the ones generated by some Logitech and
Apple Powerbooks USB keyboards) to the FN keycode.

Signed-off-by: Stelian Pop <stelian@popies.net>
Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/usb/input/hid-input.c
drivers/usb/input/hid.h

index 14acfc579f862d6551b9aa8f5eda2f4fe7d5e484..0b6452248a398ae38c47848d66416ea6dd07fcfc 100644 (file)
@@ -318,10 +318,18 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
                        break;
 
                case HID_UP_MSVENDOR:
-               case HID_UP_LOGIVENDOR:
                        goto ignore;
 
-               case HID_UP_LOGIVENDOR2: /* Reported on Logitech Ultra X Media Remote */
+               case HID_UP_CUSTOM: /* Reported on Logitech and Powerbook USB keyboards */
+
+                       set_bit(EV_REP, input->evbit);
+                       switch(usage->hid & HID_USAGE) {
+                               case 0x003: map_key_clear(KEY_FN);              break;
+                               default:    goto ignore;
+                       }
+                       break;
+
+               case HID_UP_LOGIVENDOR: /* Reported on Logitech Ultra X Media Remote */
 
                        set_bit(EV_REP, input->evbit);
                        switch(usage->hid & HID_USAGE) {
index 47f75a43a4685cd148d1a866722695869744576b..ec2412c42f1ea88bebe6a4aade4a2d3e6f82cf4a 100644 (file)
@@ -183,8 +183,8 @@ struct hid_item {
 #define HID_UP_PID             0x000f0000
 #define HID_UP_HPVENDOR         0xff7f0000
 #define HID_UP_MSVENDOR                0xff000000
-#define HID_UP_LOGIVENDOR      0x00ff0000
-#define HID_UP_LOGIVENDOR2     0xffbc0000
+#define HID_UP_CUSTOM          0x00ff0000
+#define HID_UP_LOGIVENDOR      0xffbc0000
 
 #define HID_USAGE              0x0000ffff