diff options
author | Tomoya Adachi <adachi@il.is.s.u-tokyo.ac.jp> | 2007-10-03 17:27:49 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2007-10-14 07:40:01 -0400 |
commit | 08f06177f4089abeba904cc12a2a50cffa9ffce6 (patch) | |
tree | 8c64f7016c107c7941773bd15d58406741e7376f /drivers/hid | |
parent | 0ce1ac3b3ca0f44682aed210ba6062bafc2e32fa (diff) |
USBHID: report descriptor fix for MacBook JIS keyboard
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>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/usbhid/hid-quirks.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 91abac6a30c..a0d6f081ee5 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -624,6 +624,8 @@ static const struct hid_rdesc_blacklist { | |||
624 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER, HID_QUIRK_RDESC_LOGITECH }, | 624 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER, HID_QUIRK_RDESC_LOGITECH }, |
625 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER_2, HID_QUIRK_RDESC_LOGITECH }, | 625 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER_2, HID_QUIRK_RDESC_LOGITECH }, |
626 | 626 | ||
627 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_RDESC_MACBOOK_JIS }, | ||
628 | |||
627 | { USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE, HID_QUIRK_RDESC_PETALYNX }, | 629 | { USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE, HID_QUIRK_RDESC_PETALYNX }, |
628 | 630 | ||
629 | { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1, HID_QUIRK_RDESC_SWAPPED_MIN_MAX }, | 631 | { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1, HID_QUIRK_RDESC_SWAPPED_MIN_MAX }, |
@@ -937,6 +939,18 @@ static void usbhid_fixup_cypress_descriptor(unsigned char *rdesc, int rsize) | |||
937 | printk(KERN_INFO "Fixing up Cypress report descriptor\n"); | 939 | printk(KERN_INFO "Fixing up Cypress report descriptor\n"); |
938 | } | 940 | } |
939 | 941 | ||
942 | /* | ||
943 | * MacBook JIS keyboard has wrong logical maximum | ||
944 | */ | ||
945 | static void usbhid_fixup_macbook_descriptor(unsigned char *rdesc, int rsize) | ||
946 | { | ||
947 | if (rsize >= 60 && rdesc[53] == 0x65 | ||
948 | && rdesc[59] == 0x65) { | ||
949 | printk(KERN_INFO "Fixing up MacBook JIS keyboard report descriptor\n"); | ||
950 | rdesc[53] = rdesc[59] = 0xe7; | ||
951 | } | ||
952 | } | ||
953 | |||
940 | 954 | ||
941 | static void __usbhid_fixup_report_descriptor(__u32 quirks, char *rdesc, unsigned rsize) | 955 | static void __usbhid_fixup_report_descriptor(__u32 quirks, char *rdesc, unsigned rsize) |
942 | { | 956 | { |
@@ -951,6 +965,9 @@ static void __usbhid_fixup_report_descriptor(__u32 quirks, char *rdesc, unsigned | |||
951 | 965 | ||
952 | if (quirks & HID_QUIRK_RDESC_PETALYNX) | 966 | if (quirks & HID_QUIRK_RDESC_PETALYNX) |
953 | usbhid_fixup_petalynx_descriptor(rdesc, rsize); | 967 | usbhid_fixup_petalynx_descriptor(rdesc, rsize); |
968 | |||
969 | if (quirks & HID_QUIRK_RDESC_MACBOOK_JIS) | ||
970 | usbhid_fixup_macbook_descriptor(rdesc, rsize); | ||
954 | } | 971 | } |
955 | 972 | ||
956 | /** | 973 | /** |