aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn DeSilva <desilvjo@umich.edu>2014-09-05 11:13:17 -0400
committerJiri Kosina <jkosina@suse.cz>2014-09-08 03:48:56 -0400
commit5df4eb054fe056ecb15875e812fdadbc47568d7d (patch)
tree01a6fa2e47e03464e22aaa1d3179241bc03fc17f
parent643727a92e92efd657fbbbe70b3c35a49e537010 (diff)
HID: Add Holtek USB ID 04d9:a0c2 ETEKCITY Scroll
The report descriptor for the HOLTEK USB ID 04d9:a0c2 (ETEKCITY Scroll T-140 Gaming Mouse) is set to a very large amount of consumer usages (2^16), exceeding HID_MAX_USAGES. Added id, bindings and comments for the mouse, added to hid_have_special_driver, and reduced the usage and logical maximums to 0x2fff, consistent with the other mice in the category. Tested on the hardware. Signed-off-by: John C. DeSilva <desilvjo@umich.edu> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/hid-core.c1
-rw-r--r--drivers/hid/hid-holtek-mouse.c4
-rw-r--r--drivers/hid/hid-ids.h1
3 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index c527f5ec4cfc..eb50818de41f 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1793,6 +1793,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
1793 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A070) }, 1793 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A070) },
1794 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072) }, 1794 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072) },
1795 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) }, 1795 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) },
1796 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2) },
1796 { HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_TABLET) }, 1797 { HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_TABLET) },
1797 { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) }, 1798 { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) },
1798 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) }, 1799 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) },
diff --git a/drivers/hid/hid-holtek-mouse.c b/drivers/hid/hid-holtek-mouse.c
index d60fbd0adc0c..78b3a0c76775 100644
--- a/drivers/hid/hid-holtek-mouse.c
+++ b/drivers/hid/hid-holtek-mouse.c
@@ -29,6 +29,7 @@
29 * and Zalman ZM-GM1 29 * and Zalman ZM-GM1
30 * - USB ID 04d9:a081, sold as SHARKOON DarkGlider Gaming mouse 30 * - USB ID 04d9:a081, sold as SHARKOON DarkGlider Gaming mouse
31 * - USB ID 04d9:a072, sold as LEETGION Hellion Gaming Mouse 31 * - USB ID 04d9:a072, sold as LEETGION Hellion Gaming Mouse
32 * - USB ID 04d9:a0c2, sold as ETEKCITY Scroll T-140 Gaming Mouse
32 */ 33 */
33 34
34static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, 35static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc,
@@ -42,6 +43,7 @@ static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc,
42 switch (hdev->product) { 43 switch (hdev->product) {
43 case USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067: 44 case USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067:
44 case USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072: 45 case USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072:
46 case USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2:
45 if (*rsize >= 122 && rdesc[115] == 0xff && rdesc[116] == 0x7f 47 if (*rsize >= 122 && rdesc[115] == 0xff && rdesc[116] == 0x7f
46 && rdesc[120] == 0xff && rdesc[121] == 0x7f) { 48 && rdesc[120] == 0xff && rdesc[121] == 0x7f) {
47 hid_info(hdev, "Fixing up report descriptor\n"); 49 hid_info(hdev, "Fixing up report descriptor\n");
@@ -74,6 +76,8 @@ static const struct hid_device_id holtek_mouse_devices[] = {
74 USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072) }, 76 USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072) },
75 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, 77 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT,
76 USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) }, 78 USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) },
79 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT,
80 USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2) },
77 { } 81 { }
78}; 82};
79MODULE_DEVICE_TABLE(hid, holtek_mouse_devices); 83MODULE_DEVICE_TABLE(hid, holtek_mouse_devices);
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 3943ffe1a333..29e9b4872ebd 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -479,6 +479,7 @@
479#define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A070 0xa070 479#define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A070 0xa070
480#define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072 0xa072 480#define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072 0xa072
481#define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081 0xa081 481#define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081 0xa081
482#define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2 0xa0c2
482#define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096 0xa096 483#define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096 0xa096
483 484
484#define USB_VENDOR_ID_IMATION 0x0718 485#define USB_VENDOR_ID_IMATION 0x0718