Commit c101e9bb authored by Linus Torvalds's avatar Linus Torvalds

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
parents 69c1fd97 4f8a21a6
......@@ -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 <gupt21@gmail.com>
L: linux-i2c@vger.kernel.org
L: linux-input@vger.kernel.org
S: Maintained
F: drivers/hid/hid-mcp2221.c
MCP4018 AND MCP4531 MICROCHIP DIGITAL POTENTIOMETER DRIVERS
M: Peter Rosin <peda@axentia.se>
L: linux-iio@vger.kernel.org
......
......@@ -362,6 +362,13 @@ config HID_GFRM
---help---
Support for Google Fiber TV Box remote controls
config HID_GLORIOUS
tristate "Glorious PC Gaming Race mice"
depends on HID
help
Support for Glorious PC Gaming Race mice such as
the Glorious Model O, O- and D.
config HID_HOLTEK
tristate "Holtek HID devices"
depends on USB_HID
......@@ -1145,6 +1152,16 @@ config HID_ALPS
Say Y here if you have a Alps touchpads over i2c-hid or usbhid
and want support for its special functionalities.
config HID_MCP2221
tristate "Microchip MCP2221 HID USB-to-I2C/SMbus host support"
depends on USB_HID && I2C
---help---
Provides I2C and SMBUS host adapter functionality over USB-HID
through MCP2221 device.
To compile this driver as a module, choose M here: the module
will be called hid-mcp2221.ko.
endmenu
endif # HID
......
......@@ -48,6 +48,7 @@ obj-$(CONFIG_HID_ELO) += hid-elo.o
obj-$(CONFIG_HID_EZKEY) += hid-ezkey.o
obj-$(CONFIG_HID_GEMBIRD) += hid-gembird.o
obj-$(CONFIG_HID_GFRM) += hid-gfrm.o
obj-$(CONFIG_HID_GLORIOUS) += hid-glorious.o
obj-$(CONFIG_HID_GOOGLE_HAMMER) += hid-google-hammer.o
obj-$(CONFIG_HID_GT683R) += hid-gt683r.o
obj-$(CONFIG_HID_GYRATION) += hid-gyration.o
......@@ -70,6 +71,7 @@ obj-$(CONFIG_HID_LOGITECH_HIDPP) += hid-logitech-hidpp.o
obj-$(CONFIG_HID_MACALLY) += hid-macally.o
obj-$(CONFIG_HID_MAGICMOUSE) += hid-magicmouse.o
obj-$(CONFIG_HID_MALTRON) += hid-maltron.o
obj-$(CONFIG_HID_MCP2221) += hid-mcp2221.o
obj-$(CONFIG_HID_MAYFLASH) += hid-mf.o
obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o
obj-$(CONFIG_HID_MONTEREY) += hid-monterey.o
......
......@@ -283,11 +283,9 @@ static int appleir_probe(struct hid_device *hid, const struct hid_device_id *id)
int ret;
struct appleir *appleir;
appleir = kzalloc(sizeof(struct appleir), GFP_KERNEL);
if (!appleir) {
ret = -ENOMEM;
goto allocfail;
}
appleir = devm_kzalloc(&hid->dev, sizeof(struct appleir), GFP_KERNEL);
if (!appleir)
return -ENOMEM;
appleir->hid = hid;
......@@ -313,8 +311,7 @@ static int appleir_probe(struct hid_device *hid, const struct hid_device_id *id)
return 0;
fail:
kfree(appleir);
allocfail:
devm_kfree(&hid->dev, appleir);
return ret;
}
......@@ -323,7 +320,6 @@ static void appleir_remove(struct hid_device *hid)
struct appleir *appleir = hid_get_drvdata(hid);
hid_hw_stop(hid);
del_timer_sync(&appleir->key_up_timer);
kfree(appleir);
}
static const struct hid_device_id appleir_devices[] = {
......
// 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 <sammko@sammserver.com>
*/
/*
*/
#include <linux/hid.h>
#include <linux/module.h>
#include "hid-ids.h"
MODULE_AUTHOR("Samuel Čavoj <sammko@sammserver.com>");
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");
......@@ -464,6 +464,10 @@
#define USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_010A 0x010a
#define USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_E100 0xe100
#define USB_VENDOR_ID_GLORIOUS 0x258a
#define USB_DEVICE_ID_GLORIOUS_MODEL_D 0x0033
#define USB_DEVICE_ID_GLORIOUS_MODEL_O 0x0036
#define I2C_VENDOR_ID_GOODIX 0x27c6
#define I2C_DEVICE_ID_GOODIX_01F0 0x01f0
......@@ -821,6 +825,7 @@
#define USB_DEVICE_ID_PICK16F1454 0x0042
#define USB_DEVICE_ID_PICK16F1454_V2 0xf2f7
#define USB_DEVICE_ID_LUXAFOR 0xf372
#define USB_DEVICE_ID_MCP2221 0x00dd
#define USB_VENDOR_ID_MICROSOFT 0x045e
#define USB_DEVICE_ID_SIDEWINDER_GV 0x003b
......
......@@ -803,8 +803,10 @@ static int lg_g15_probe(struct hid_device *hdev, const struct hid_device_id *id)
}
if (ret < 0) {
hid_err(hdev, "Error disabling keyboard emulation for the G-keys\n");
goto error_hw_stop;
hid_err(hdev, "Error %d disabling keyboard emulation for the G-keys, falling back to generic hid-input driver\n",
ret);
hid_set_drvdata(hdev, NULL);
return 0;
}
/* Get initial brightness levels */
......
......@@ -16,11 +16,11 @@
#include <asm/unaligned.h>
#include "hid-ids.h"
#define DJ_MAX_PAIRED_DEVICES 6
#define DJ_MAX_PAIRED_DEVICES 7
#define DJ_MAX_NUMBER_NOTIFS 8
#define DJ_RECEIVER_INDEX 0
#define DJ_DEVICE_INDEX_MIN 1
#define DJ_DEVICE_INDEX_MAX 6
#define DJ_DEVICE_INDEX_MAX 7
#define DJREPORT_SHORT_LENGTH 15
#define DJREPORT_LONG_LENGTH 32
......@@ -980,6 +980,11 @@ static void logi_hidpp_recv_queue_notif(struct hid_device *hdev,
break;
}
/* custom receiver device (eg. powerplay) */
if (hidpp_report->device_index == 7) {
workitem.reports_supported |= HIDPP;
}
if (workitem.type == WORKITEM_TYPE_EMPTY) {
hid_warn(hdev,
"unusable device of type %s (0x%02x) connected on slot %d",
......@@ -1368,6 +1373,8 @@ static int logi_dj_ll_parse(struct hid_device *hid)
}
if (djdev->reports_supported & HIDPP) {
dbg_hid("%s: sending a HID++ descriptor, reports_supported: %llx\n",
__func__, djdev->reports_supported);
rdcat(rdesc, &rsize, hidpp_descriptor,
sizeof(hidpp_descriptor));
}
......
This diff is collapsed.
......@@ -398,9 +398,6 @@ 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) },
#endif
#if IS_ENABLED(CONFIG_HID_ITE)
{ HID_USB_DEVICE(USB_VENDOR_ID_ITE, USB_DEVICE_ID_ITE8595) },
#endif
#if IS_ENABLED(CONFIG_HID_ICADE)
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) },
#endif
......
......@@ -217,7 +217,6 @@ static int rmi_hid_read_block(struct rmi_transport_dev *xport, u16 addr,
ret = rmi_write_report(hdev, data->writeReport,
data->output_report_size);
if (ret != data->output_report_size) {
clear_bit(RMI_READ_REQUEST_PENDING, &data->flags);
dev_err(&hdev->dev,
"failed to write request output report (%d)\n",
ret);
......
......@@ -82,7 +82,7 @@ struct ishtp_msg_hdr {
struct ishtp_bus_message {
uint8_t hbm_cmd;
uint8_t data[0];
uint8_t data[];
} __packed;
/**
......
......@@ -214,7 +214,7 @@ struct ishtp_device {
const struct ishtp_hw_ops *ops;
size_t mtu;
uint32_t ishtp_msg_hdr;
char hw[0] __aligned(sizeof(void *));
char hw[] __aligned(sizeof(void *));
};
static inline unsigned long ishtp_secs_to_jiffies(unsigned long sec)
......
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