Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c867ac3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull HID fixes from Jiri Kosina:

 - regression fixes for Wacom devices, from Aaron Armstrong Skomra and
   Ping Cheng

 - memory leak in hid-sony driver from Roderick Colenbrander

 - new device IDs support from Oscar Campos and Daniel Drake

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: wacom: generic: Wacom mouse is only provided for opaque tablets
  HID: corsair: Add driver Scimitar Pro RGB gaming mouse 1b1c:1b3e support to hid-corsair
  HID: corsair: support for K65-K70 Rapidfire and Scimitar Pro RGB
  HID: wacom: don't manually release resources for the EKR
  HID: wacom: Correct Intuos Pro 2 resolution
  HID: sony: Fix input device leak when connecting a DS4 twice using USB/BT
  HID: chicony: Add support for another ASUS Zen AiO keyboard
parents 47191777 6e5364f5
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -175,11 +175,11 @@ config HID_CHERRY
	Support for Cherry Cymotion keyboard.

config HID_CHICONY
	tristate "Chicony Tactical pad"
	tristate "Chicony devices"
	depends on HID
	default !EXPERT
	---help---
	Support for Chicony Tactical pad.
	Support for Chicony Tactical pad and special keys on Chicony keyboards.

config HID_CORSAIR
	tristate "Corsair devices"
@@ -190,6 +190,7 @@ config HID_CORSAIR

	Supported devices:
	- Vengeance K90
	- Scimitar PRO RGB

config HID_PRODIKEYS
	tristate "Prodikeys PC-MIDI Keyboard support"
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ static const struct hid_device_id ch_devices[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS2) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_AK1D) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_ACER_SWITCH12) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_JESS, USB_DEVICE_ID_JESS_ZEN_AIO_KBD) },
	{ }
};
MODULE_DEVICE_TABLE(hid, ch_devices);
+2 −0
Original line number Diff line number Diff line
@@ -1870,6 +1870,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_AK1D) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_ACER_SWITCH12) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K90) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_PRODIKEYS_PCMIDI) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_CP2112) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1) },
@@ -1910,6 +1911,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
	{ 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) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_TABLET) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_JESS, USB_DEVICE_ID_JESS_ZEN_AIO_KBD) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
+47 −0
Original line number Diff line number Diff line
@@ -3,8 +3,10 @@
 *
 * Supported devices:
 *  - Vengeance K90 Keyboard
 *  - Scimitar PRO RGB Gaming Mouse
 *
 * Copyright (c) 2015 Clement Vuchener
 * Copyright (c) 2017 Oscar Campos
 */

/*
@@ -670,10 +672,51 @@ static int corsair_input_mapping(struct hid_device *dev,
	return 0;
}

/*
 * The report descriptor of Corsair Scimitar RGB Pro gaming mouse is
 * non parseable as they define two consecutive Logical Minimum for
 * 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
 * prevents poper parsing of the report descriptor due Logical
 * Minimum being larger than Logical Maximum.
 *
 * This driver fixes the report descriptor for:
 * - USB ID b1c:1b3e, sold as Scimitar RGB Pro Gaming mouse
 */

static __u8 *corsair_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc,
        unsigned int *rsize)
{
	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);

	if (intf->cur_altsetting->desc.bInterfaceNumber == 1) {
		/*
		 * Corsair Scimitar RGB Pro report descriptor is broken and
		 * defines two different Logical Minimum for the Consumer
		 * Application. The byte 77 should be a 0x26 defining a 16
		 * bits integer for the Logical Maximum but it is a 0x16
		 * instead (Logical Minimum)
		 */
		switch (hdev->product) {
		case USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB:
			if (*rsize >= 172 && rdesc[75] == 0x15 && rdesc[77] == 0x16
			&& rdesc[78] == 0xff && rdesc[79] == 0x0f) {
				hid_info(hdev, "Fixing up report descriptor\n");
				rdesc[77] = 0x26;
			}
			break;
		}

	}
	return rdesc;
}

static const struct hid_device_id corsair_devices[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K90),
		.driver_data = CORSAIR_USE_K90_MACRO |
			       CORSAIR_USE_K90_BACKLIGHT },
	{ HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR,
            USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB) },
	{}
};

@@ -686,10 +729,14 @@ static struct hid_driver corsair_driver = {
	.event = corsair_event,
	.remove = corsair_remove,
	.input_mapping = corsair_input_mapping,
	.report_fixup = corsair_mouse_report_fixup,
};

module_hid_driver(corsair_driver);

MODULE_LICENSE("GPL");
/* Original K90 driver author */
MODULE_AUTHOR("Clement Vuchener");
/* Scimitar PRO RGB driver author */
MODULE_AUTHOR("Oscar Campos");
MODULE_DESCRIPTION("HID driver for Corsair devices");
+4 −0
Original line number Diff line number Diff line
@@ -278,6 +278,9 @@
#define USB_DEVICE_ID_CORSAIR_K70RGB    0x1b13
#define USB_DEVICE_ID_CORSAIR_STRAFE    0x1b15
#define USB_DEVICE_ID_CORSAIR_K65RGB    0x1b17
#define USB_DEVICE_ID_CORSAIR_K70RGB_RAPIDFIRE  0x1b38
#define USB_DEVICE_ID_CORSAIR_K65RGB_RAPIDFIRE  0x1b39
#define USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB  0x1b3e

#define USB_VENDOR_ID_CREATIVELABS	0x041e
#define USB_DEVICE_ID_CREATIVE_SB_OMNI_SURROUND_51	0x322c
@@ -557,6 +560,7 @@

#define USB_VENDOR_ID_JESS		0x0c45
#define USB_DEVICE_ID_JESS_YUREX	0x1010
#define USB_DEVICE_ID_JESS_ZEN_AIO_KBD	0x5112

#define USB_VENDOR_ID_JESS2		0x0f30
#define USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD 0x0111
Loading