Commit ce19275f authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'for-linus-2022120801' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid

Pull HID fixes from Jiri Kosina:
 "A regression fix for handling Logitech HID++ devices and memory
  corruption fixes:

   - regression fix (revert) for catch-all handling of Logitech HID++
     Bluetooth devices; there are devices that turn out not to work with
     this, and the root cause is yet to be properly understood. So we
     are dropping it for now, and it will be revisited for 6.2 or 6.3
     (Benjamin Tissoires)

   - memory corruption fix in HID core (ZhangPeng)

   - memory corruption fix in hid-lg4ff (Anastasia Belova)

   - Kconfig fix for I2C_HID (Benjamin Tissoires)

   - a few device-id specific quirks that piggy-back on top of the
     important fixes above"

* tag 'for-linus-2022120801' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
  Revert "HID: logitech-hidpp: Enable HID++ for all the Logitech Bluetooth devices"
  Revert "HID: logitech-hidpp: Remove special-casing of Bluetooth devices"
  HID: usbhid: Add ALWAYS_POLL quirk for some mice
  HID: core: fix shift-out-of-bounds in hid_report_raw_event
  HID: uclogic: Add HID_QUIRK_HIDINPUT_FORCE quirk
  HID: fix I2C_HID not selected when I2C_HID_OF_ELAN is
  HID: hid-lg4ff: Add check for empty lbuf
  HID: ite: Enable QUIRK_TOUCHPAD_ON_OFF_REPORT on Acer Aspire Switch V 10
  HID: uclogic: Fix frame templates for big endian architectures
parents f3e84166 a9d9e46c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1315,6 +1315,9 @@ static s32 snto32(__u32 value, unsigned n)
	if (!value || !n)
		return 0;

	if (n > 32)
		n = 32;

	switch (n) {
	case 8:  return ((__s8)value);
	case 16: return ((__s16)value);
+4 −0
Original line number Diff line number Diff line
@@ -274,6 +274,7 @@
#define USB_DEVICE_ID_CH_AXIS_295	0x001c

#define USB_VENDOR_ID_CHERRY		0x046a
#define USB_DEVICE_ID_CHERRY_MOUSE_000C	0x000c
#define USB_DEVICE_ID_CHERRY_CYMOTION	0x0023
#define USB_DEVICE_ID_CHERRY_CYMOTION_SOLAR	0x0027

@@ -917,6 +918,7 @@
#define USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER	0x02fd
#define USB_DEVICE_ID_MS_PIXART_MOUSE    0x00cb
#define USB_DEVICE_ID_8BITDO_SN30_PRO_PLUS      0x02e0
#define USB_DEVICE_ID_MS_MOUSE_0783      0x0783

#define USB_VENDOR_ID_MOJO		0x8282
#define USB_DEVICE_ID_RETRO_ADAPTER	0x3201
@@ -1215,6 +1217,7 @@
#define USB_DEVICE_ID_SYNAPTICS_DELL_K15A	0x6e21
#define USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1002	0x73f4
#define USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1003	0x73f5
#define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_017	0x73f6
#define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5	0x81a7

#define USB_VENDOR_ID_TEXAS_INSTRUMENTS	0x2047
@@ -1381,6 +1384,7 @@

#define USB_VENDOR_ID_PRIMAX	0x0461
#define USB_DEVICE_ID_PRIMAX_MOUSE_4D22	0x4d22
#define USB_DEVICE_ID_PRIMAX_MOUSE_4E2A	0x4e2a
#define USB_DEVICE_ID_PRIMAX_KEYBOARD	0x4e05
#define USB_DEVICE_ID_PRIMAX_REZEL	0x4e72
#define USB_DEVICE_ID_PRIMAX_PIXART_MOUSE_4D0F	0x4d0f
+5 −0
Original line number Diff line number Diff line
@@ -121,6 +121,11 @@ static const struct hid_device_id ite_devices[] = {
		     USB_VENDOR_ID_SYNAPTICS,
		     USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1003),
	  .driver_data = QUIRK_TOUCHPAD_ON_OFF_REPORT },
	/* ITE8910 USB kbd ctlr, with Synaptics touchpad connected to it. */
	{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
		     USB_VENDOR_ID_SYNAPTICS,
		     USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_017),
	  .driver_data = QUIRK_TOUCHPAD_ON_OFF_REPORT },
	{ }
};
MODULE_DEVICE_TABLE(hid, ite_devices);
+6 −0
Original line number Diff line number Diff line
@@ -872,6 +872,12 @@ static ssize_t lg4ff_alternate_modes_store(struct device *dev, struct device_att
		return -ENOMEM;

	i = strlen(lbuf);

	if (i == 0) {
		kfree(lbuf);
		return -EINVAL;
	}

	if (lbuf[i-1] == '\n') {
		if (i == 1) {
			kfree(lbuf);
+9 −19
Original line number Diff line number Diff line
@@ -4269,21 +4269,6 @@ static void hidpp_remove(struct hid_device *hdev)
	mutex_destroy(&hidpp->send_mutex);
}

static const struct hid_device_id unhandled_hidpp_devices[] = {
	/* Logitech Harmony Adapter for PS3, handled in hid-sony */
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_PS3) },
	/* Handled in hid-generic */
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_DINOVO_EDGE_KBD) },
	{}
};

static bool hidpp_match(struct hid_device *hdev,
			bool ignore_special_driver)
{
	/* Refuse to handle devices handled by other HID drivers */
	return !hid_match_id(hdev, unhandled_hidpp_devices);
}

#define LDJ_DEVICE(product) \
	HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE, \
		   USB_VENDOR_ID_LOGITECH, (product))
@@ -4367,9 +4352,15 @@ static const struct hid_device_id hidpp_devices[] = {
	{ /* MX5500 keyboard over Bluetooth */
	  HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb30b),
	  .driver_data = HIDPP_QUIRK_HIDPP_CONSUMER_VENDOR_KEYS },

	{ /* And try to enable HID++ for all the Logitech Bluetooth devices */
	  HID_DEVICE(BUS_BLUETOOTH, HID_GROUP_ANY, USB_VENDOR_ID_LOGITECH, HID_ANY_ID) },
	{ /* M-RCQ142 V470 Cordless Laser Mouse over Bluetooth */
	  HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb008) },
	{ /* MX Master mouse over Bluetooth */
	  HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb012) },
	{ /* MX Ergo trackball over Bluetooth */
	  HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb01d) },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb01e) },
	{ /* MX Master 3 mouse over Bluetooth */
	  HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb023) },
	{}
};

@@ -4383,7 +4374,6 @@ static const struct hid_usage_id hidpp_usages[] = {
static struct hid_driver hidpp_driver = {
	.name = "logitech-hidpp-device",
	.id_table = hidpp_devices,
	.match = hidpp_match,
	.report_fixup = hidpp_report_fixup,
	.probe = hidpp_probe,
	.remove = hidpp_remove,
Loading