Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68669
b: refs/heads/master
c: 08f0617
h: refs/heads/master
i:
  68667: 7a54d83
v: v3
  • Loading branch information
Tomoya Adachi authored and Jiri Kosina committed Oct 14, 2007
1 parent e1597d4 commit 924244c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0ce1ac3b3ca0f44682aed210ba6062bafc2e32fa
refs/heads/master: 08f06177f4089abeba904cc12a2a50cffa9ffce6
17 changes: 17 additions & 0 deletions trunk/drivers/hid/usbhid/hid-quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,8 @@ static const struct hid_rdesc_blacklist {
{ USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER, HID_QUIRK_RDESC_LOGITECH },
{ USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER_2, HID_QUIRK_RDESC_LOGITECH },

{ USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_RDESC_MACBOOK_JIS },

{ USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE, HID_QUIRK_RDESC_PETALYNX },

{ USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1, HID_QUIRK_RDESC_SWAPPED_MIN_MAX },
Expand Down Expand Up @@ -937,6 +939,18 @@ static void usbhid_fixup_cypress_descriptor(unsigned char *rdesc, int rsize)
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)
{
Expand All @@ -951,6 +965,9 @@ static void __usbhid_fixup_report_descriptor(__u32 quirks, char *rdesc, unsigned

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);
}

/**
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,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
Expand Down

0 comments on commit 924244c

Please sign in to comment.