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

Re: status of fn-key.patch for 2.6.14



Hello Yves-Alexis,

On Fri, Oct 28, 2005 at 12:48:45PM +0200, Yves-Alexis Perez wrote:
> as some people now, the fn-key.patch [0] for powerbooks doesnt work with
> 2.6.14 kernels. I've seen some threads here with people trying to
> correct this patch. Is there any progress ?

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.

As far as I understand it, it disables the new (and not yet supported)
2.6.14 mechanism and reenables the old patch instead.  As soon as the
console keyboard utilities and the X-Server support the new mechanism,
the patch will probably no longer be necessary.

I hope this helps,
Jochen
-- 
http://seehuhn.de/
# 2.6.14-WOLK4.0
#
# original version from: Stelian Pop <stelian@popies.net>
# 2.6.14 fix from: Marc-Christian Petersen

diff -puN drivers/usb/input/hid-core.c drivers/usb/input/hid-core.c
--- old/drivers/usb/input/hid-core.c 	2005-10-28  01:23:58.000000000 -0200
+++ new/drivers/usb/input/hid-core.c	2005-10-28  01:23:58.000000000 -0200
@@ -1451,6 +1451,9 @@ void hid_init_reports(struct hid_device 
  * 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 +1566,9 @@ static struct hid_blacklist {
 	{ 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 -puN drivers/usb/input/hid.h drivers/usb/input/hid.h
--- old/drivers/usb/input/hid.h 	2005-10-28  01:23:58.000000000 -0200
+++ new/drivers/usb/input/hid.h	2005-10-28  01:23:58.000000000 -0200
@@ -246,6 +246,7 @@ struct hid_item {
 #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
diff -puN drivers/usb/input/hid-input.c drivers/usb/input/hid-input.c
--- old/drivers/usb/input/hid-input.c 	2005-10-28  01:23:58.000000000 -0200
+++ new/drivers/usb/input/hid-input.c	2005-10-28  01:23:58.000000000 -0200
@@ -107,6 +107,10 @@ static void hidinput_configure_usage(str
 			} 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 +320,17 @@ static void hidinput_configure_usage(str
 		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 +380,10 @@ static void hidinput_configure_usage(str
 
 		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);
_

Attachment: signature.asc
Description: Digital signature


Reply to: