All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Phil Endecott" <phil_wueww_endecott@chezphil.org>
To: Paul Collins <paul@burly.ondioline.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, marcel@holtmann.org, jkosina@suse.cz
Subject: Re: [PATCH] [RESEND] fix HID quirks for aluminium apple wireless keyboards
Date: Thu, 12 Jun 2008 14:17:16 +0100	[thread overview]
Message-ID: <1213276636216@dmwebmail.dmwebmail.chezphil.org> (raw)
In-Reply-To: <874p7ylsj0.fsf@burly.wgtn.ondioline.org>

Paul Collins wrote:
> 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 | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
> -	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN },
>  	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
>  	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
>  
> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
> index 519cdb9..f0762e5 100644
> --- a/net/bluetooth/hidp/core.c
> +++ b/net/bluetooth/hidp/core.c
> @@ -671,14 +671,26 @@ static void hidp_close(struct hid_device *hid)
>  {
>  }
>  
> +#define BT_VENDOR_ID_APPLE				0x05ac
> +
> +#define BT_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI		0x022c
> +#define BT_DEVICE_ID_APPLE_ALU_WIRELESS_ISO		0x022d
> +#define BT_DEVICE_ID_APPLE_ALU_WIRELESS_JIS		0x022e
> +#define BT_DEVICE_ID_APPLE_MIGHTY_MOUSE_WIRELESS	0x030c
> +
>  static const struct {
>  	__u16 idVendor;
>  	__u16 idProduct;
>  	unsigned quirks;
>  } hidp_blacklist[] = {
> -	/* Apple wireless Mighty Mouse */
> -	{ 0x05ac, 0x030c, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL },
> -
> +	{ BT_VENDOR_ID_APPLE, BT_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI,
> +	  HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN },
> +	{ BT_VENDOR_ID_APPLE, BT_DEVICE_ID_APPLE_ALU_WIRELESS_ISO,
> +	  HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
> +	{ BT_VENDOR_ID_APPLE, BT_DEVICE_ID_APPLE_ALU_WIRELESS_JIS,
> +	  HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN },
> +	{ BT_VENDOR_ID_APPLE, BT_DEVICE_ID_APPLE_MIGHTY_MOUSE_WIRELESS,
> +	  HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL },
>  	{ }	/* Terminating entry */
>  };
>  

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.

WARNING: multiple messages have this Message-ID (diff)
From: "Phil Endecott" <phil_wueww_endecott@chezphil.org>
To: "Paul Collins" <paul@burly.ondioline.org>
Cc: <linux-input@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-usb@vger.kernel.org>, <marcel@holtmann.org>,
	<jkosina@suse.cz>
Subject: Re: [PATCH] [RESEND] fix HID quirks for aluminium apple wireless keyboards
Date: Thu, 12 Jun 2008 14:17:16 +0100	[thread overview]
Message-ID: <1213276636216@dmwebmail.dmwebmail.chezphil.org> (raw)
In-Reply-To: <874p7ylsj0.fsf@burly.wgtn.ondioline.org>

Paul Collins wrote:
> 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 | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
> -	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN },
>  	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
>  	{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE },
>  
> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
> index 519cdb9..f0762e5 100644
> --- a/net/bluetooth/hidp/core.c
> +++ b/net/bluetooth/hidp/core.c
> @@ -671,14 +671,26 @@ static void hidp_close(struct hid_device *hid)
>  {
>  }
>  
> +#define BT_VENDOR_ID_APPLE				0x05ac
> +
> +#define BT_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI		0x022c
> +#define BT_DEVICE_ID_APPLE_ALU_WIRELESS_ISO		0x022d
> +#define BT_DEVICE_ID_APPLE_ALU_WIRELESS_JIS		0x022e
> +#define BT_DEVICE_ID_APPLE_MIGHTY_MOUSE_WIRELESS	0x030c
> +
>  static const struct {
>  	__u16 idVendor;
>  	__u16 idProduct;
>  	unsigned quirks;
>  } hidp_blacklist[] = {
> -	/* Apple wireless Mighty Mouse */
> -	{ 0x05ac, 0x030c, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL },
> -
> +	{ BT_VENDOR_ID_APPLE, BT_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI,
> +	  HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN },
> +	{ BT_VENDOR_ID_APPLE, BT_DEVICE_ID_APPLE_ALU_WIRELESS_ISO,
> +	  HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD },
> +	{ BT_VENDOR_ID_APPLE, BT_DEVICE_ID_APPLE_ALU_WIRELESS_JIS,
> +	  HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN },
> +	{ BT_VENDOR_ID_APPLE, BT_DEVICE_ID_APPLE_MIGHTY_MOUSE_WIRELESS,
> +	  HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL },
>  	{ }	/* Terminating entry */
>  };
>  

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.


  reply	other threads:[~2008-06-12 13:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-12 12:26 [PATCH] fix HID quirks for aluminium apple wireless keyboards Paul Collins
2008-06-12 12:26 ` Paul Collins
     [not found] ` <87iqweltzo.fsf-D7l3p2TGOOdLdt5/z87VRY6ehsQQaF5K@public.gmane.org>
2008-06-12 12:57   ` [PATCH] [RESEND] " Paul Collins
2008-06-12 12:57     ` Paul Collins
2008-06-12 13:17     ` Phil Endecott [this message]
2008-06-12 13:17       ` Phil Endecott
     [not found]       ` <1213276636216-YnoLgZYwwYuCbKHnblo0pmrPP3OPMK55cpQHUIT47Ck@public.gmane.org>
2008-06-12 14:55         ` Paul Collins
2008-06-12 14:55           ` Paul Collins
2008-06-12 20:08     ` Marcel Holtmann
2008-06-14  8:03       ` Paul Collins
2008-06-14 12:22         ` Marcel Holtmann
2008-06-17 13:54           ` Jiri Kosina
2008-06-14 12:51         ` Phil Endecott
2008-06-14 12:51           ` Phil Endecott
2008-06-18 10:19           ` Paul Collins
2008-06-18 10:19             ` Paul Collins
2008-06-18 10:47             ` Phil Endecott
2008-06-18 10:47               ` Phil Endecott
2008-06-27 16:32         ` Jan Scholz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1213276636216@dmwebmail.dmwebmail.chezphil.org \
    --to=phil_wueww_endecott@chezphil.org \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=paul@burly.ondioline.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.