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 partial revert of exponent parsing changes to make "Unit" exponent
item work properly again, by Nikolai Kondrashov

- a few new device IDs additions piggy-backing, by AceLan Kao and David
Herrmann

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
HID: wiimote: add LEGO-wiimote VID
HID: Fix unit exponent parsing again
HID: usbhid: quirk for SiS Touchscreen
HID: usbhid: quirk for Synaptics Large Touchccreen

+24 -15
+7 -5
drivers/hid/hid-core.c
··· 319 319 320 320 static int hid_parser_global(struct hid_parser *parser, struct hid_item *item) 321 321 { 322 - __u32 raw_value; 322 + __s32 raw_value; 323 323 switch (item->tag) { 324 324 case HID_GLOBAL_ITEM_TAG_PUSH: 325 325 ··· 370 370 return 0; 371 371 372 372 case HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT: 373 - /* Units exponent negative numbers are given through a 374 - * two's complement. 375 - * See "6.2.2.7 Global Items" for more information. */ 376 - raw_value = item_udata(item); 373 + /* Many devices provide unit exponent as a two's complement 374 + * nibble due to the common misunderstanding of HID 375 + * specification 1.11, 6.2.2.7 Global Items. Attempt to handle 376 + * both this and the standard encoding. */ 377 + raw_value = item_sdata(item); 377 378 if (!(raw_value & 0xfffffff0)) 378 379 parser->global.unit_exponent = hid_snto32(raw_value, 4); 379 380 else ··· 1871 1870 1872 1871 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) }, 1873 1872 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) }, 1873 + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO2, USB_DEVICE_ID_NINTENDO_WIIMOTE) }, 1874 1874 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) }, 1875 1875 { } 1876 1876 };
+6
drivers/hid/hid-ids.h
··· 633 633 #define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN 0x0003 634 634 635 635 #define USB_VENDOR_ID_NINTENDO 0x057e 636 + #define USB_VENDOR_ID_NINTENDO2 0x054c 636 637 #define USB_DEVICE_ID_NINTENDO_WIIMOTE 0x0306 637 638 #define USB_DEVICE_ID_NINTENDO_WIIMOTE2 0x0330 638 639 ··· 793 792 #define USB_DEVICE_ID_SYNAPTICS_COMP_TP 0x0009 794 793 #define USB_DEVICE_ID_SYNAPTICS_WTP 0x0010 795 794 #define USB_DEVICE_ID_SYNAPTICS_DPAD 0x0013 795 + #define USB_DEVICE_ID_SYNAPTICS_LTS1 0x0af8 796 + #define USB_DEVICE_ID_SYNAPTICS_LTS2 0x1d10 796 797 797 798 #define USB_VENDOR_ID_THINGM 0x27b8 798 799 #define USB_DEVICE_ID_BLINK1 0x01ed ··· 921 918 922 919 #define USB_VENDOR_ID_PRIMAX 0x0461 923 920 #define USB_DEVICE_ID_PRIMAX_KEYBOARD 0x4e05 921 + 922 + #define USB_VENDOR_ID_SIS 0x0457 923 + #define USB_DEVICE_ID_SIS_TS 0x1013 924 924 925 925 #endif
+4 -9
drivers/hid/hid-input.c
··· 192 192 return -EINVAL; 193 193 } 194 194 195 + 195 196 /** 196 197 * hidinput_calc_abs_res - calculate an absolute axis resolution 197 198 * @field: the HID report field to calculate resolution for ··· 235 234 case ABS_MT_TOOL_Y: 236 235 case ABS_MT_TOUCH_MAJOR: 237 236 case ABS_MT_TOUCH_MINOR: 238 - if (field->unit & 0xffffff00) /* Not a length */ 239 - return 0; 240 - unit_exponent += hid_snto32(field->unit >> 4, 4) - 1; 241 - switch (field->unit & 0xf) { 242 - case 0x1: /* If centimeters */ 237 + if (field->unit == 0x11) { /* If centimeters */ 243 238 /* Convert to millimeters */ 244 239 unit_exponent += 1; 245 - break; 246 - case 0x3: /* If inches */ 240 + } else if (field->unit == 0x13) { /* If inches */ 247 241 /* Convert to millimeters */ 248 242 prev = physical_extents; 249 243 physical_extents *= 254; 250 244 if (physical_extents < prev) 251 245 return 0; 252 246 unit_exponent -= 1; 253 - break; 254 - default: 247 + } else { 255 248 return 0; 256 249 } 257 250 break;
+4 -1
drivers/hid/hid-wiimote-core.c
··· 834 834 goto done; 835 835 } 836 836 837 - if (vendor == USB_VENDOR_ID_NINTENDO) { 837 + if (vendor == USB_VENDOR_ID_NINTENDO || 838 + vendor == USB_VENDOR_ID_NINTENDO2) { 838 839 if (product == USB_DEVICE_ID_NINTENDO_WIIMOTE) { 839 840 devtype = WIIMOTE_DEV_GEN10; 840 841 goto done; ··· 1855 1854 1856 1855 static const struct hid_device_id wiimote_hid_devices[] = { 1857 1856 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, 1857 + USB_DEVICE_ID_NINTENDO_WIIMOTE) }, 1858 + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO2, 1858 1859 USB_DEVICE_ID_NINTENDO_WIIMOTE) }, 1859 1860 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, 1860 1861 USB_DEVICE_ID_NINTENDO_WIIMOTE2) },
+3
drivers/hid/usbhid/hid-quirks.c
··· 110 110 { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X, HID_QUIRK_MULTI_INPUT }, 111 111 { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X, HID_QUIRK_MULTI_INPUT }, 112 112 { USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_DUOSENSE, HID_QUIRK_NO_INIT_REPORTS }, 113 + { USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_LTS1, HID_QUIRK_NO_INIT_REPORTS }, 114 + { USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_LTS2, HID_QUIRK_NO_INIT_REPORTS }, 115 + { USB_VENDOR_ID_SIS, USB_DEVICE_ID_SIS_TS, HID_QUIRK_NO_INIT_REPORTS }, 113 116 114 117 { 0, 0 } 115 118 };