forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
…/git/hid/hid Pull HID updates from Jiri Kosina: - Logitech HID++ protocol support improvement from Filipe Laíns - probe fix for Logitech-G* devices from Hans de Goede - a few other small code cleanups and support for new device IDs * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: rmi: Simplify an error handling path in 'rmi_hid_read_block()' HID: intel-ish-hid: hbm.h: Replace zero-length array with flexible-array member HID: intel-ish-hid: ishtp-dev.h: Replace zero-length array with flexible-array member HID: Add driver fixing Glorious PC Gaming Race mouse report descriptor HID: lg-g15: Do not fail the probe when we fail to disable F# emulation HID: appleir: Use devm_kzalloc() instead of kzalloc() HID: appleir: Remove unnecessary goto label HID: logitech-dj: add support for the static device in the Powerplay mat/receiver HID: mcp2221: add usb to i2c-smbus host bridge HID: logitech-dj: add debug msg when exporting a HID++ report descriptors HID: quirks: Remove ITE 8595 entry from hid_have_special_driver
- Loading branch information
Showing
13 changed files
with
878 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10295,6 +10295,13 @@ F: drivers/net/can/m_can/m_can.c | |
F: drivers/net/can/m_can/m_can.h | ||
F: drivers/net/can/m_can/m_can_platform.c | ||
|
||
MCP2221A MICROCHIP USB-HID TO I2C BRIDGE DRIVER | ||
M: Rishi Gupta <[email protected]> | ||
L: [email protected] | ||
L: [email protected] | ||
S: Maintained | ||
F: drivers/hid/hid-mcp2221.c | ||
|
||
MCP4018 AND MCP4531 MICROCHIP DIGITAL POTENTIOMETER DRIVERS | ||
M: Peter Rosin <[email protected]> | ||
L: [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
/* | ||
* USB HID driver for Glorious PC Gaming Race | ||
* Glorious Model O, O- and D mice. | ||
* | ||
* Copyright (c) 2020 Samuel Čavoj <[email protected]> | ||
*/ | ||
|
||
/* | ||
*/ | ||
|
||
#include <linux/hid.h> | ||
#include <linux/module.h> | ||
|
||
#include "hid-ids.h" | ||
|
||
MODULE_AUTHOR("Samuel Čavoj <[email protected]>"); | ||
MODULE_DESCRIPTION("HID driver for Glorious PC Gaming Race mice"); | ||
|
||
/* | ||
* Glorious Model O and O- specify the const flag in the consumer input | ||
* report descriptor, which leads to inputs being ignored. Fix this | ||
* by patching the descriptor. | ||
*/ | ||
static __u8 *glorious_report_fixup(struct hid_device *hdev, __u8 *rdesc, | ||
unsigned int *rsize) | ||
{ | ||
if (*rsize == 213 && | ||
rdesc[84] == 129 && rdesc[112] == 129 && rdesc[140] == 129 && | ||
rdesc[85] == 3 && rdesc[113] == 3 && rdesc[141] == 3) { | ||
hid_info(hdev, "patching Glorious Model O consumer control report descriptor\n"); | ||
rdesc[85] = rdesc[113] = rdesc[141] = \ | ||
HID_MAIN_ITEM_VARIABLE | HID_MAIN_ITEM_RELATIVE; | ||
} | ||
return rdesc; | ||
} | ||
|
||
static void glorious_update_name(struct hid_device *hdev) | ||
{ | ||
const char *model = "Device"; | ||
|
||
switch (hdev->product) { | ||
case USB_DEVICE_ID_GLORIOUS_MODEL_O: | ||
model = "Model O"; break; | ||
case USB_DEVICE_ID_GLORIOUS_MODEL_D: | ||
model = "Model D"; break; | ||
} | ||
|
||
snprintf(hdev->name, sizeof(hdev->name), "%s %s", "Glorious", model); | ||
} | ||
|
||
static int glorious_probe(struct hid_device *hdev, | ||
const struct hid_device_id *id) | ||
{ | ||
int ret; | ||
|
||
hdev->quirks |= HID_QUIRK_INPUT_PER_APP; | ||
|
||
ret = hid_parse(hdev); | ||
if (ret) | ||
return ret; | ||
|
||
glorious_update_name(hdev); | ||
|
||
return hid_hw_start(hdev, HID_CONNECT_DEFAULT); | ||
} | ||
|
||
static const struct hid_device_id glorious_devices[] = { | ||
{ HID_USB_DEVICE(USB_VENDOR_ID_GLORIOUS, | ||
USB_DEVICE_ID_GLORIOUS_MODEL_O) }, | ||
{ HID_USB_DEVICE(USB_VENDOR_ID_GLORIOUS, | ||
USB_DEVICE_ID_GLORIOUS_MODEL_D) }, | ||
{ } | ||
}; | ||
MODULE_DEVICE_TABLE(hid, glorious_devices); | ||
|
||
static struct hid_driver glorious_driver = { | ||
.name = "glorious", | ||
.id_table = glorious_devices, | ||
.probe = glorious_probe, | ||
.report_fixup = glorious_report_fixup | ||
}; | ||
|
||
module_hid_driver(glorious_driver); | ||
|
||
MODULE_LICENSE("GPL"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.