linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: Add Holtek USB ID 04d9:a0c2 ETEKCITY Scroll
@ 2014-09-05  1:08 John DeSilva
  2014-09-05  8:35 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: John DeSilva @ 2014-09-05  1:08 UTC (permalink / raw)
  To: jkosina; +Cc: linux-input, linux-kernel, John DeSilva

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, 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>
---
 drivers/hid/hid-holtek-mouse.c | 4 ++++
 drivers/hid/hid-ids.h          | 1 +
 2 files changed, 5 insertions(+)

diff --git a/drivers/hid/hid-holtek-mouse.c b/drivers/hid/hid-holtek-mouse.c
index d60fbd0..78b3a0c 100644
--- a/drivers/hid/hid-holtek-mouse.c
+++ b/drivers/hid/hid-holtek-mouse.c
@@ -29,6 +29,7 @@
  *   and Zalman ZM-GM1
  * - USB ID 04d9:a081, sold as SHARKOON DarkGlider Gaming mouse
  * - USB ID 04d9:a072, sold as LEETGION Hellion Gaming Mouse
+ * - USB ID 04d9:a0c2, sold as ETEKCITY Scroll T-140 Gaming Mouse
  */
 
 static __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,
 		switch (hdev->product) {
 		case USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067:
 		case USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072:
+		case USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2:
 			if (*rsize >= 122 && rdesc[115] == 0xff && rdesc[116] == 0x7f
 					&& rdesc[120] == 0xff && rdesc[121] == 0x7f) {
 				hid_info(hdev, "Fixing up report descriptor\n");
@@ -74,6 +76,8 @@ static const struct hid_device_id holtek_mouse_devices[] = {
 			USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT,
 			USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT,
+			USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2) },
 	{ }
 };
 MODULE_DEVICE_TABLE(hid, holtek_mouse_devices);
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 25cd674..c7b36ad 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -479,6 +479,7 @@
 #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A070	0xa070
 #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072	0xa072
 #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081	0xa081
+#define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2	0xa0c2
 #define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096	0xa096
 
 #define USB_VENDOR_ID_IMATION		0x0718
-- 
1.8.5.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: Add Holtek USB ID 04d9:a0c2 ETEKCITY Scroll
  2014-09-05  1:08 [PATCH] HID: Add Holtek USB ID 04d9:a0c2 ETEKCITY Scroll John DeSilva
@ 2014-09-05  8:35 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2014-09-05  8:35 UTC (permalink / raw)
  To: John DeSilva; +Cc: linux-input, linux-kernel

On Thu, 4 Sep 2014, John DeSilva wrote:

> 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, 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>

Thanks for the patch.

> ---
>  drivers/hid/hid-holtek-mouse.c | 4 ++++
>  drivers/hid/hid-ids.h          | 1 +
>  2 files changed, 5 insertions(+)
> 
> diff --git a/drivers/hid/hid-holtek-mouse.c b/drivers/hid/hid-holtek-mouse.c
> index d60fbd0..78b3a0c 100644
> --- a/drivers/hid/hid-holtek-mouse.c
> +++ b/drivers/hid/hid-holtek-mouse.c
> @@ -29,6 +29,7 @@
>   *   and Zalman ZM-GM1
>   * - USB ID 04d9:a081, sold as SHARKOON DarkGlider Gaming mouse
>   * - USB ID 04d9:a072, sold as LEETGION Hellion Gaming Mouse
> + * - USB ID 04d9:a0c2, sold as ETEKCITY Scroll T-140 Gaming Mouse
>   */
>  
>  static __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,
>  		switch (hdev->product) {
>  		case USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067:
>  		case USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072:
> +		case USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2:
>  			if (*rsize >= 122 && rdesc[115] == 0xff && rdesc[116] == 0x7f
>  					&& rdesc[120] == 0xff && rdesc[121] == 0x7f) {
>  				hid_info(hdev, "Fixing up report descriptor\n");
> @@ -74,6 +76,8 @@ static const struct hid_device_id holtek_mouse_devices[] = {
>  			USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT,
>  			USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) },
> +	{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT,
> +			USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2) },

You also need entry in hid_have_special_driver[] to make sure that 
hid-core doesn't override hid-holtek-mouse.

Could you please fix that and resend? Thanks.

>  	{ }
>  };
>  MODULE_DEVICE_TABLE(hid, holtek_mouse_devices);
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> index 25cd674..c7b36ad 100644
> --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
> @@ -479,6 +479,7 @@
>  #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A070	0xa070
>  #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072	0xa072
>  #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081	0xa081
> +#define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2	0xa0c2
>  #define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096	0xa096
>  
>  #define USB_VENDOR_ID_IMATION		0x0718
> -- 
> 1.8.5.5
> 

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-05  8:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-05  1:08 [PATCH] HID: Add Holtek USB ID 04d9:a0c2 ETEKCITY Scroll John DeSilva
2014-09-05  8:35 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).