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

Commit c2848f2e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull HID updates from Jiri Kosina:

 - appoint Benjamin Tissoires as co-maintainer / designated reviewer

 - sysfs report_descriptor visibility fix for unclaimed devices, from
   Andy Lutomirski

 - suspend/resume fixes for Sony driver from Frank Praznik

 - IRQ deadlock fix from Ioan-Adrian Ratiu

 - hid-i2c fixes affecting (at least) Yoga 900 from Mika Westerberg and
   Srinivas Pandruvada

 - a lot of new device support (especially, but not limited to, Wacom)
   and assorted small misc fixes

 - almost complete G920 support; the only bit that is missing is
   switching the device to HID mode automatically; Simon Wood and Michal
   Maly are working on it.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (46 commits)
  Revert "INPUT: xpad: switch Logitech G920 Wheel into HID mode"
  HID: sensor-hub: Add quirk for Lenovo Yoga 900 with ITE Chips
  HID: Add new PID for Microchip Pick16F1454
  HID: wacom: Use correct report to query pen ID from INTUOSHT2 devices
  HID: i2c-hid: Prevent sending reports from racing with device reset
  HID: use kobj_to_dev()
  HID: wiimote: use dev_to_wii()
  HID: add a new helper to_hid_driver()
  HID: use to_hid_device()
  HID: move to_hid_device() to hid.h
  HID: usbhid: use to_usb_device
  HID: corsair: Convert to use module_hid_driver
  HID: input: ignore the battery in OKLICK Laser BTmouse
  HID: wacom: Fix pad button range for CINTIQ_COMPANION_2
  HID: wacom: Fix touchring value reporting
  HID: wacom: Report 'strip2' values in ABS_RY
  HID: wacom: Limit touchstrip data to 13 bits
  HID: wacom: bitwise vs logical ORs
  HID: wacom: Apply lowres quirk to BAMBOO_TOUCH devices
  HID: enable hid device to suspend/resume asynchronously
  ...
parents 75f26df6 83f1bfd6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -4984,6 +4984,7 @@ F: arch/*/include/asm/suspend*.h

HID CORE LAYER
M:	Jiri Kosina <jikos@kernel.org>
R:	Benjamin Tissoires <benjamin.tissoires@redhat.com>
L:	linux-input@vger.kernel.org
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git
S:	Maintained
@@ -11162,6 +11163,7 @@ F: include/linux/usb/gadget*

USB HID/HIDBP DRIVERS (USB KEYBOARDS, MICE, REMOTE CONTROLS, ...)
M:	Jiri Kosina <jikos@kernel.org>
R:	Benjamin Tissoires <benjamin.tissoires@redhat.com>
L:	linux-usb@vger.kernel.org
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git
S:	Maintained
+25 −24
Original line number Diff line number Diff line
@@ -625,7 +625,7 @@ static void hid_close_report(struct hid_device *device)

static void hid_device_release(struct device *dev)
{
	struct hid_device *hid = container_of(dev, struct hid_device, dev);
	struct hid_device *hid = to_hid_device(dev);

	hid_close_report(hid);
	kfree(hid->dev_rdesc);
@@ -1571,8 +1571,8 @@ read_report_descriptor(struct file *filp, struct kobject *kobj,
		struct bin_attribute *attr,
		char *buf, loff_t off, size_t count)
{
	struct device *dev = container_of(kobj, struct device, kobj);
	struct hid_device *hdev = container_of(dev, struct hid_device, dev);
	struct device *dev = kobj_to_dev(kobj);
	struct hid_device *hdev = to_hid_device(dev);

	if (off >= hdev->rsize)
		return 0;
@@ -1589,7 +1589,7 @@ static ssize_t
show_country(struct device *dev, struct device_attribute *attr,
		char *buf)
{
	struct hid_device *hdev = container_of(dev, struct hid_device, dev);
	struct hid_device *hdev = to_hid_device(dev);

	return sprintf(buf, "%02x\n", hdev->country & 0xff);
}
@@ -1691,11 +1691,6 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask)
		hid_warn(hdev,
			 "can't create sysfs country code attribute err: %d\n", ret);

	ret = device_create_bin_file(&hdev->dev, &dev_bin_attr_report_desc);
	if (ret)
		hid_warn(hdev,
			 "can't create sysfs report descriptor attribute err: %d\n", ret);

	hid_info(hdev, "%s: %s HID v%x.%02x %s [%s] on %s\n",
		 buf, bus, hdev->version >> 8, hdev->version & 0xff,
		 type, hdev->name, hdev->phys);
@@ -1707,7 +1702,6 @@ EXPORT_SYMBOL_GPL(hid_connect);
void hid_disconnect(struct hid_device *hdev)
{
	device_remove_file(&hdev->dev, &dev_attr_country);
	device_remove_bin_file(&hdev->dev, &dev_bin_attr_report_desc);
	if (hdev->claimed & HID_CLAIMED_INPUT)
		hidinput_disconnect(hdev);
	if (hdev->claimed & HID_CLAIMED_HIDDEV)
@@ -1902,6 +1896,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2_2) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G29_WHEEL) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G920_WHEEL) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WINGMAN_F3D) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WINGMAN_FFG ) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_FORCE3D_PRO) },
@@ -2076,7 +2071,7 @@ struct hid_dynid {
static ssize_t store_new_id(struct device_driver *drv, const char *buf,
		size_t count)
{
	struct hid_driver *hdrv = container_of(drv, struct hid_driver, driver);
	struct hid_driver *hdrv = to_hid_driver(drv);
	struct hid_dynid *dynid;
	__u32 bus, vendor, product;
	unsigned long driver_data = 0;
@@ -2138,17 +2133,16 @@ static const struct hid_device_id *hid_match_device(struct hid_device *hdev,

static int hid_bus_match(struct device *dev, struct device_driver *drv)
{
	struct hid_driver *hdrv = container_of(drv, struct hid_driver, driver);
	struct hid_device *hdev = container_of(dev, struct hid_device, dev);
	struct hid_driver *hdrv = to_hid_driver(drv);
	struct hid_device *hdev = to_hid_device(dev);

	return hid_match_device(hdev, hdrv) != NULL;
}

static int hid_device_probe(struct device *dev)
{
	struct hid_driver *hdrv = container_of(dev->driver,
			struct hid_driver, driver);
	struct hid_device *hdev = container_of(dev, struct hid_device, dev);
	struct hid_driver *hdrv = to_hid_driver(dev->driver);
	struct hid_device *hdev = to_hid_device(dev);
	const struct hid_device_id *id;
	int ret = 0;

@@ -2190,7 +2184,7 @@ static int hid_device_probe(struct device *dev)

static int hid_device_remove(struct device *dev)
{
	struct hid_device *hdev = container_of(dev, struct hid_device, dev);
	struct hid_device *hdev = to_hid_device(dev);
	struct hid_driver *hdrv;
	int ret = 0;

@@ -2223,12 +2217,9 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *a,
			     char *buf)
{
	struct hid_device *hdev = container_of(dev, struct hid_device, dev);
	int len;

	len = snprintf(buf, PAGE_SIZE, "hid:b%04Xg%04Xv%08Xp%08X\n",
	return scnprintf(buf, PAGE_SIZE, "hid:b%04Xg%04Xv%08Xp%08X\n",
			 hdev->bus, hdev->group, hdev->vendor, hdev->product);

	return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
}
static DEVICE_ATTR_RO(modalias);

@@ -2236,11 +2227,19 @@ static struct attribute *hid_dev_attrs[] = {
	&dev_attr_modalias.attr,
	NULL,
};
ATTRIBUTE_GROUPS(hid_dev);
static struct bin_attribute *hid_dev_bin_attrs[] = {
	&dev_bin_attr_report_desc,
	NULL
};
static const struct attribute_group hid_dev_group = {
	.attrs = hid_dev_attrs,
	.bin_attrs = hid_dev_bin_attrs,
};
__ATTRIBUTE_GROUPS(hid_dev);

static int hid_uevent(struct device *dev, struct kobj_uevent_env *env)
{
	struct hid_device *hdev = container_of(dev, struct hid_device, dev);
	struct hid_device *hdev = to_hid_device(dev);	

	if (add_uevent_var(env, "HID_ID=%04X:%08X:%08X",
			hdev->bus, hdev->vendor, hdev->product))
@@ -2408,6 +2407,7 @@ static const struct hid_device_id hid_ignore_list[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT1) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT2) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICK16F1454) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICK16F1454_V2) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_NATIONAL_SEMICONDUCTOR, USB_DEVICE_ID_N_S_HARMONY) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 20) },
@@ -2660,6 +2660,7 @@ struct hid_device *hid_allocate_device(void)
	device_initialize(&hdev->dev);
	hdev->dev.release = hid_device_release;
	hdev->dev.bus = &hid_bus_type;
	device_enable_async_suspend(&hdev->dev);

	hid_close_report(hdev);

+1 −12
Original line number Diff line number Diff line
@@ -655,18 +655,7 @@ static struct hid_driver corsair_driver = {
	.input_mapping = corsair_input_mapping,
};

static int __init corsair_init(void)
{
	return hid_register_driver(&corsair_driver);
}

static void corsair_exit(void)
{
	hid_unregister_driver(&corsair_driver);
}

module_init(corsair_init);
module_exit(corsair_exit);
module_hid_driver(corsair_driver);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Clement Vuchener");
+4 −4
Original line number Diff line number Diff line
@@ -807,7 +807,7 @@ static ssize_t name##_store(struct device *kdev, \
			    struct device_attribute *attr, const char *buf, \
			    size_t count) \
{ \
	struct hid_device *hdev = container_of(kdev, struct hid_device, dev); \
	struct hid_device *hdev = to_hid_device(kdev); \
	struct cp2112_usb_config_report cfg; \
	int ret = cp2112_get_usb_config(hdev, &cfg); \
	if (ret) \
@@ -822,7 +822,7 @@ static ssize_t name##_store(struct device *kdev, \
static ssize_t name##_show(struct device *kdev, \
			   struct device_attribute *attr, char *buf) \
{ \
	struct hid_device *hdev = container_of(kdev, struct hid_device, dev); \
	struct hid_device *hdev = to_hid_device(kdev); \
	struct cp2112_usb_config_report cfg; \
	int ret = cp2112_get_usb_config(hdev, &cfg); \
	if (ret) \
@@ -887,7 +887,7 @@ static ssize_t pstr_store(struct device *kdev,
			  struct device_attribute *kattr, const char *buf,
			  size_t count)
{
	struct hid_device *hdev = container_of(kdev, struct hid_device, dev);
	struct hid_device *hdev = to_hid_device(kdev);
	struct cp2112_pstring_attribute *attr =
		container_of(kattr, struct cp2112_pstring_attribute, attr);
	struct cp2112_string_report report;
@@ -918,7 +918,7 @@ static ssize_t pstr_store(struct device *kdev,
static ssize_t pstr_show(struct device *kdev,
			 struct device_attribute *kattr, char *buf)
{
	struct hid_device *hdev = container_of(kdev, struct hid_device, dev);
	struct hid_device *hdev = to_hid_device(kdev);
	struct cp2112_pstring_attribute *attr =
		container_of(kattr, struct cp2112_pstring_attribute, attr);
	struct cp2112_string_report report;
+2 −2
Original line number Diff line number Diff line
@@ -659,13 +659,13 @@ EXPORT_SYMBOL_GPL(hid_dump_device);
/* enqueue string to 'events' ring buffer */
void hid_debug_event(struct hid_device *hdev, char *buf)
{
	int i;
	unsigned i;
	struct hid_debug_list *list;
	unsigned long flags;

	spin_lock_irqsave(&hdev->debug_list_lock, flags);
	list_for_each_entry(list, &hdev->debug_list, node) {
		for (i = 0; i < strlen(buf); i++)
		for (i = 0; buf[i]; i++)
			list->hid_debug_buf[(list->tail + i) % HID_DEBUG_BUFSIZE] =
				buf[i];
		list->tail = (list->tail + i) % HID_DEBUG_BUFSIZE;
Loading