Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Pull HID fixes from Jiri Kosina:
"Bugfixes for HID subsystem that should go in 4.1. Important
highlights:

- the patch that extended support for HID++ protocol for TK820
touchpad turns out to be causing regressions due to firmware
issues; patch reverting back to basic support from Benjamin
Tissoires

- Wacom driver can oops for devices that report non-touch data on
touch interfaces. Fix from Ping Cheng

- gpiolib is not mandatory for i2c-hid, so the driver shouldn't fail
if gpiolib is not enabled. Fix from Mika Westerberg"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
HID: wacom: fix an Oops caused by wacom_wac_finger_count_touches
HID: usbhid: Add HID_QUIRK_NOGET for Aten DVI KVM switch
HID: hid-sensor-hub: Fix debug lock warning
Revert "HID: logitech-hidpp: support combo keyboard touchpad TK820"
HID: i2c-hid: Do not fail probing if gpiolib is not enabled

+21 -26
+1
drivers/hid/hid-ids.h
··· 164 164 #define USB_DEVICE_ID_ATEN_2PORTKVM 0x2204 165 165 #define USB_DEVICE_ID_ATEN_4PORTKVM 0x2205 166 166 #define USB_DEVICE_ID_ATEN_4PORTKVMC 0x2208 167 + #define USB_DEVICE_ID_ATEN_CS682 0x2213 167 168 168 169 #define USB_VENDOR_ID_ATMEL 0x03eb 169 170 #define USB_DEVICE_ID_ATMEL_MULTITOUCH 0x211c
-20
drivers/hid/hid-logitech-hidpp.c
··· 44 44 /* bits 1..20 are reserved for classes */ 45 45 #define HIDPP_QUIRK_DELAYED_INIT BIT(21) 46 46 #define HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS BIT(22) 47 - #define HIDPP_QUIRK_MULTI_INPUT BIT(23) 48 47 49 48 /* 50 49 * There are two hidpp protocols in use, the first version hidpp10 is known ··· 705 706 struct hid_field *field, struct hid_usage *usage, 706 707 unsigned long **bit, int *max) 707 708 { 708 - struct hidpp_device *hidpp = hid_get_drvdata(hdev); 709 - 710 - if ((hidpp->quirks & HIDPP_QUIRK_MULTI_INPUT) && 711 - (field->application == HID_GD_KEYBOARD)) 712 - return 0; 713 - 714 709 return -1; 715 710 } 716 711 ··· 712 719 struct input_dev *input_dev, bool origin_is_hid_core) 713 720 { 714 721 struct wtp_data *wd = hidpp->private_data; 715 - 716 - if ((hidpp->quirks & HIDPP_QUIRK_MULTI_INPUT) && origin_is_hid_core) 717 - /* this is the generic hid-input call */ 718 - return; 719 722 720 723 __set_bit(EV_ABS, input_dev->evbit); 721 724 __set_bit(EV_KEY, input_dev->evbit); ··· 1234 1245 if (hidpp->quirks & HIDPP_QUIRK_DELAYED_INIT) 1235 1246 connect_mask &= ~HID_CONNECT_HIDINPUT; 1236 1247 1237 - /* Re-enable hidinput for multi-input devices */ 1238 - if (hidpp->quirks & HIDPP_QUIRK_MULTI_INPUT) 1239 - connect_mask |= HID_CONNECT_HIDINPUT; 1240 - 1241 1248 ret = hid_hw_start(hdev, connect_mask); 1242 1249 if (ret) { 1243 1250 hid_err(hdev, "%s:hid_hw_start returned error\n", __func__); ··· 1281 1296 HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 1282 1297 USB_DEVICE_ID_LOGITECH_T651), 1283 1298 .driver_data = HIDPP_QUIRK_CLASS_WTP }, 1284 - { /* Keyboard TK820 */ 1285 - HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE, 1286 - USB_VENDOR_ID_LOGITECH, 0x4102), 1287 - .driver_data = HIDPP_QUIRK_DELAYED_INIT | HIDPP_QUIRK_MULTI_INPUT | 1288 - HIDPP_QUIRK_CLASS_WTP }, 1289 1299 1290 1300 { HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE, 1291 1301 USB_VENDOR_ID_LOGITECH, HID_ANY_ID)},
+10 -3
drivers/hid/hid-sensor-hub.c
··· 294 294 if (!report) 295 295 return -EINVAL; 296 296 297 - mutex_lock(&hsdev->mutex); 297 + mutex_lock(hsdev->mutex_ptr); 298 298 if (flag == SENSOR_HUB_SYNC) { 299 299 memset(&hsdev->pending, 0, sizeof(hsdev->pending)); 300 300 init_completion(&hsdev->pending.ready); ··· 328 328 kfree(hsdev->pending.raw_data); 329 329 hsdev->pending.status = false; 330 330 } 331 - mutex_unlock(&hsdev->mutex); 331 + mutex_unlock(hsdev->mutex_ptr); 332 332 333 333 return ret_val; 334 334 } ··· 667 667 hsdev->vendor_id = hdev->vendor; 668 668 hsdev->product_id = hdev->product; 669 669 hsdev->usage = collection->usage; 670 - mutex_init(&hsdev->mutex); 670 + hsdev->mutex_ptr = devm_kzalloc(&hdev->dev, 671 + sizeof(struct mutex), 672 + GFP_KERNEL); 673 + if (!hsdev->mutex_ptr) { 674 + ret = -ENOMEM; 675 + goto err_stop_hw; 676 + } 677 + mutex_init(hsdev->mutex_ptr); 671 678 hsdev->start_collection_index = i; 672 679 if (last_hsdev) 673 680 last_hsdev->end_collection_index = i;
+4 -1
drivers/hid/i2c-hid/i2c-hid.c
··· 862 862 union acpi_object *obj; 863 863 struct acpi_device *adev; 864 864 acpi_handle handle; 865 + int ret; 865 866 866 867 handle = ACPI_HANDLE(&client->dev); 867 868 if (!handle || acpi_bus_get_device(handle, &adev)) ··· 878 877 pdata->hid_descriptor_address = obj->integer.value; 879 878 ACPI_FREE(obj); 880 879 881 - return acpi_dev_add_driver_gpios(adev, i2c_hid_acpi_gpios); 880 + /* GPIOs are optional */ 881 + ret = acpi_dev_add_driver_gpios(adev, i2c_hid_acpi_gpios); 882 + return ret < 0 && ret != -ENXIO ? ret : 0; 882 883 } 883 884 884 885 static const struct acpi_device_id i2c_hid_acpi_match[] = {
+1
drivers/hid/usbhid/hid-quirks.c
··· 61 61 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET }, 62 62 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET }, 63 63 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET }, 64 + { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_CS682, HID_QUIRK_NOGET }, 64 65 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FIGHTERSTICK, HID_QUIRK_NOGET }, 65 66 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_COMBATSTICK, HID_QUIRK_NOGET }, 66 67 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_ECLIPSE_YOKE, HID_QUIRK_NOGET },
+3
drivers/hid/wacom_wac.c
··· 1072 1072 int count = 0; 1073 1073 int i; 1074 1074 1075 + if (!touch_max) 1076 + return 0; 1077 + 1075 1078 /* non-HID_GENERIC single touch input doesn't call this routine */ 1076 1079 if ((touch_max == 1) && (wacom->features.type == HID_GENERIC)) 1077 1080 return wacom->hid_data.tipswitch &&
+2 -2
include/linux/hid-sensor-hub.h
··· 74 74 * @usage: Usage id for this hub device instance. 75 75 * @start_collection_index: Starting index for a phy type collection 76 76 * @end_collection_index: Last index for a phy type collection 77 - * @mutex: synchronizing mutex. 77 + * @mutex_ptr: synchronizing mutex pointer. 78 78 * @pending: Holds information of pending sync read request. 79 79 */ 80 80 struct hid_sensor_hub_device { ··· 84 84 u32 usage; 85 85 int start_collection_index; 86 86 int end_collection_index; 87 - struct mutex mutex; 87 + struct mutex *mutex_ptr; 88 88 struct sensor_hub_pending pending; 89 89 }; 90 90