From: Stelian Pop <stelian@popies.net>

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>
Cc: Vojtech Pavlik <vojtech@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

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

diff -puN drivers/usb/input/hid.h~apple-powerbook-usb-keyboard-hid-fix drivers/usb/input/hid.h
--- devel/drivers/usb/input/hid.h~apple-powerbook-usb-keyboard-hid-fix	2005-08-06 15:14:19.000000000 -0700
+++ devel-akpm/drivers/usb/input/hid.h	2005-08-06 15:14:19.000000000 -0700
@@ -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
 
diff -puN drivers/usb/input/hid-input.c~apple-powerbook-usb-keyboard-hid-fix drivers/usb/input/hid-input.c
--- devel/drivers/usb/input/hid-input.c~apple-powerbook-usb-keyboard-hid-fix	2005-08-06 15:14:19.000000000 -0700
+++ devel-akpm/drivers/usb/input/hid-input.c	2005-08-06 15:14:19.000000000 -0700
@@ -318,10 +318,17 @@ 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 (at least) on some Logitech and
+			 * Apple Powerbook USB keyboards
+			 */
+			map_key_clear(KEY_FN);
+			break;
+
+		case HID_UP_LOGIVENDOR: /* Reported on Logitech Ultra X Media Remote */
 
 			set_bit(EV_REP, input->evbit);
 			switch(usage->hid & HID_USAGE) {
_