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

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull HID fixes from Jiri Kosina:

- a few fixes to Sony driver (rmmod breakage, spinlock initialization),
by Antonio Ospite, Frank Praznik and Jiri Kosina

- fix for wMaxInputLength handling regression in i2c-hid, by Seth
Forshee

- IRQ safety spinlock fix in sensor hub driver, by Srinivas Pandruvada

- IRQ level sensitivity fix to i2c-hid to be compliant with the spec,
by Mika Westerberg

- a couple device ID additions piggy-backing on top of that

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
HID: microsoft: Add ID for NE7K wireless keyboard
HID: i2c-hid: Limit reads to wMaxInputLength bytes for input events
HID: sony: fix uninitialized per-controller spinlock
HID: sony: initialize sony_dev_list_lock properly
HID: sony: Fix a WARNING shown when rmmod-ing the driver
HID: sensor-hub: correct dyn_callback_lock IRQ-safe change
HID: hid-sensor-hub: Correct documentation
HID: saitek: add USB ID for older R.A.T. 7
HID: i2c-hid: The interrupt should be level sensitive
HID: wacom: Add missing ABS_MISC event and feature declaration for 27QHD

+35 -10
+2
drivers/hid/hid-core.c
··· 1872 1872 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV) }, 1873 1873 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_NE4K) }, 1874 1874 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_NE4K_JP) }, 1875 + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_NE7K) }, 1875 1876 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_LK6K) }, 1876 1877 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_USB) }, 1877 1878 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K) }, ··· 1927 1926 #endif 1928 1927 #if IS_ENABLED(CONFIG_HID_SAITEK) 1929 1928 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000) }, 1929 + { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RAT7_OLD) }, 1930 1930 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RAT7) }, 1931 1931 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_MMO7) }, 1932 1932 { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_RAT9) },
+2
drivers/hid/hid-ids.h
··· 654 654 #define USB_DEVICE_ID_MS_LK6K 0x00f9 655 655 #define USB_DEVICE_ID_MS_PRESENTER_8K_BT 0x0701 656 656 #define USB_DEVICE_ID_MS_PRESENTER_8K_USB 0x0713 657 + #define USB_DEVICE_ID_MS_NE7K 0x071d 657 658 #define USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K 0x0730 658 659 #define USB_DEVICE_ID_MS_COMFORT_MOUSE_4500 0x076c 659 660 #define USB_DEVICE_ID_MS_SURFACE_PRO_2 0x0799 ··· 803 802 #define USB_VENDOR_ID_SAITEK 0x06a3 804 803 #define USB_DEVICE_ID_SAITEK_RUMBLEPAD 0xff17 805 804 #define USB_DEVICE_ID_SAITEK_PS1000 0x0621 805 + #define USB_DEVICE_ID_SAITEK_RAT7_OLD 0x0ccb 806 806 #define USB_DEVICE_ID_SAITEK_RAT7 0x0cd7 807 807 #define USB_DEVICE_ID_SAITEK_MMO7 0x0cd0 808 808
+2
drivers/hid/hid-microsoft.c
··· 264 264 .driver_data = MS_ERGONOMY }, 265 265 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_NE4K_JP), 266 266 .driver_data = MS_ERGONOMY }, 267 + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_NE7K), 268 + .driver_data = MS_ERGONOMY }, 267 269 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_LK6K), 268 270 .driver_data = MS_ERGONOMY | MS_RDESC }, 269 271 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_USB),
+2
drivers/hid/hid-saitek.c
··· 177 177 static const struct hid_device_id saitek_devices[] = { 178 178 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000), 179 179 .driver_data = SAITEK_FIX_PS1000 }, 180 + { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RAT7_OLD), 181 + .driver_data = SAITEK_RELEASE_MODE_RAT7 }, 180 182 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RAT7), 181 183 .driver_data = SAITEK_RELEASE_MODE_RAT7 }, 182 184 { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_RAT9),
+5 -3
drivers/hid/hid-sensor-hub.c
··· 135 135 { 136 136 struct hid_sensor_hub_callbacks_list *callback; 137 137 struct sensor_hub_data *pdata = hid_get_drvdata(hdev); 138 + unsigned long flags; 138 139 139 - spin_lock(&pdata->dyn_callback_lock); 140 + spin_lock_irqsave(&pdata->dyn_callback_lock, flags); 140 141 list_for_each_entry(callback, &pdata->dyn_callback_list, list) 141 142 if (callback->usage_id == usage_id && 142 143 (collection_index >= ··· 146 145 callback->hsdev->end_collection_index)) { 147 146 *priv = callback->priv; 148 147 *hsdev = callback->hsdev; 149 - spin_unlock(&pdata->dyn_callback_lock); 148 + spin_unlock_irqrestore(&pdata->dyn_callback_lock, 149 + flags); 150 150 return callback->usage_callback; 151 151 } 152 - spin_unlock(&pdata->dyn_callback_lock); 152 + spin_unlock_irqrestore(&pdata->dyn_callback_lock, flags); 153 153 154 154 return NULL; 155 155 }
+4 -2
drivers/hid/hid-sony.c
··· 804 804 #define DS4_REPORT_0x81_SIZE 7 805 805 #define SIXAXIS_REPORT_0xF2_SIZE 18 806 806 807 - static spinlock_t sony_dev_list_lock; 807 + static DEFINE_SPINLOCK(sony_dev_list_lock); 808 808 static LIST_HEAD(sony_device_list); 809 809 static DEFINE_IDA(sony_device_id_allocator); 810 810 ··· 1944 1944 return -ENOMEM; 1945 1945 } 1946 1946 1947 + spin_lock_init(&sc->lock); 1948 + 1947 1949 sc->quirks = quirks; 1948 1950 hid_set_drvdata(hdev, sc); 1949 1951 sc->hdev = hdev; ··· 2149 2147 { 2150 2148 dbg_hid("Sony:%s\n", __func__); 2151 2149 2152 - ida_destroy(&sony_device_id_allocator); 2153 2150 hid_unregister_driver(&sony_driver); 2151 + ida_destroy(&sony_device_id_allocator); 2154 2152 } 2155 2153 module_init(sony_init); 2156 2154 module_exit(sony_exit);
+5 -2
drivers/hid/i2c-hid/i2c-hid.c
··· 370 370 static void i2c_hid_get_input(struct i2c_hid *ihid) 371 371 { 372 372 int ret, ret_size; 373 - int size = ihid->bufsize; 373 + int size = le16_to_cpu(ihid->hdesc.wMaxInputLength); 374 + 375 + if (size > ihid->bufsize) 376 + size = ihid->bufsize; 374 377 375 378 ret = i2c_master_recv(ihid->client, ihid->inbuf, size); 376 379 if (ret != size) { ··· 788 785 dev_dbg(&client->dev, "Requesting IRQ: %d\n", client->irq); 789 786 790 787 ret = request_threaded_irq(client->irq, NULL, i2c_hid_irq, 791 - IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 788 + IRQF_TRIGGER_LOW | IRQF_ONESHOT, 792 789 client->name, ihid); 793 790 if (ret < 0) { 794 791 dev_warn(&client->dev,
+8 -3
drivers/hid/wacom_wac.c
··· 778 778 input_report_abs(input, ABS_X, be16_to_cpup((__be16 *)&data[4])); 779 779 input_report_abs(input, ABS_Y, be16_to_cpup((__be16 *)&data[6])); 780 780 input_report_abs(input, ABS_Z, be16_to_cpup((__be16 *)&data[8])); 781 + if ((data[2] & 0x07) | data[4] | data[5] | data[6] | data[7] | data[8] | data[9]) { 782 + input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); 783 + } else { 784 + input_report_abs(input, ABS_MISC, 0); 785 + } 781 786 } else if (features->type == CINTIQ_HYBRID) { 782 787 /* 783 788 * Do not send hardware buttons under Android. They ··· 2730 2725 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10, 2731 2726 .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE }; 2732 2727 static const struct wacom_features wacom_features_0x32A = 2733 - { "Wacom Cintiq 27QHD", 119740, 67520, 2047, 2734 - 63, WACOM_27QHD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 2735 - WACOM_27QHD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 2728 + { "Wacom Cintiq 27QHD", 119740, 67520, 2047, 63, 2729 + WACOM_27QHD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 2730 + WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET }; 2736 2731 static const struct wacom_features wacom_features_0x32B = 2737 2732 { "Wacom Cintiq 27QHD touch", 119740, 67520, 2047, 63, 2738 2733 WACOM_27QHD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
+5
include/linux/hid-sensor-hub.h
··· 33 33 * @units: Measurment unit for this attribute. 34 34 * @unit_expo: Exponent used in the data. 35 35 * @size: Size in bytes for data size. 36 + * @logical_minimum: Logical minimum value for this attribute. 37 + * @logical_maximum: Logical maximum value for this attribute. 36 38 */ 37 39 struct hid_sensor_hub_attribute_info { 38 40 u32 usage_id; ··· 148 146 149 147 /** 150 148 * sensor_hub_input_attr_get_raw_value() - Synchronous read request 149 + * @hsdev: Hub device instance. 151 150 * @usage_id: Attribute usage id of parent physical device as per spec 152 151 * @attr_usage_id: Attribute usage id as per spec 153 152 * @report_id: Report id to look for ··· 163 160 u32 attr_usage_id, u32 report_id); 164 161 /** 165 162 * sensor_hub_set_feature() - Feature set request 163 + * @hsdev: Hub device instance. 166 164 * @report_id: Report id to look for 167 165 * @field_index: Field index inside a report 168 166 * @value: Value to set ··· 176 172 177 173 /** 178 174 * sensor_hub_get_feature() - Feature get request 175 + * @hsdev: Hub device instance. 179 176 * @report_id: Report id to look for 180 177 * @field_index: Field index inside a report 181 178 * @value: Place holder for return value