Re: [PATCH] [RESEND] fix HID quirks for aluminium apple wireless keyboards

Previous thread: [PATCHv4] SGI UV: TLB shootdown using broadcast assist unit by Cliff Wickman on Thursday, June 12, 2008 - 5:23 am. (6 messages)

Next thread: Re: [PATCH] ssb: Partial revert of 4ac5846 to fix coherent DMA mask setting by Michael Buesch on Thursday, June 12, 2008 - 5:52 am. (1 message)
From: Paul Collins
Date: Thursday, June 12, 2008 - 5:26 am

Hi Marcel and Jiri,

I noticed that the quirks for Bluetooth Apple keyboards seem to have
been incorrectly added to the USB HID, thus rendering them ineffective.
Here is a patch that moves them to the Bluetooth HID.  With this patch
applied the Fn key on my Apple wireless keyboard now works as expected.

I also took the liberty of adding defines for the vendor and for the
existing Mighty Mouse quirk.

Signed-off-by: Paul Collins <paul@ondioline.org

diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 1df832a..ff41c07 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -72,9 +72,6 @@
 #define USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI    0x0229
 #define USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO     0x022a
 #define USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS     0x022b
-#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI  0x022c
-#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO   0x022d
-#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS   0x022e
 #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY	0x030a
 #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY	0x030b
 #define USB_DEVICE_ID_APPLE_IRCONTROL4	0x8242
@@ -639,9 +636,6 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
 	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
 	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
-	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN },
-	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
-	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS, ...
From: Paul Collins
Date: Thursday, June 12, 2008 - 5:57 am

Hi Marcel and Jiri,

I noticed that the quirks for Bluetooth Apple keyboards seem to have
been incorrectly added to the USB HID, thus rendering them ineffective.
Here is a patch that moves them to the Bluetooth HID.  With this patch
applied the Fn key on my Apple wireless keyboard now works as expected.

I also took the liberty of adding defines for the vendor and for the
existing Mighty Mouse quirk.

Signed-off-by: Paul Collins <paul@ondioline.org>

---
Here's a new version with corrected Signed-off-by line.  Also the
previous one was truncated by gmane; with any luck this makes it.

diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 1df832a..ff41c07 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -72,9 +72,6 @@
 #define USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI    0x0229
 #define USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO     0x022a
 #define USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS     0x022b
-#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI  0x022c
-#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO   0x022d
-#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS   0x022e
 #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY	0x030a
 #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY	0x030b
 #define USB_DEVICE_ID_APPLE_IRCONTROL4	0x8242
@@ -639,9 +636,6 @@ static const struct hid_blacklist {
 	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
 	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
 	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
-	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN },
-	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | ...
From: Phil Endecott
Date: Thursday, June 12, 2008 - 6:17 am

Hi Paul,

Did you see my messages about this a few weeks ago?  
http://thread.gmane.org/gmane.linux.kernel.input/4984

I didn't post a patch because I believe that this stuff has all moved as a 
result of Jiri Slaby's patch "HID: move apple quirks" posted to linux-input 
on 2008-05-16.  One of us should prepare a patch against the tree after 
that patch.

Does HID_QUIRK_APPLE_NUMLOCK_EMULATION do anything useful on these keyboards?  
I have not enabled it.

Do you know what happens if you have a USB bluetooth dongle with HID proxy 
mode?  My assumption was that the vendor and product IDs from the keyboard 
would then appear to the kernel as USB IDs.  If this is true, then you should 
keep the existing entries for these devices in the USB quirks tables.  Does 
anyone know if HID proxy dongles actually do this?  In any case, leaving 
the existing entries in the USB quirks table can't do any harm.

I wrote this up at http://chezphil.org/apple-alu-bluetooth-kb-linux/ and I'll 
just post that URL again to help the search engines...

Cheers,

Phil.

--

From: Paul Collins
Date: Thursday, June 12, 2008 - 7:55 am

Hmm, no idea.  Absent confirmation I guess I'll drop the USB HID changes

Nice writeup!  Small correction: when the quirk is active, you can
generate forward delete by pressing Fn-backspace.

-- 
Paul Collins
Wellington, New Zealand

Dag vijandelijk luchtschip de huismeester is dood
--

From: Marcel Holtmann
Date: Thursday, June 12, 2008 - 1:08 pm

I prefer not to do this. I don't see any benefit or readability coming
out of it. Leave it as it is. Add the numeric ids and then a line on top
of it describing the devices.

Regards

Marcel


--

Previous thread: [PATCHv4] SGI UV: TLB shootdown using broadcast assist unit by Cliff Wickman on Thursday, June 12, 2008 - 5:23 am. (6 messages)

Next thread: Re: [PATCH] ssb: Partial revert of 4ac5846 to fix coherent DMA mask setting by Michael Buesch on Thursday, June 12, 2008 - 5:52 am. (1 message)