Commit bbca80b2 authored by Guus Sliepen's avatar Guus Sliepen Committed by Jiri Kosina

HID: corsair: Add support for the GLAIVE RGB gaming mouse

This mouse sold by Corsair as the GLAIVE RGB gaming mouse has the same
problem with its HID reports as the Scimitar PRO RGB, so reuse the
same fix for the GLAIVE RGB.
Signed-off-by: default avatarGuus Sliepen <guus@sliepen.org>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 183b6366
...@@ -673,7 +673,7 @@ static int corsair_input_mapping(struct hid_device *dev, ...@@ -673,7 +673,7 @@ static int corsair_input_mapping(struct hid_device *dev,
} }
/* /*
* The report descriptor of Corsair Scimitar RGB Pro gaming mouse is * The report descriptor of some of the Corsair gaming mice is
* non parseable as they define two consecutive Logical Minimum for * non parseable as they define two consecutive Logical Minimum for
* the Usage Page (Consumer) in rdescs bytes 75 and 77 being 77 0x16 * the Usage Page (Consumer) in rdescs bytes 75 and 77 being 77 0x16
* that should be obviousy 0x26 for Logical Magimum of 16 bits. This * that should be obviousy 0x26 for Logical Magimum of 16 bits. This
...@@ -681,7 +681,8 @@ static int corsair_input_mapping(struct hid_device *dev, ...@@ -681,7 +681,8 @@ static int corsair_input_mapping(struct hid_device *dev,
* Minimum being larger than Logical Maximum. * Minimum being larger than Logical Maximum.
* *
* This driver fixes the report descriptor for: * This driver fixes the report descriptor for:
* - USB ID b1c:1b3e, sold as Scimitar RGB Pro Gaming mouse * - USB ID 1b1c:1b34, sold as GLAIVE RGB Gaming mouse
* - USB ID 1b1c:1b3e, sold as Scimitar RGB Pro Gaming mouse
*/ */
static __u8 *corsair_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, static __u8 *corsair_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc,
...@@ -691,13 +692,14 @@ static __u8 *corsair_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, ...@@ -691,13 +692,14 @@ static __u8 *corsair_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc,
if (intf->cur_altsetting->desc.bInterfaceNumber == 1) { if (intf->cur_altsetting->desc.bInterfaceNumber == 1) {
/* /*
* Corsair Scimitar RGB Pro report descriptor is broken and * Corsair GLAIVE RGB and Scimitar RGB Pro report descriptor is
* defines two different Logical Minimum for the Consumer * broken and defines two different Logical Minimum for the
* Application. The byte 77 should be a 0x26 defining a 16 * Consumer Application. The byte 77 should be a 0x26 defining
* bits integer for the Logical Maximum but it is a 0x16 * a 16 bits integer for the Logical Maximum but it is a 0x16
* instead (Logical Minimum) * instead (Logical Minimum)
*/ */
switch (hdev->product) { switch (hdev->product) {
case USB_DEVICE_ID_CORSAIR_GLAIVE_RGB:
case USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB: case USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB:
if (*rsize >= 172 && rdesc[75] == 0x15 && rdesc[77] == 0x16 if (*rsize >= 172 && rdesc[75] == 0x15 && rdesc[77] == 0x16
&& rdesc[78] == 0xff && rdesc[79] == 0x0f) { && rdesc[78] == 0xff && rdesc[79] == 0x0f) {
...@@ -715,6 +717,8 @@ static const struct hid_device_id corsair_devices[] = { ...@@ -715,6 +717,8 @@ static const struct hid_device_id corsair_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K90), { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K90),
.driver_data = CORSAIR_USE_K90_MACRO | .driver_data = CORSAIR_USE_K90_MACRO |
CORSAIR_USE_K90_BACKLIGHT }, CORSAIR_USE_K90_BACKLIGHT },
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR,
USB_DEVICE_ID_CORSAIR_GLAIVE_RGB) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR,
USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB) }, USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB) },
{} {}
......
...@@ -291,6 +291,7 @@ ...@@ -291,6 +291,7 @@
#define USB_DEVICE_ID_CORSAIR_K70RGB 0x1b13 #define USB_DEVICE_ID_CORSAIR_K70RGB 0x1b13
#define USB_DEVICE_ID_CORSAIR_STRAFE 0x1b15 #define USB_DEVICE_ID_CORSAIR_STRAFE 0x1b15
#define USB_DEVICE_ID_CORSAIR_K65RGB 0x1b17 #define USB_DEVICE_ID_CORSAIR_K65RGB 0x1b17
#define USB_DEVICE_ID_CORSAIR_GLAIVE_RGB 0x1b34
#define USB_DEVICE_ID_CORSAIR_K70RGB_RAPIDFIRE 0x1b38 #define USB_DEVICE_ID_CORSAIR_K70RGB_RAPIDFIRE 0x1b38
#define USB_DEVICE_ID_CORSAIR_K65RGB_RAPIDFIRE 0x1b39 #define USB_DEVICE_ID_CORSAIR_K65RGB_RAPIDFIRE 0x1b39
#define USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB 0x1b3e #define USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB 0x1b3e
......
...@@ -62,6 +62,7 @@ static const struct hid_device_id hid_quirks[] = { ...@@ -62,6 +62,7 @@ static const struct hid_device_id hid_quirks[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K70R), HID_QUIRK_NO_INIT_REPORTS }, { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K70R), HID_QUIRK_NO_INIT_REPORTS },
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K95RGB), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K95RGB), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL },
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_M65RGB), HID_QUIRK_NO_INIT_REPORTS }, { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_M65RGB), HID_QUIRK_NO_INIT_REPORTS },
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_GLAIVE_RGB), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL },
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL },
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_STRAFE), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL }, { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_STRAFE), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL },
{ HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVE_SB_OMNI_SURROUND_51), HID_QUIRK_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVE_SB_OMNI_SURROUND_51), HID_QUIRK_NOGET },
...@@ -317,6 +318,7 @@ static const struct hid_device_id hid_have_special_driver[] = { ...@@ -317,6 +318,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
#endif #endif
#if IS_ENABLED(CONFIG_HID_CORSAIR) #if IS_ENABLED(CONFIG_HID_CORSAIR)
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K90) }, { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K90) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_GLAIVE_RGB) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB) }, { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB) },
#endif #endif
#if IS_ENABLED(CONFIG_HID_CP2112) #if IS_ENABLED(CONFIG_HID_CP2112)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment