From: Tomoya Adachi <adachi@il.is.s.u-tokyo.ac.jp>
This patch fixes the problem, that Japanese MacBook doesn't recognize some keys
like '\'(yen, or backslash), '|'(pipe), and '_'(underscore).
It is due to that MacBook JIS keyboard (jp106) sends wrong report descriptor.
It saids "logical maximum = 0x65", so Keyboard.0089 is mapped to Key.Unknown,
while it should be accepted as Key.Yen.
Signed-off-by: Tomoya Adachi <adachi@il.is.s.u-tokyo.ac.jp>
---
diff -uprN -X linux-2.6.23-rc9/Documentation/dontdiff linux-2.6.23-rc9/drivers/hid/usbhid/hid-quirks.c linux-2.6.23-rc9-patched/drivers/hid/usbhid/hid-quirks.c
--- linux-2.6.23-rc9/drivers/hid/usbhid/hid-quirks.c 2007-10-04 02:52:01.000000000 +0900
+++ linux-2.6.23-rc9-patched/drivers/hid/usbhid/hid-quirks.c 2007-10-04 06:03:45.000000000 +0900
@@ -619,6 +619,8 @@ static const struct hid_rdesc_blacklist
{ USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1, HID_QUIRK_RDESC_SWAPPED_MIN_MAX },
{ USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2, HID_QUIRK_RDESC_SWAPPED_MIN_MAX },
+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_RDESC_MACBOOK_JIS },
+
{ 0, 0 }
};
@@ -927,6 +929,18 @@ static void usbhid_fixup_cypress_descrip
printk(KERN_INFO "Fixing up Cypress report descriptor\n");
}
+/*
+ * MacBook JIS keyboard has wrong logical maximum
+ */
+static void usbhid_fixup_macbook_descriptor(unsigned char *rdesc, int rsize)
+{
+ if (rsize >= 60 && rdesc[53] == 0x65
+ && rdesc[59] == 0x65) {
+ printk(KERN_INFO "Fixing up MacBook JIS keyboard report descriptor\n");
+ rdesc[53] = rdesc[59] = 0xe7;
+ }
+}
+
static void __usbhid_fixup_report_descriptor(__u32 quirks, char *rdesc, unsigned rsize)
{
@@ -941,6 +955,9 @@ static void __usbhid_fixup_report_descri
if (quirks & HID_QUIRK_RDESC_PETALYNX)
usbhid_fixup_petalynx_descriptor(rdesc, rsize);
+
+ if (quirks & HID_QUIRK_RDESC_MACBOOK_JIS)
+ usbhid_fixup_macbook_descriptor(rdesc, rsize);
}
/**
diff -uprN -X linux-2.6.23-rc9/Documentation/dontdiff linux-2.6.23-rc9/include/linux/hid.h linux-2.6.23-rc9-patched/include/linux/hid.h
--- linux-2.6.23-rc9/include/linux/hid.h 2007-10-04 02:52:03.000000000 +0900
+++ linux-2.6.23-rc9-patched/include/linux/hid.h 2007-10-04 06:00:57.000000000 +0900
@@ -285,6 +285,7 @@ struct hid_item {
#define HID_QUIRK_RDESC_LOGITECH 0x00000002
#define HID_QUIRK_RDESC_SWAPPED_MIN_MAX 0x00000004
#define HID_QUIRK_RDESC_PETALYNX 0x00000008
+#define HID_QUIRK_RDESC_MACBOOK_JIS 0x00000010
/*
* This is the global environment of the parser. This information is
-
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Andrew Morton | 2.6.25-mm1 |
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
git: | |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| David Miller | [GIT]: Networking |
| Natalie Protasevich | [BUG] New Kernel Bugs |
