Re: [PATCH 2/2] HID: corsair: Add driver Scimitar Pro RGB gaming mouse 1b1c:1b3e

From: Jiri Kosina
Date: Mon Mar 06 2017 - 07:57:31 EST


On Fri, 10 Feb 2017, Oscar Campos wrote:

> This mouse sold by Corsair as Scimitar PRO RGB defines two consecutive
> Logical Minimum items in its Application (Consumer.0001) report making
> it non parseable. This driver fixes the report descriptor overriding
> byte 77 in rdesc from 0x16 (Logical Minimum with 16 bits value) to 0x26
> (Logical Maximum with 16 bits value).
>
> Signed-off-by: Oscar Campos <oscar.campos@xxxxxxxxxxxxxx>
> ---
> drivers/hid/Kconfig | 10 ++++++
> drivers/hid/Makefile | 1 +
> drivers/hid/hid-corsair-mouse.c | 76 +++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 87 insertions(+)
> create mode 100644 drivers/hid/hid-corsair-mouse.c
>
> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> index 4070b7386e9d..1ad179b70b15 100644
> --- a/drivers/hid/Kconfig
> +++ b/drivers/hid/Kconfig
> @@ -191,6 +191,16 @@ config HID_CORSAIR
> Supported devices:
> - Vengeance K90
>
> +config HID_CORSAIR_MOUSE:

The colon after the symbol name shouldn't be there.

[ ... snip ... ]

> +static const struct hid_device_id corsair_mouse_devices[] = {
> + { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR,
> + USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB) },
> + { }
> +};
> +MODULE_DEVICE_TABLE(hid, corsair_mouse_devices);

You need to add this vendor/product id also into hid_have_special_driver[]
array, otherwise it's not guaranteed that your driver will bind to it (as
the generic one might overrride).

Thanks,

--
Jiri Kosina
SUSE Labs