diff options
Diffstat (limited to 'drivers/usb/input')
-rw-r--r-- | drivers/usb/input/hid-core.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index 378af7ae2bfb..5d5221324e63 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Copyright (c) 1999 Andreas Gal | 4 | * Copyright (c) 1999 Andreas Gal |
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | 5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> |
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | 6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc |
7 | * Copyright (c) 2006 Jiri Kosina | 7 | * Copyright (c) 2006-2007 Jiri Kosina |
8 | */ | 8 | */ |
9 | 9 | ||
10 | /* | 10 | /* |
@@ -755,6 +755,7 @@ void usbhid_init_reports(struct hid_device *hid) | |||
755 | 755 | ||
756 | #define USB_VENDOR_ID_LOGITECH 0x046d | 756 | #define USB_VENDOR_ID_LOGITECH 0x046d |
757 | #define USB_DEVICE_ID_LOGITECH_USB_RECEIVER 0xc101 | 757 | #define USB_DEVICE_ID_LOGITECH_USB_RECEIVER 0xc101 |
758 | #define USB_DEVICE_ID_LOGITECH_USB_RECEIVER_2 0xc517 | ||
758 | 759 | ||
759 | #define USB_VENDOR_ID_IMATION 0x0718 | 760 | #define USB_VENDOR_ID_IMATION 0x0718 |
760 | #define USB_DEVICE_ID_DISC_STAKKA 0xd000 | 761 | #define USB_DEVICE_ID_DISC_STAKKA 0xd000 |
@@ -941,6 +942,7 @@ static const struct hid_blacklist { | |||
941 | { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET }, | 942 | { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET }, |
942 | 943 | ||
943 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_USB_RECEIVER, HID_QUIRK_BAD_RELATIVE_KEYS }, | 944 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_USB_RECEIVER, HID_QUIRK_BAD_RELATIVE_KEYS }, |
945 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_USB_RECEIVER_2, HID_QUIRK_LOGITECH_S510_DESCRIPTOR }, | ||
944 | 946 | ||
945 | { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, | 947 | { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, |
946 | 948 | ||
@@ -1038,6 +1040,22 @@ static void hid_fixup_sony_ps3_controller(struct usb_device *dev, int ifnum) | |||
1038 | kfree(buf); | 1040 | kfree(buf); |
1039 | } | 1041 | } |
1040 | 1042 | ||
1043 | /* | ||
1044 | * Logitech S510 keyboard sends in report #3 keys which are far | ||
1045 | * above the logical maximum described in descriptor. This extends | ||
1046 | * the original value of 0x28c of logical maximum to 0x104d | ||
1047 | */ | ||
1048 | static void hid_fixup_s510_descriptor(unsigned char *rdesc, int rsize) | ||
1049 | { | ||
1050 | if (rsize >= 90 && rdesc[83] == 0x26 | ||
1051 | && rdesc[84] == 0x8c | ||
1052 | && rdesc[85] == 0x02) { | ||
1053 | info("Fixing up Logitech S510 report descriptor"); | ||
1054 | rdesc[84] = rdesc[89] = 0x4d; | ||
1055 | rdesc[85] = rdesc[90] = 0x10; | ||
1056 | } | ||
1057 | } | ||
1058 | |||
1041 | static struct hid_device *usb_hid_configure(struct usb_interface *intf) | 1059 | static struct hid_device *usb_hid_configure(struct usb_interface *intf) |
1042 | { | 1060 | { |
1043 | struct usb_host_interface *interface = intf->cur_altsetting; | 1061 | struct usb_host_interface *interface = intf->cur_altsetting; |
@@ -1106,6 +1124,9 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
1106 | if ((quirks & HID_QUIRK_CYMOTION)) | 1124 | if ((quirks & HID_QUIRK_CYMOTION)) |
1107 | hid_fixup_cymotion_descriptor(rdesc, rsize); | 1125 | hid_fixup_cymotion_descriptor(rdesc, rsize); |
1108 | 1126 | ||
1127 | if (quirks & HID_QUIRK_LOGITECH_S510_DESCRIPTOR) | ||
1128 | hid_fixup_s510_descriptor(rdesc, rsize); | ||
1129 | |||
1109 | #ifdef CONFIG_HID_DEBUG | 1130 | #ifdef CONFIG_HID_DEBUG |
1110 | printk(KERN_DEBUG __FILE__ ": report descriptor (size %u, read %d) = ", rsize, n); | 1131 | printk(KERN_DEBUG __FILE__ ": report descriptor (size %u, read %d) = ", rsize, n); |
1111 | for (n = 0; n < rsize; n++) | 1132 | for (n = 0; n < rsize; n++) |