2008-11-05 19:07:25

by Vincent Hanquez

[permalink] [raw]
Subject: [PATCH] hid update for macbook brick fn key

Hi Jiri and LKML,

The following patch add support for late 2008 macbook (apparently
codename 'brick') keyboard that was missing the fn key behavior.

I only have and tested the _ISO flavor, but i've added ANSI (usa) and
RIS (japan) keyboard ids too, by following the same order as all previous
apple keyboard quirks.

-----

add HID support for fn key on late2008 macbook.

Signed-off-by: Vincent Hanquez <[email protected]>

diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
index c6ab4ba..d7c6a4c 100644
--- a/drivers/hid/hid-apple.c
+++ b/drivers/hid/hid-apple.c
@@ -418,6 +418,12 @@ static const struct hid_device_id apple_devices[] = {
.driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS),
.driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_BRICK_ANSI),
+ .driver_data = APPLE_HAS_FN },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_BRICK_ISO),
+ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_BRICK_JIS),
+ .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY),
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY),
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 1903e75..9e58950 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1250,6 +1250,9 @@ static const struct hid_device_id hid_blacklist[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_BRICK_ANSI) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_BRICK_ISO) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_BRICK_JIS) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_AVERMEDIA, USB_DEVICE_ID_AVER_FM_MR800) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 5cc4042..98b090e 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -82,6 +82,9 @@
#define USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI 0x0230
#define USB_DEVICE_ID_APPLE_WELLSPRING2_ISO 0x0231
#define USB_DEVICE_ID_APPLE_WELLSPRING2_JIS 0x0232
+#define USB_DEVICE_ID_APPLE_BRICK_ANSI 0x0236
+#define USB_DEVICE_ID_APPLE_BRICK_ISO 0x0237
+#define USB_DEVICE_ID_APPLE_BRICK_JIS 0x0238
#define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a
#define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b
#define USB_DEVICE_ID_APPLE_ATV_IRCONTROL 0x8241


2008-11-05 19:26:52

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH] hid update for macbook brick fn key

On 11/05/2008 08:01 PM, Vincent Hanquez wrote:
> The following patch add support for late 2008 macbook (apparently
> codename 'brick') keyboard that was missing the fn key behavior.

Unfortunately similar patch was already sent by Henrik few days ago:
http://lkml.org/lkml/2008/11/4/331

2008-11-05 19:28:40

by Vincent Hanquez

[permalink] [raw]
Subject: Re: [PATCH] hid update for macbook brick fn key

On Wed, Nov 05, 2008 at 08:26:27PM +0100, Jiri Slaby wrote:
> On 11/05/2008 08:01 PM, Vincent Hanquez wrote:
> > The following patch add support for late 2008 macbook (apparently
> > codename 'brick') keyboard that was missing the fn key behavior.
>
> Unfortunately similar patch was already sent by Henrik few days ago:
> http://lkml.org/lkml/2008/11/4/331

ah well, nevermind.
i guess that's good they are exactly the same patch :)

Thanks,
--
Vincent