[PATCH 22/26] HID - add mapping for Powerbook USB keyboard

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Subject: [PATCH] Input: HID - add mapping for Powerbook USB keyboard
From: Stelian Pop <[email protected]>
Date: 1125903453 -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 <[email protected]>
Signed-off-by: Vojtech Pavlik <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>

---

 drivers/usb/input/hid-input.c |   12 ++++++++++--
 drivers/usb/input/hid.h       |    4 ++--
 2 files changed, 12 insertions(+), 4 deletions(-)

e875ce374759087771313c9e76b672b86ac20950
diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c
--- a/drivers/usb/input/hid-input.c
+++ b/drivers/usb/input/hid-input.c
@@ -318,10 +318,18 @@ static void hidinput_configure_usage(str
 			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) {
diff --git a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h
--- a/drivers/usb/input/hid.h
+++ b/drivers/usb/input/hid.h
@@ -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
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux