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

Re: status of fn-key.patch for 2.6.14



Hello Jochen,

On Fri, 28 Oct 2005 the mental interface of
Jochen Voss told:

> Hello Yves-Alexis,
[...]
> Marc-Christian Petersen sent me a patch for inclusion on my powerbook
> page.  I did not yet find time to try it, but I append it to this email
> so you can have a go.
That patch works, but has some offset chunks by reverting the patch.
The attached one is for the Debian sources 2.6.14-1 and applies
without chunks in both directions.

Elimar


-- 
  "Talking much about oneself can also 
   be a means to conceal oneself."
         -Friedrich Nietzsche
diff -Naur a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c	2005-10-29 12:51:55.000000000 +0200
+++ b/drivers/usb/input/hid-core.c	2005-10-29 12:51:38.000000000 +0200
@@ -1451,6 +1451,9 @@
  * Alphabetically sorted blacklist by quirk type.
  */
 
+#define USB_DEVICE_ID_POWERBOOK_KB_US	0x020E
+#define USB_DEVICE_ID_POWERBOOK_KB_UK	0x020F
+
 static struct hid_blacklist {
 	__u16 idVendor;
 	__u16 idProduct;
@@ -1566,6 +1569,9 @@
 	{ USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD, HID_QUIRK_BADPAD },
 	{ USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD, HID_QUIRK_BADPAD },
 
+	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_POWERBOOK_KB_US, HID_QUIRK_POWERBOOK_FN_BUTTON },
+	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_POWERBOOK_KB_UK, HID_QUIRK_POWERBOOK_FN_BUTTON },
+
 	{ 0, 0 }
 };
 
diff -Naur a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c
--- a/drivers/usb/input/hid-input.c	2005-10-29 12:51:55.000000000 +0200
+++ b/drivers/usb/input/hid-input.c	2005-10-29 12:51:38.000000000 +0200
@@ -107,6 +107,10 @@
 			} else
 				map_key(KEY_UNKNOWN);
 
+			if ((device->quirks & HID_QUIRK_POWERBOOK_FN_BUTTON) &&
+			    (hid_keyboard[usage->hid & HID_USAGE] == KEY_RIGHTCTRL))
+				map_key(KEY_UNKNOWN);
+
 			break;
 
 		case HID_UP_BUTTON:
@@ -320,15 +324,17 @@
 		case HID_UP_MSVENDOR:
 			goto ignore;
 
-		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;
-
+/*	Who has shit who in his head for this? The need for XFree/Xorg to change their
+ *	input drivers? No thanks. (mcp)
+ *		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);
@@ -380,6 +386,10 @@
 
 		default:
 		unknown:
+			if ((device->quirks & HID_QUIRK_POWERBOOK_FN_BUTTON) && (usage->hid == 0x00ff0003)) {
+				map_key_clear(KEY_RIGHTCTRL);
+				break;
+			}
 			if (field->report_size == 1) {
 				if (field->report->type == HID_OUTPUT_REPORT) {
 					map_led(LED_MISC);
diff -Naur a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h
--- a/drivers/usb/input/hid.h	2005-10-29 12:51:55.000000000 +0200
+++ b/drivers/usb/input/hid.h	2005-10-29 12:51:38.000000000 +0200
@@ -246,6 +246,7 @@
 #define HID_QUIRK_2WHEEL_MOUSE_HACK_5		0x100
 #define HID_QUIRK_2WHEEL_MOUSE_HACK_ON		0x200
 #define HID_QUIRK_2WHEEL_POWERMOUSE		0x400
+#define HID_QUIRK_POWERBOOK_FN_BUTTON		0x800
 
 /*
  * This is the global environment of the parser. This information is

Reply to: