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/hid/hid

Pull HID fixes from Jiri Kosina:

- revert of the high-resolution scrolling feature, as it breaks certain
hardware due to incompatibilities between Logitech and Microsoft
worlds. Peter Hutterer is working on a fixed implementation. Until
that is finished, revert by Benjamin Tissoires.

- revert of incorrect strncpy->strlcpy conversion in uhid, from David
Herrmann

- fix for buggy sendfile() implementation on uhid device node, from
Eric Biggers

- a few assorted device-ID specific quirks

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
Revert "Input: Add the `REL_WHEEL_HI_RES` event code"
Revert "HID: input: Create a utility class for counting scroll events"
Revert "HID: logitech: Add function to enable HID++ 1.0 "scrolling acceleration""
Revert "HID: logitech: Enable high-resolution scrolling on Logitech mice"
Revert "HID: logitech: Use LDJ_DEVICE macro for existing Logitech mice"
Revert "HID: logitech: fix a used uninitialized GCC warning"
Revert "HID: input: simplify/fix high-res scroll event handling"
HID: Add quirk for Primax PIXART OEM mice
HID: i2c-hid: Disable runtime PM for LG touchscreen
HID: multitouch: Add pointstick support for Cirque Touchpad
HID: steam: remove input device when a hid client is running.
Revert "HID: uhid: use strlcpy() instead of strncpy()"
HID: uhid: forbid UHID_CREATE under KERNEL_DS or elevated privileges
HID: input: Ignore battery reported by Symbol DS4308
HID: Add quirk for Microsoft PIXART OEM mouse

+159 -444
+1 -10
Documentation/input/event-codes.rst
··· 190 190 * REL_WHEEL, REL_HWHEEL: 191 191 192 192 - These codes are used for vertical and horizontal scroll wheels, 193 - respectively. The value is the number of "notches" moved on the wheel, the 194 - physical size of which varies by device. For high-resolution wheels (which 195 - report multiple events for each notch of movement, or do not have notches) 196 - this may be an approximation based on the high-resolution scroll events. 197 - 198 - * REL_WHEEL_HI_RES: 199 - 200 - - If a vertical scroll wheel supports high-resolution scrolling, this code 201 - will be emitted in addition to REL_WHEEL. The value is the (approximate) 202 - distance travelled by the user's finger, in microns. 193 + respectively. 203 194 204 195 EV_ABS 205 196 ------
+8
drivers/hid/hid-ids.h
··· 275 275 276 276 #define USB_VENDOR_ID_CIDC 0x1677 277 277 278 + #define I2C_VENDOR_ID_CIRQUE 0x0488 279 + #define I2C_PRODUCT_ID_CIRQUE_121F 0x121F 280 + 278 281 #define USB_VENDOR_ID_CJTOUCH 0x24b8 279 282 #define USB_DEVICE_ID_CJTOUCH_MULTI_TOUCH_0020 0x0020 280 283 #define USB_DEVICE_ID_CJTOUCH_MULTI_TOUCH_0040 0x0040 ··· 710 707 #define USB_VENDOR_ID_LG 0x1fd2 711 708 #define USB_DEVICE_ID_LG_MULTITOUCH 0x0064 712 709 #define USB_DEVICE_ID_LG_MELFAS_MT 0x6007 710 + #define I2C_DEVICE_ID_LG_8001 0x8001 713 711 714 712 #define USB_VENDOR_ID_LOGITECH 0x046d 715 713 #define USB_DEVICE_ID_LOGITECH_AUDIOHUB 0x0a0e ··· 809 805 #define USB_DEVICE_ID_MS_TYPE_COVER_2 0x07a9 810 806 #define USB_DEVICE_ID_MS_POWER_COVER 0x07da 811 807 #define USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER 0x02fd 808 + #define USB_DEVICE_ID_MS_PIXART_MOUSE 0x00cb 812 809 813 810 #define USB_VENDOR_ID_MOJO 0x8282 814 811 #define USB_DEVICE_ID_RETRO_ADAPTER 0x3201 ··· 1048 1043 #define USB_VENDOR_ID_SYMBOL 0x05e0 1049 1044 #define USB_DEVICE_ID_SYMBOL_SCANNER_1 0x0800 1050 1045 #define USB_DEVICE_ID_SYMBOL_SCANNER_2 0x1300 1046 + #define USB_DEVICE_ID_SYMBOL_SCANNER_3 0x1200 1051 1047 1052 1048 #define USB_VENDOR_ID_SYNAPTICS 0x06cb 1053 1049 #define USB_DEVICE_ID_SYNAPTICS_TP 0x0001 ··· 1210 1204 #define USB_DEVICE_ID_PRIMAX_MOUSE_4D22 0x4d22 1211 1205 #define USB_DEVICE_ID_PRIMAX_KEYBOARD 0x4e05 1212 1206 #define USB_DEVICE_ID_PRIMAX_REZEL 0x4e72 1207 + #define USB_DEVICE_ID_PRIMAX_PIXART_MOUSE_4D0F 0x4d0f 1208 + #define USB_DEVICE_ID_PRIMAX_PIXART_MOUSE_4E22 0x4e22 1213 1209 1214 1210 1215 1211 #define USB_VENDOR_ID_RISO_KAGAKU 0x1294 /* Riso Kagaku Corp. */
+3 -44
drivers/hid/hid-input.c
··· 325 325 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, 326 326 USB_DEVICE_ID_ELECOM_BM084), 327 327 HID_BATTERY_QUIRK_IGNORE }, 328 + { HID_USB_DEVICE(USB_VENDOR_ID_SYMBOL, 329 + USB_DEVICE_ID_SYMBOL_SCANNER_3), 330 + HID_BATTERY_QUIRK_IGNORE }, 328 331 {} 329 332 }; 330 333 ··· 1841 1838 } 1842 1839 EXPORT_SYMBOL_GPL(hidinput_disconnect); 1843 1840 1844 - /** 1845 - * hid_scroll_counter_handle_scroll() - Send high- and low-resolution scroll 1846 - * events given a high-resolution wheel 1847 - * movement. 1848 - * @counter: a hid_scroll_counter struct describing the wheel. 1849 - * @hi_res_value: the movement of the wheel, in the mouse's high-resolution 1850 - * units. 1851 - * 1852 - * Given a high-resolution movement, this function converts the movement into 1853 - * microns and emits high-resolution scroll events for the input device. It also 1854 - * uses the multiplier from &struct hid_scroll_counter to emit low-resolution 1855 - * scroll events when appropriate for backwards-compatibility with userspace 1856 - * input libraries. 1857 - */ 1858 - void hid_scroll_counter_handle_scroll(struct hid_scroll_counter *counter, 1859 - int hi_res_value) 1860 - { 1861 - int low_res_value, remainder, multiplier; 1862 - 1863 - input_report_rel(counter->dev, REL_WHEEL_HI_RES, 1864 - hi_res_value * counter->microns_per_hi_res_unit); 1865 - 1866 - /* 1867 - * Update the low-res remainder with the high-res value, 1868 - * but reset if the direction has changed. 1869 - */ 1870 - remainder = counter->remainder; 1871 - if ((remainder ^ hi_res_value) < 0) 1872 - remainder = 0; 1873 - remainder += hi_res_value; 1874 - 1875 - /* 1876 - * Then just use the resolution multiplier to see if 1877 - * we should send a low-res (aka regular wheel) event. 1878 - */ 1879 - multiplier = counter->resolution_multiplier; 1880 - low_res_value = remainder / multiplier; 1881 - remainder -= low_res_value * multiplier; 1882 - counter->remainder = remainder; 1883 - 1884 - if (low_res_value) 1885 - input_report_rel(counter->dev, REL_WHEEL, low_res_value); 1886 - } 1887 - EXPORT_SYMBOL_GPL(hid_scroll_counter_handle_scroll);
+27 -282
drivers/hid/hid-logitech-hidpp.c
··· 64 64 #define HIDPP_QUIRK_NO_HIDINPUT BIT(23) 65 65 #define HIDPP_QUIRK_FORCE_OUTPUT_REPORTS BIT(24) 66 66 #define HIDPP_QUIRK_UNIFYING BIT(25) 67 - #define HIDPP_QUIRK_HI_RES_SCROLL_1P0 BIT(26) 68 - #define HIDPP_QUIRK_HI_RES_SCROLL_X2120 BIT(27) 69 - #define HIDPP_QUIRK_HI_RES_SCROLL_X2121 BIT(28) 70 - 71 - /* Convenience constant to check for any high-res support. */ 72 - #define HIDPP_QUIRK_HI_RES_SCROLL (HIDPP_QUIRK_HI_RES_SCROLL_1P0 | \ 73 - HIDPP_QUIRK_HI_RES_SCROLL_X2120 | \ 74 - HIDPP_QUIRK_HI_RES_SCROLL_X2121) 75 67 76 68 #define HIDPP_QUIRK_DELAYED_INIT HIDPP_QUIRK_NO_HIDINPUT 77 69 ··· 149 157 unsigned long capabilities; 150 158 151 159 struct hidpp_battery battery; 152 - struct hid_scroll_counter vertical_wheel_counter; 153 160 }; 154 161 155 162 /* HID++ 1.0 error codes */ ··· 400 409 #define HIDPP_SET_LONG_REGISTER 0x82 401 410 #define HIDPP_GET_LONG_REGISTER 0x83 402 411 403 - /** 404 - * hidpp10_set_register_bit() - Sets a single bit in a HID++ 1.0 register. 405 - * @hidpp_dev: the device to set the register on. 406 - * @register_address: the address of the register to modify. 407 - * @byte: the byte of the register to modify. Should be less than 3. 408 - * Return: 0 if successful, otherwise a negative error code. 409 - */ 410 - static int hidpp10_set_register_bit(struct hidpp_device *hidpp_dev, 411 - u8 register_address, u8 byte, u8 bit) 412 + #define HIDPP_REG_GENERAL 0x00 413 + 414 + static int hidpp10_enable_battery_reporting(struct hidpp_device *hidpp_dev) 412 415 { 413 416 struct hidpp_report response; 414 417 int ret; 415 418 u8 params[3] = { 0 }; 416 419 417 420 ret = hidpp_send_rap_command_sync(hidpp_dev, 418 - REPORT_ID_HIDPP_SHORT, 419 - HIDPP_GET_REGISTER, 420 - register_address, 421 - NULL, 0, &response); 421 + REPORT_ID_HIDPP_SHORT, 422 + HIDPP_GET_REGISTER, 423 + HIDPP_REG_GENERAL, 424 + NULL, 0, &response); 422 425 if (ret) 423 426 return ret; 424 427 425 428 memcpy(params, response.rap.params, 3); 426 429 427 - params[byte] |= BIT(bit); 430 + /* Set the battery bit */ 431 + params[0] |= BIT(4); 428 432 429 433 return hidpp_send_rap_command_sync(hidpp_dev, 430 - REPORT_ID_HIDPP_SHORT, 431 - HIDPP_SET_REGISTER, 432 - register_address, 433 - params, 3, &response); 434 - } 435 - 436 - 437 - #define HIDPP_REG_GENERAL 0x00 438 - 439 - static int hidpp10_enable_battery_reporting(struct hidpp_device *hidpp_dev) 440 - { 441 - return hidpp10_set_register_bit(hidpp_dev, HIDPP_REG_GENERAL, 0, 4); 442 - } 443 - 444 - #define HIDPP_REG_FEATURES 0x01 445 - 446 - /* On HID++ 1.0 devices, high-res scroll was called "scrolling acceleration". */ 447 - static int hidpp10_enable_scrolling_acceleration(struct hidpp_device *hidpp_dev) 448 - { 449 - return hidpp10_set_register_bit(hidpp_dev, HIDPP_REG_FEATURES, 0, 6); 434 + REPORT_ID_HIDPP_SHORT, 435 + HIDPP_SET_REGISTER, 436 + HIDPP_REG_GENERAL, 437 + params, 3, &response); 450 438 } 451 439 452 440 #define HIDPP_REG_BATTERY_STATUS 0x07 ··· 1134 1164 } 1135 1165 1136 1166 return ret; 1137 - } 1138 - 1139 - /* -------------------------------------------------------------------------- */ 1140 - /* 0x2120: Hi-resolution scrolling */ 1141 - /* -------------------------------------------------------------------------- */ 1142 - 1143 - #define HIDPP_PAGE_HI_RESOLUTION_SCROLLING 0x2120 1144 - 1145 - #define CMD_HI_RESOLUTION_SCROLLING_SET_HIGHRES_SCROLLING_MODE 0x10 1146 - 1147 - static int hidpp_hrs_set_highres_scrolling_mode(struct hidpp_device *hidpp, 1148 - bool enabled, u8 *multiplier) 1149 - { 1150 - u8 feature_index; 1151 - u8 feature_type; 1152 - int ret; 1153 - u8 params[1]; 1154 - struct hidpp_report response; 1155 - 1156 - ret = hidpp_root_get_feature(hidpp, 1157 - HIDPP_PAGE_HI_RESOLUTION_SCROLLING, 1158 - &feature_index, 1159 - &feature_type); 1160 - if (ret) 1161 - return ret; 1162 - 1163 - params[0] = enabled ? BIT(0) : 0; 1164 - ret = hidpp_send_fap_command_sync(hidpp, feature_index, 1165 - CMD_HI_RESOLUTION_SCROLLING_SET_HIGHRES_SCROLLING_MODE, 1166 - params, sizeof(params), &response); 1167 - if (ret) 1168 - return ret; 1169 - *multiplier = response.fap.params[1]; 1170 - return 0; 1171 - } 1172 - 1173 - /* -------------------------------------------------------------------------- */ 1174 - /* 0x2121: HiRes Wheel */ 1175 - /* -------------------------------------------------------------------------- */ 1176 - 1177 - #define HIDPP_PAGE_HIRES_WHEEL 0x2121 1178 - 1179 - #define CMD_HIRES_WHEEL_GET_WHEEL_CAPABILITY 0x00 1180 - #define CMD_HIRES_WHEEL_SET_WHEEL_MODE 0x20 1181 - 1182 - static int hidpp_hrw_get_wheel_capability(struct hidpp_device *hidpp, 1183 - u8 *multiplier) 1184 - { 1185 - u8 feature_index; 1186 - u8 feature_type; 1187 - int ret; 1188 - struct hidpp_report response; 1189 - 1190 - ret = hidpp_root_get_feature(hidpp, HIDPP_PAGE_HIRES_WHEEL, 1191 - &feature_index, &feature_type); 1192 - if (ret) 1193 - goto return_default; 1194 - 1195 - ret = hidpp_send_fap_command_sync(hidpp, feature_index, 1196 - CMD_HIRES_WHEEL_GET_WHEEL_CAPABILITY, 1197 - NULL, 0, &response); 1198 - if (ret) 1199 - goto return_default; 1200 - 1201 - *multiplier = response.fap.params[0]; 1202 - return 0; 1203 - return_default: 1204 - hid_warn(hidpp->hid_dev, 1205 - "Couldn't get wheel multiplier (error %d), assuming %d.\n", 1206 - ret, *multiplier); 1207 - return ret; 1208 - } 1209 - 1210 - static int hidpp_hrw_set_wheel_mode(struct hidpp_device *hidpp, bool invert, 1211 - bool high_resolution, bool use_hidpp) 1212 - { 1213 - u8 feature_index; 1214 - u8 feature_type; 1215 - int ret; 1216 - u8 params[1]; 1217 - struct hidpp_report response; 1218 - 1219 - ret = hidpp_root_get_feature(hidpp, HIDPP_PAGE_HIRES_WHEEL, 1220 - &feature_index, &feature_type); 1221 - if (ret) 1222 - return ret; 1223 - 1224 - params[0] = (invert ? BIT(2) : 0) | 1225 - (high_resolution ? BIT(1) : 0) | 1226 - (use_hidpp ? BIT(0) : 0); 1227 - 1228 - return hidpp_send_fap_command_sync(hidpp, feature_index, 1229 - CMD_HIRES_WHEEL_SET_WHEEL_MODE, 1230 - params, sizeof(params), &response); 1231 1167 } 1232 1168 1233 1169 /* -------------------------------------------------------------------------- */ ··· 2399 2523 input_report_rel(mydata->input, REL_Y, v); 2400 2524 2401 2525 v = hid_snto32(data[6], 8); 2402 - hid_scroll_counter_handle_scroll( 2403 - &hidpp->vertical_wheel_counter, v); 2526 + input_report_rel(mydata->input, REL_WHEEL, v); 2404 2527 2405 2528 input_sync(mydata->input); 2406 2529 } ··· 2528 2653 } 2529 2654 2530 2655 /* -------------------------------------------------------------------------- */ 2531 - /* High-resolution scroll wheels */ 2532 - /* -------------------------------------------------------------------------- */ 2533 - 2534 - /** 2535 - * struct hi_res_scroll_info - Stores info on a device's high-res scroll wheel. 2536 - * @product_id: the HID product ID of the device being described. 2537 - * @microns_per_hi_res_unit: the distance moved by the user's finger for each 2538 - * high-resolution unit reported by the device, in 2539 - * 256ths of a millimetre. 2540 - */ 2541 - struct hi_res_scroll_info { 2542 - __u32 product_id; 2543 - int microns_per_hi_res_unit; 2544 - }; 2545 - 2546 - static struct hi_res_scroll_info hi_res_scroll_devices[] = { 2547 - { /* Anywhere MX */ 2548 - .product_id = 0x1017, .microns_per_hi_res_unit = 445 }, 2549 - { /* Performance MX */ 2550 - .product_id = 0x101a, .microns_per_hi_res_unit = 406 }, 2551 - { /* M560 */ 2552 - .product_id = 0x402d, .microns_per_hi_res_unit = 435 }, 2553 - { /* MX Master 2S */ 2554 - .product_id = 0x4069, .microns_per_hi_res_unit = 406 }, 2555 - }; 2556 - 2557 - static int hi_res_scroll_look_up_microns(__u32 product_id) 2558 - { 2559 - int i; 2560 - int num_devices = sizeof(hi_res_scroll_devices) 2561 - / sizeof(hi_res_scroll_devices[0]); 2562 - for (i = 0; i < num_devices; i++) { 2563 - if (hi_res_scroll_devices[i].product_id == product_id) 2564 - return hi_res_scroll_devices[i].microns_per_hi_res_unit; 2565 - } 2566 - /* We don't have a value for this device, so use a sensible default. */ 2567 - return 406; 2568 - } 2569 - 2570 - static int hi_res_scroll_enable(struct hidpp_device *hidpp) 2571 - { 2572 - int ret; 2573 - u8 multiplier = 8; 2574 - 2575 - if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_X2121) { 2576 - ret = hidpp_hrw_set_wheel_mode(hidpp, false, true, false); 2577 - hidpp_hrw_get_wheel_capability(hidpp, &multiplier); 2578 - } else if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_X2120) { 2579 - ret = hidpp_hrs_set_highres_scrolling_mode(hidpp, true, 2580 - &multiplier); 2581 - } else /* if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL_1P0) */ 2582 - ret = hidpp10_enable_scrolling_acceleration(hidpp); 2583 - 2584 - if (ret) 2585 - return ret; 2586 - 2587 - hidpp->vertical_wheel_counter.resolution_multiplier = multiplier; 2588 - hidpp->vertical_wheel_counter.microns_per_hi_res_unit = 2589 - hi_res_scroll_look_up_microns(hidpp->hid_dev->product); 2590 - hid_info(hidpp->hid_dev, "multiplier = %d, microns = %d\n", 2591 - multiplier, 2592 - hidpp->vertical_wheel_counter.microns_per_hi_res_unit); 2593 - return 0; 2594 - } 2595 - 2596 - /* -------------------------------------------------------------------------- */ 2597 2656 /* Generic HID++ devices */ 2598 2657 /* -------------------------------------------------------------------------- */ 2599 2658 ··· 2572 2763 wtp_populate_input(hidpp, input, origin_is_hid_core); 2573 2764 else if (hidpp->quirks & HIDPP_QUIRK_CLASS_M560) 2574 2765 m560_populate_input(hidpp, input, origin_is_hid_core); 2575 - 2576 - if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL) { 2577 - input_set_capability(input, EV_REL, REL_WHEEL_HI_RES); 2578 - hidpp->vertical_wheel_counter.dev = input; 2579 - } 2580 2766 } 2581 2767 2582 2768 static int hidpp_input_configured(struct hid_device *hdev, ··· 2688 2884 return m560_raw_event(hdev, data, size); 2689 2885 2690 2886 return 0; 2691 - } 2692 - 2693 - static int hidpp_event(struct hid_device *hdev, struct hid_field *field, 2694 - struct hid_usage *usage, __s32 value) 2695 - { 2696 - /* This function will only be called for scroll events, due to the 2697 - * restriction imposed in hidpp_usages. 2698 - */ 2699 - struct hidpp_device *hidpp = hid_get_drvdata(hdev); 2700 - struct hid_scroll_counter *counter = &hidpp->vertical_wheel_counter; 2701 - /* A scroll event may occur before the multiplier has been retrieved or 2702 - * the input device set, or high-res scroll enabling may fail. In such 2703 - * cases we must return early (falling back to default behaviour) to 2704 - * avoid a crash in hid_scroll_counter_handle_scroll. 2705 - */ 2706 - if (!(hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL) || value == 0 2707 - || counter->dev == NULL || counter->resolution_multiplier == 0) 2708 - return 0; 2709 - 2710 - hid_scroll_counter_handle_scroll(counter, value); 2711 - return 1; 2712 2887 } 2713 2888 2714 2889 static int hidpp_initialize_battery(struct hidpp_device *hidpp) ··· 2901 3118 if (hidpp->battery.ps) 2902 3119 power_supply_changed(hidpp->battery.ps); 2903 3120 2904 - if (hidpp->quirks & HIDPP_QUIRK_HI_RES_SCROLL) 2905 - hi_res_scroll_enable(hidpp); 2906 - 2907 3121 if (!(hidpp->quirks & HIDPP_QUIRK_NO_HIDINPUT) || hidpp->delayed_input) 2908 3122 /* if the input nodes are already created, we can stop now */ 2909 3123 return; ··· 3086 3306 mutex_destroy(&hidpp->send_mutex); 3087 3307 } 3088 3308 3089 - #define LDJ_DEVICE(product) \ 3090 - HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE, \ 3091 - USB_VENDOR_ID_LOGITECH, (product)) 3092 - 3093 3309 static const struct hid_device_id hidpp_devices[] = { 3094 3310 { /* wireless touchpad */ 3095 - LDJ_DEVICE(0x4011), 3311 + HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE, 3312 + USB_VENDOR_ID_LOGITECH, 0x4011), 3096 3313 .driver_data = HIDPP_QUIRK_CLASS_WTP | HIDPP_QUIRK_DELAYED_INIT | 3097 3314 HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS }, 3098 3315 { /* wireless touchpad T650 */ 3099 - LDJ_DEVICE(0x4101), 3316 + HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE, 3317 + USB_VENDOR_ID_LOGITECH, 0x4101), 3100 3318 .driver_data = HIDPP_QUIRK_CLASS_WTP | HIDPP_QUIRK_DELAYED_INIT }, 3101 3319 { /* wireless touchpad T651 */ 3102 3320 HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 3103 3321 USB_DEVICE_ID_LOGITECH_T651), 3104 3322 .driver_data = HIDPP_QUIRK_CLASS_WTP }, 3105 - { /* Mouse Logitech Anywhere MX */ 3106 - LDJ_DEVICE(0x1017), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_1P0 }, 3107 - { /* Mouse Logitech Cube */ 3108 - LDJ_DEVICE(0x4010), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2120 }, 3109 - { /* Mouse Logitech M335 */ 3110 - LDJ_DEVICE(0x4050), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 }, 3111 - { /* Mouse Logitech M515 */ 3112 - LDJ_DEVICE(0x4007), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2120 }, 3113 3323 { /* Mouse logitech M560 */ 3114 - LDJ_DEVICE(0x402d), 3115 - .driver_data = HIDPP_QUIRK_DELAYED_INIT | HIDPP_QUIRK_CLASS_M560 3116 - | HIDPP_QUIRK_HI_RES_SCROLL_X2120 }, 3117 - { /* Mouse Logitech M705 (firmware RQM17) */ 3118 - LDJ_DEVICE(0x101b), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_1P0 }, 3119 - { /* Mouse Logitech M705 (firmware RQM67) */ 3120 - LDJ_DEVICE(0x406d), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 }, 3121 - { /* Mouse Logitech M720 */ 3122 - LDJ_DEVICE(0x405e), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 }, 3123 - { /* Mouse Logitech MX Anywhere 2 */ 3124 - LDJ_DEVICE(0x404a), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 }, 3125 - { LDJ_DEVICE(0xb013), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 }, 3126 - { LDJ_DEVICE(0xb018), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 }, 3127 - { LDJ_DEVICE(0xb01f), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 }, 3128 - { /* Mouse Logitech MX Anywhere 2S */ 3129 - LDJ_DEVICE(0x406a), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 }, 3130 - { /* Mouse Logitech MX Master */ 3131 - LDJ_DEVICE(0x4041), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 }, 3132 - { LDJ_DEVICE(0x4060), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 }, 3133 - { LDJ_DEVICE(0x4071), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 }, 3134 - { /* Mouse Logitech MX Master 2S */ 3135 - LDJ_DEVICE(0x4069), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 }, 3136 - { /* Mouse Logitech Performance MX */ 3137 - LDJ_DEVICE(0x101a), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_1P0 }, 3324 + HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE, 3325 + USB_VENDOR_ID_LOGITECH, 0x402d), 3326 + .driver_data = HIDPP_QUIRK_DELAYED_INIT | HIDPP_QUIRK_CLASS_M560 }, 3138 3327 { /* Keyboard logitech K400 */ 3139 - LDJ_DEVICE(0x4024), 3328 + HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE, 3329 + USB_VENDOR_ID_LOGITECH, 0x4024), 3140 3330 .driver_data = HIDPP_QUIRK_CLASS_K400 }, 3141 3331 { /* Solar Keyboard Logitech K750 */ 3142 - LDJ_DEVICE(0x4002), 3332 + HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE, 3333 + USB_VENDOR_ID_LOGITECH, 0x4002), 3143 3334 .driver_data = HIDPP_QUIRK_CLASS_K750 }, 3144 3335 3145 - { LDJ_DEVICE(HID_ANY_ID) }, 3336 + { HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE, 3337 + USB_VENDOR_ID_LOGITECH, HID_ANY_ID)}, 3146 3338 3147 3339 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G920_WHEEL), 3148 3340 .driver_data = HIDPP_QUIRK_CLASS_G920 | HIDPP_QUIRK_FORCE_OUTPUT_REPORTS}, ··· 3123 3371 3124 3372 MODULE_DEVICE_TABLE(hid, hidpp_devices); 3125 3373 3126 - static const struct hid_usage_id hidpp_usages[] = { 3127 - { HID_GD_WHEEL, EV_REL, REL_WHEEL }, 3128 - { HID_ANY_ID - 1, HID_ANY_ID - 1, HID_ANY_ID - 1} 3129 - }; 3130 - 3131 3374 static struct hid_driver hidpp_driver = { 3132 3375 .name = "logitech-hidpp-device", 3133 3376 .id_table = hidpp_devices, 3134 3377 .probe = hidpp_probe, 3135 3378 .remove = hidpp_remove, 3136 3379 .raw_event = hidpp_raw_event, 3137 - .usage_table = hidpp_usages, 3138 - .event = hidpp_event, 3139 3380 .input_configured = hidpp_input_configured, 3140 3381 .input_mapping = hidpp_input_mapping, 3141 3382 .input_mapped = hidpp_input_mapped,
+6
drivers/hid/hid-multitouch.c
··· 1814 1814 MT_USB_DEVICE(USB_VENDOR_ID_CHUNGHWAT, 1815 1815 USB_DEVICE_ID_CHUNGHWAT_MULTITOUCH) }, 1816 1816 1817 + /* Cirque devices */ 1818 + { .driver_data = MT_CLS_WIN_8_DUAL, 1819 + HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8, 1820 + I2C_VENDOR_ID_CIRQUE, 1821 + I2C_PRODUCT_ID_CIRQUE_121F) }, 1822 + 1817 1823 /* CJTouch panels */ 1818 1824 { .driver_data = MT_CLS_NSMU, 1819 1825 MT_USB_DEVICE(USB_VENDOR_ID_CJTOUCH,
+3
drivers/hid/hid-quirks.c
··· 107 107 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOUSE_C05A), HID_QUIRK_ALWAYS_POLL }, 108 108 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOUSE_C06A), HID_QUIRK_ALWAYS_POLL }, 109 109 { HID_USB_DEVICE(USB_VENDOR_ID_MCS, USB_DEVICE_ID_MCS_GAMEPADBLOCK), HID_QUIRK_MULTI_INPUT }, 110 + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PIXART_MOUSE), HID_QUIRK_ALWAYS_POLL }, 110 111 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER), HID_QUIRK_NO_INIT_REPORTS }, 111 112 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_SURFACE_PRO_2), HID_QUIRK_NO_INIT_REPORTS }, 112 113 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TOUCH_COVER_2), HID_QUIRK_NO_INIT_REPORTS }, ··· 130 129 { HID_USB_DEVICE(USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN), HID_QUIRK_NO_INIT_REPORTS }, 131 130 { HID_USB_DEVICE(USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL }, 132 131 { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_MOUSE_4D22), HID_QUIRK_ALWAYS_POLL }, 132 + { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_PIXART_MOUSE_4D0F), HID_QUIRK_ALWAYS_POLL }, 133 + { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_PIXART_MOUSE_4E22), HID_QUIRK_ALWAYS_POLL }, 133 134 { HID_USB_DEVICE(USB_VENDOR_ID_PRODIGE, USB_DEVICE_ID_PRODIGE_CORDLESS), HID_QUIRK_NOGET }, 134 135 { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001), HID_QUIRK_NOGET }, 135 136 { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3003), HID_QUIRK_NOGET },
+90 -64
drivers/hid/hid-steam.c
··· 23 23 * In order to avoid breaking them this driver creates a layered hidraw device, 24 24 * so it can detect when the client is running and then: 25 25 * - it will not send any command to the controller. 26 - * - this input device will be disabled, to avoid double input of the same 26 + * - this input device will be removed, to avoid double input of the same 27 27 * user action. 28 + * When the client is closed, this input device will be created again. 28 29 * 29 30 * For additional functions, such as changing the right-pad margin or switching 30 31 * the led, you can use the user-space tool at: ··· 114 113 spinlock_t lock; 115 114 struct hid_device *hdev, *client_hdev; 116 115 struct mutex mutex; 117 - bool client_opened, input_opened; 116 + bool client_opened; 118 117 struct input_dev __rcu *input; 119 118 unsigned long quirks; 120 119 struct work_struct work_connect; ··· 280 279 } 281 280 } 282 281 283 - static void steam_update_lizard_mode(struct steam_device *steam) 284 - { 285 - mutex_lock(&steam->mutex); 286 - if (!steam->client_opened) { 287 - if (steam->input_opened) 288 - steam_set_lizard_mode(steam, false); 289 - else 290 - steam_set_lizard_mode(steam, lizard_mode); 291 - } 292 - mutex_unlock(&steam->mutex); 293 - } 294 - 295 282 static int steam_input_open(struct input_dev *dev) 296 283 { 297 284 struct steam_device *steam = input_get_drvdata(dev); ··· 290 301 return ret; 291 302 292 303 mutex_lock(&steam->mutex); 293 - steam->input_opened = true; 294 304 if (!steam->client_opened && lizard_mode) 295 305 steam_set_lizard_mode(steam, false); 296 306 mutex_unlock(&steam->mutex); ··· 301 313 struct steam_device *steam = input_get_drvdata(dev); 302 314 303 315 mutex_lock(&steam->mutex); 304 - steam->input_opened = false; 305 316 if (!steam->client_opened && lizard_mode) 306 317 steam_set_lizard_mode(steam, true); 307 318 mutex_unlock(&steam->mutex); ··· 387 400 return 0; 388 401 } 389 402 390 - static int steam_register(struct steam_device *steam) 403 + static int steam_input_register(struct steam_device *steam) 391 404 { 392 405 struct hid_device *hdev = steam->hdev; 393 406 struct input_dev *input; ··· 400 413 dbg_hid("%s: already connected\n", __func__); 401 414 return 0; 402 415 } 403 - 404 - /* 405 - * Unlikely, but getting the serial could fail, and it is not so 406 - * important, so make up a serial number and go on. 407 - */ 408 - if (steam_get_serial(steam) < 0) 409 - strlcpy(steam->serial_no, "XXXXXXXXXX", 410 - sizeof(steam->serial_no)); 411 - 412 - hid_info(hdev, "Steam Controller '%s' connected", 413 - steam->serial_no); 414 416 415 417 input = input_allocate_device(); 416 418 if (!input) ··· 468 492 goto input_register_fail; 469 493 470 494 rcu_assign_pointer(steam->input, input); 471 - 472 - /* ignore battery errors, we can live without it */ 473 - if (steam->quirks & STEAM_QUIRK_WIRELESS) 474 - steam_battery_register(steam); 475 - 476 495 return 0; 477 496 478 497 input_register_fail: ··· 475 504 return ret; 476 505 } 477 506 478 - static void steam_unregister(struct steam_device *steam) 507 + static void steam_input_unregister(struct steam_device *steam) 479 508 { 480 509 struct input_dev *input; 510 + rcu_read_lock(); 511 + input = rcu_dereference(steam->input); 512 + rcu_read_unlock(); 513 + if (!input) 514 + return; 515 + RCU_INIT_POINTER(steam->input, NULL); 516 + synchronize_rcu(); 517 + input_unregister_device(input); 518 + } 519 + 520 + static void steam_battery_unregister(struct steam_device *steam) 521 + { 481 522 struct power_supply *battery; 482 523 483 524 rcu_read_lock(); 484 - input = rcu_dereference(steam->input); 485 525 battery = rcu_dereference(steam->battery); 486 526 rcu_read_unlock(); 487 527 488 - if (battery) { 489 - RCU_INIT_POINTER(steam->battery, NULL); 490 - synchronize_rcu(); 491 - power_supply_unregister(battery); 528 + if (!battery) 529 + return; 530 + RCU_INIT_POINTER(steam->battery, NULL); 531 + synchronize_rcu(); 532 + power_supply_unregister(battery); 533 + } 534 + 535 + static int steam_register(struct steam_device *steam) 536 + { 537 + int ret; 538 + 539 + /* 540 + * This function can be called several times in a row with the 541 + * wireless adaptor, without steam_unregister() between them, because 542 + * another client send a get_connection_status command, for example. 543 + * The battery and serial number are set just once per device. 544 + */ 545 + if (!steam->serial_no[0]) { 546 + /* 547 + * Unlikely, but getting the serial could fail, and it is not so 548 + * important, so make up a serial number and go on. 549 + */ 550 + if (steam_get_serial(steam) < 0) 551 + strlcpy(steam->serial_no, "XXXXXXXXXX", 552 + sizeof(steam->serial_no)); 553 + 554 + hid_info(steam->hdev, "Steam Controller '%s' connected", 555 + steam->serial_no); 556 + 557 + /* ignore battery errors, we can live without it */ 558 + if (steam->quirks & STEAM_QUIRK_WIRELESS) 559 + steam_battery_register(steam); 560 + 561 + mutex_lock(&steam_devices_lock); 562 + list_add(&steam->list, &steam_devices); 563 + mutex_unlock(&steam_devices_lock); 492 564 } 493 - if (input) { 494 - RCU_INIT_POINTER(steam->input, NULL); 495 - synchronize_rcu(); 565 + 566 + mutex_lock(&steam->mutex); 567 + if (!steam->client_opened) { 568 + steam_set_lizard_mode(steam, lizard_mode); 569 + ret = steam_input_register(steam); 570 + } else { 571 + ret = 0; 572 + } 573 + mutex_unlock(&steam->mutex); 574 + 575 + return ret; 576 + } 577 + 578 + static void steam_unregister(struct steam_device *steam) 579 + { 580 + steam_battery_unregister(steam); 581 + steam_input_unregister(steam); 582 + if (steam->serial_no[0]) { 496 583 hid_info(steam->hdev, "Steam Controller '%s' disconnected", 497 584 steam->serial_no); 498 - input_unregister_device(input); 585 + mutex_lock(&steam_devices_lock); 586 + list_del(&steam->list); 587 + mutex_unlock(&steam_devices_lock); 588 + steam->serial_no[0] = 0; 499 589 } 500 590 } 501 591 ··· 632 600 mutex_lock(&steam->mutex); 633 601 steam->client_opened = true; 634 602 mutex_unlock(&steam->mutex); 603 + 604 + steam_input_unregister(steam); 605 + 635 606 return ret; 636 607 } 637 608 ··· 644 609 645 610 mutex_lock(&steam->mutex); 646 611 steam->client_opened = false; 647 - if (steam->input_opened) 648 - steam_set_lizard_mode(steam, false); 649 - else 650 - steam_set_lizard_mode(steam, lizard_mode); 651 612 mutex_unlock(&steam->mutex); 652 613 653 614 hid_hw_close(steam->hdev); 615 + if (steam->connected) { 616 + steam_set_lizard_mode(steam, lizard_mode); 617 + steam_input_register(steam); 618 + } 654 619 } 655 620 656 621 static int steam_client_ll_raw_request(struct hid_device *hdev, ··· 779 744 } 780 745 } 781 746 782 - mutex_lock(&steam_devices_lock); 783 - steam_update_lizard_mode(steam); 784 - list_add(&steam->list, &steam_devices); 785 - mutex_unlock(&steam_devices_lock); 786 - 787 747 return 0; 788 748 789 749 hid_hw_open_fail: ··· 804 774 return; 805 775 } 806 776 807 - mutex_lock(&steam_devices_lock); 808 - list_del(&steam->list); 809 - mutex_unlock(&steam_devices_lock); 810 - 811 777 hid_destroy_device(steam->client_hdev); 812 778 steam->client_opened = false; 813 779 cancel_work_sync(&steam->work_connect); ··· 818 792 static void steam_do_connect_event(struct steam_device *steam, bool connected) 819 793 { 820 794 unsigned long flags; 795 + bool changed; 821 796 822 797 spin_lock_irqsave(&steam->lock, flags); 798 + changed = steam->connected != connected; 823 799 steam->connected = connected; 824 800 spin_unlock_irqrestore(&steam->lock, flags); 825 801 826 - if (schedule_work(&steam->work_connect) == 0) 802 + if (changed && schedule_work(&steam->work_connect) == 0) 827 803 dbg_hid("%s: connected=%d event already queued\n", 828 804 __func__, connected); 829 805 } ··· 1047 1019 return 0; 1048 1020 rcu_read_lock(); 1049 1021 input = rcu_dereference(steam->input); 1050 - if (likely(input)) { 1022 + if (likely(input)) 1051 1023 steam_do_input_event(steam, input, data); 1052 - } else { 1053 - dbg_hid("%s: input data without connect event\n", 1054 - __func__); 1055 - steam_do_connect_event(steam, true); 1056 - } 1057 1024 rcu_read_unlock(); 1058 1025 break; 1059 1026 case STEAM_EV_CONNECT: ··· 1097 1074 1098 1075 mutex_lock(&steam_devices_lock); 1099 1076 list_for_each_entry(steam, &steam_devices, list) { 1100 - steam_update_lizard_mode(steam); 1077 + mutex_lock(&steam->mutex); 1078 + if (!steam->client_opened) 1079 + steam_set_lizard_mode(steam, lizard_mode); 1080 + mutex_unlock(&steam->mutex); 1101 1081 } 1102 1082 mutex_unlock(&steam_devices_lock); 1103 1083 return 0;
+2
drivers/hid/i2c-hid/i2c-hid-core.c
··· 177 177 I2C_HID_QUIRK_NO_RUNTIME_PM }, 178 178 { I2C_VENDOR_ID_RAYDIUM, I2C_PRODUCT_ID_RAYDIUM_4B33, 179 179 I2C_HID_QUIRK_DELAY_AFTER_SLEEP }, 180 + { USB_VENDOR_ID_LG, I2C_DEVICE_ID_LG_8001, 181 + I2C_HID_QUIRK_NO_RUNTIME_PM }, 180 182 { 0, 0 } 181 183 }; 182 184
+19 -6
drivers/hid/uhid.c
··· 12 12 13 13 #include <linux/atomic.h> 14 14 #include <linux/compat.h> 15 + #include <linux/cred.h> 15 16 #include <linux/device.h> 16 17 #include <linux/fs.h> 17 18 #include <linux/hid.h> ··· 497 496 goto err_free; 498 497 } 499 498 500 - len = min(sizeof(hid->name), sizeof(ev->u.create2.name)); 501 - strlcpy(hid->name, ev->u.create2.name, len); 502 - len = min(sizeof(hid->phys), sizeof(ev->u.create2.phys)); 503 - strlcpy(hid->phys, ev->u.create2.phys, len); 504 - len = min(sizeof(hid->uniq), sizeof(ev->u.create2.uniq)); 505 - strlcpy(hid->uniq, ev->u.create2.uniq, len); 499 + /* @hid is zero-initialized, strncpy() is correct, strlcpy() not */ 500 + len = min(sizeof(hid->name), sizeof(ev->u.create2.name)) - 1; 501 + strncpy(hid->name, ev->u.create2.name, len); 502 + len = min(sizeof(hid->phys), sizeof(ev->u.create2.phys)) - 1; 503 + strncpy(hid->phys, ev->u.create2.phys, len); 504 + len = min(sizeof(hid->uniq), sizeof(ev->u.create2.uniq)) - 1; 505 + strncpy(hid->uniq, ev->u.create2.uniq, len); 506 506 507 507 hid->ll_driver = &uhid_hid_driver; 508 508 hid->bus = ev->u.create2.bus; ··· 724 722 725 723 switch (uhid->input_buf.type) { 726 724 case UHID_CREATE: 725 + /* 726 + * 'struct uhid_create_req' contains a __user pointer which is 727 + * copied from, so it's unsafe to allow this with elevated 728 + * privileges (e.g. from a setuid binary) or via kernel_write(). 729 + */ 730 + if (file->f_cred != current_cred() || uaccess_kernel()) { 731 + pr_err_once("UHID_CREATE from different security context by process %d (%s), this is not allowed.\n", 732 + task_tgid_vnr(current), current->comm); 733 + ret = -EACCES; 734 + goto unlock; 735 + } 727 736 ret = uhid_dev_create(uhid, &uhid->input_buf); 728 737 break; 729 738 case UHID_CREATE2:
-28
include/linux/hid.h
··· 1139 1139 int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size, 1140 1140 int interrupt); 1141 1141 1142 - 1143 - /** 1144 - * struct hid_scroll_counter - Utility class for processing high-resolution 1145 - * scroll events. 1146 - * @dev: the input device for which events should be reported. 1147 - * @microns_per_hi_res_unit: the amount moved by the user's finger for each 1148 - * high-resolution unit reported by the mouse, in 1149 - * microns. 1150 - * @resolution_multiplier: the wheel's resolution in high-resolution mode as a 1151 - * multiple of its lower resolution. For example, if 1152 - * moving the wheel by one "notch" would result in a 1153 - * value of 1 in low-resolution mode but 8 in 1154 - * high-resolution, the multiplier is 8. 1155 - * @remainder: counts the number of high-resolution units moved since the last 1156 - * low-resolution event (REL_WHEEL or REL_HWHEEL) was sent. Should 1157 - * only be used by class methods. 1158 - */ 1159 - struct hid_scroll_counter { 1160 - struct input_dev *dev; 1161 - int microns_per_hi_res_unit; 1162 - int resolution_multiplier; 1163 - 1164 - int remainder; 1165 - }; 1166 - 1167 - void hid_scroll_counter_handle_scroll(struct hid_scroll_counter *counter, 1168 - int hi_res_value); 1169 - 1170 1142 /* HID quirks API */ 1171 1143 unsigned long hid_lookup_quirk(const struct hid_device *hdev); 1172 1144 int hid_quirks_init(char **quirks_param, __u16 bus, int count);
-10
include/uapi/linux/input-event-codes.h
··· 716 716 * the situation described above. 717 717 */ 718 718 #define REL_RESERVED 0x0a 719 - #define REL_WHEEL_HI_RES 0x0b 720 719 #define REL_MAX 0x0f 721 720 #define REL_CNT (REL_MAX+1) 722 721 ··· 751 752 #define ABS_VOLUME 0x20 752 753 753 754 #define ABS_MISC 0x28 754 - 755 - /* 756 - * 0x2e is reserved and should not be used in input drivers. 757 - * It was used by HID as ABS_MISC+6 and userspace needs to detect if 758 - * the next ABS_* event is correct or is just ABS_MISC + n. 759 - * We define here ABS_RESERVED so userspace can rely on it and detect 760 - * the situation described above. 761 - */ 762 - #define ABS_RESERVED 0x2e 763 755 764 756 #define ABS_MT_SLOT 0x2f /* MT slot being modified */ 765 757 #define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */