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 tag 'hid-for-linus-2025111901' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid

Pull HID fixes from Jiri Kosina:

- memory leak fixes in hid-uclogic, hid-ntrig and hid-playstation
drivers (Abdun Nihaal, Masami Ichikawa)

- regression fix for playback handling in hid-pidff (Tomasz Pakuła)

- initialization fix for some amd_sfh platforms (Mario Limonciello)

- a few assorted device-specific ID additions and quirks

* tag 'hid-for-linus-2025111901' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
HID: uclogic: Fix potential memory leak in error path
HID: playstation: Fix memory leak in dualshock4_get_calibration_data()
HID: pidff: Fix needs_playback check
HID: corsair-void: Use %pe for printing PTR_ERR
HID: elecom: Add support for ELECOM M-XT3URBK (018F)
HID: hid-input: Extend Elan ignore battery quirk to USB
HID: hid-ntrig: Prevent memory leak in ntrig_report_version()
HID: amd_sfh: Stop sensor before starting
HID: apple: Add SONiX AK870 PRO to non_apple_keyboards quirk list
HID: lenovo: fixup Lenovo Yoga Slim 7x Keyboard rdesc
HID: quirks: work around VID/PID conflict for 0x4c4a/0x4155

+57 -20
+2
drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c
··· 194 194 if (rc) 195 195 goto cleanup; 196 196 197 + mp2_ops->stop(privdata, cl_data->sensor_idx[i]); 198 + amd_sfh_wait_for_response(privdata, cl_data->sensor_idx[i], DISABLE_SENSOR); 197 199 writel(0, privdata->mmio + amd_get_p2c_val(privdata, 0)); 198 200 mp2_ops->start(privdata, info); 199 201 status = amd_sfh_wait_for_response
+1
drivers/hid/hid-apple.c
··· 355 355 356 356 static const struct apple_non_apple_keyboard non_apple_keyboards[] = { 357 357 { "SONiX USB DEVICE" }, 358 + { "SONiX AK870 PRO" }, 358 359 { "Keychron" }, 359 360 { "AONE" }, 360 361 { "GANSS" },
+2 -3
drivers/hid/hid-corsair-void.c
··· 553 553 554 554 if (IS_ERR(new_supply)) { 555 555 hid_err(drvdata->hid_dev, 556 - "failed to register battery '%s' (reason: %ld)\n", 557 - drvdata->battery_desc.name, 558 - PTR_ERR(new_supply)); 556 + "failed to register battery '%s' (reason: %pe)\n", 557 + drvdata->battery_desc.name, new_supply); 559 558 return; 560 559 } 561 560
+4 -2
drivers/hid/hid-elecom.c
··· 75 75 */ 76 76 mouse_button_fixup(hdev, rdesc, *rsize, 20, 28, 22, 14, 8); 77 77 break; 78 - case USB_DEVICE_ID_ELECOM_M_XT3URBK: 78 + case USB_DEVICE_ID_ELECOM_M_XT3URBK_00FB: 79 + case USB_DEVICE_ID_ELECOM_M_XT3URBK_018F: 79 80 case USB_DEVICE_ID_ELECOM_M_XT3DRBK: 80 81 case USB_DEVICE_ID_ELECOM_M_XT4DRBK: 81 82 /* ··· 120 119 static const struct hid_device_id elecom_devices[] = { 121 120 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) }, 122 121 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XGL20DLBK) }, 123 - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK) }, 122 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK_00FB) }, 123 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK_018F) }, 124 124 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK) }, 125 125 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT4DRBK) }, 126 126 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) },
+5 -3
drivers/hid/hid-ids.h
··· 449 449 #define USB_VENDOR_ID_ELECOM 0x056e 450 450 #define USB_DEVICE_ID_ELECOM_BM084 0x0061 451 451 #define USB_DEVICE_ID_ELECOM_M_XGL20DLBK 0x00e6 452 - #define USB_DEVICE_ID_ELECOM_M_XT3URBK 0x00fb 452 + #define USB_DEVICE_ID_ELECOM_M_XT3URBK_00FB 0x00fb 453 + #define USB_DEVICE_ID_ELECOM_M_XT3URBK_018F 0x018f 453 454 #define USB_DEVICE_ID_ELECOM_M_XT3DRBK 0x00fc 454 455 #define USB_DEVICE_ID_ELECOM_M_XT4DRBK 0x00fd 455 456 #define USB_DEVICE_ID_ELECOM_M_DT1URBK 0x00fe ··· 719 718 #define USB_DEVICE_ID_ITE_LENOVO_YOGA2 0x8350 720 719 #define I2C_DEVICE_ID_ITE_LENOVO_LEGION_Y720 0x837a 721 720 #define USB_DEVICE_ID_ITE_LENOVO_YOGA900 0x8396 721 + #define I2C_DEVICE_ID_ITE_LENOVO_YOGA_SLIM_7X_KEYBOARD 0x8987 722 722 #define USB_DEVICE_ID_ITE8595 0x8595 723 723 #define USB_DEVICE_ID_ITE_MEDION_E1239T 0xce50 724 724 ··· 1545 1543 #define USB_VENDOR_ID_SIGNOTEC 0x2133 1546 1544 #define USB_DEVICE_ID_SIGNOTEC_VIEWSONIC_PD1011 0x0018 1547 1545 1548 - #define USB_VENDOR_ID_SMARTLINKTECHNOLOGY 0x4c4a 1549 - #define USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155 0x4155 1546 + #define USB_VENDOR_ID_JIELI_SDK_DEFAULT 0x4c4a 1547 + #define USB_DEVICE_ID_JIELI_SDK_4155 0x4155 1550 1548 1551 1549 #endif
+3 -2
drivers/hid/hid-input.c
··· 399 399 { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_CHROMEBOOK_TROGDOR_POMPOM), 400 400 HID_BATTERY_QUIRK_AVOID_QUERY }, 401 401 /* 402 - * Elan I2C-HID touchscreens seem to all report a non present battery, 403 - * set HID_BATTERY_QUIRK_IGNORE for all Elan I2C-HID devices. 402 + * Elan HID touchscreens seem to all report a non present battery, 403 + * set HID_BATTERY_QUIRK_IGNORE for all Elan I2C and USB HID devices. 404 404 */ 405 405 { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, HID_ANY_ID), HID_BATTERY_QUIRK_IGNORE }, 406 + { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, HID_ANY_ID), HID_BATTERY_QUIRK_IGNORE }, 406 407 {} 407 408 }; 408 409
+17
drivers/hid/hid-lenovo.c
··· 148 148 0x81, 0x01, /* Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position) */ 149 149 }; 150 150 151 + static const __u8 lenovo_yoga7x_kbd_need_fixup_collection[] = { 152 + 0x15, 0x00, // Logical Minimum (0) 153 + 0x25, 0x65, // Logical Maximum (101) 154 + 0x05, 0x07, // Usage Page (Keyboard) 155 + 0x19, 0x00, // Usage Minimum (0) 156 + 0x29, 0xDD, // Usage Maximum (221) 157 + }; 158 + 151 159 static const __u8 *lenovo_report_fixup(struct hid_device *hdev, __u8 *rdesc, 152 160 unsigned int *rsize) 153 161 { ··· 183 175 rdesc[256] = 0x01; /* report count = 0x01 */ 184 176 rdesc[258] = 0x00; /* input = 0x00 */ 185 177 rdesc[260] = 0x01; /* report count (2) = 0x01 */ 178 + } 179 + break; 180 + case I2C_DEVICE_ID_ITE_LENOVO_YOGA_SLIM_7X_KEYBOARD: 181 + if (*rsize == 176 && 182 + memcmp(&rdesc[52], lenovo_yoga7x_kbd_need_fixup_collection, 183 + sizeof(lenovo_yoga7x_kbd_need_fixup_collection)) == 0) { 184 + rdesc[55] = rdesc[61]; // logical maximum = usage maximum 186 185 } 187 186 break; 188 187 } ··· 1553 1538 USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X12_TAB) }, 1554 1539 { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, 1555 1540 USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X12_TAB2) }, 1541 + { HID_DEVICE(BUS_I2C, HID_GROUP_GENERIC, 1542 + USB_VENDOR_ID_ITE, I2C_DEVICE_ID_ITE_LENOVO_YOGA_SLIM_7X_KEYBOARD) }, 1556 1543 { } 1557 1544 }; 1558 1545
+2 -5
drivers/hid/hid-ntrig.c
··· 142 142 int ret; 143 143 char buf[20]; 144 144 struct usb_device *usb_dev = hid_to_usb_dev(hdev); 145 - unsigned char *data = kmalloc(8, GFP_KERNEL); 145 + unsigned char *data __free(kfree) = kmalloc(8, GFP_KERNEL); 146 146 147 147 if (!hid_is_usb(hdev)) 148 148 return; 149 149 150 150 if (!data) 151 - goto err_free; 151 + return; 152 152 153 153 ret = usb_control_msg(usb_dev, usb_rcvctrlpipe(usb_dev, 0), 154 154 USB_REQ_CLEAR_FEATURE, ··· 163 163 hid_info(hdev, "Firmware version: %s (%02x%02x %02x%02x)\n", 164 164 buf, data[2], data[3], data[4], data[5]); 165 165 } 166 - 167 - err_free: 168 - kfree(data); 169 166 } 170 167 171 168 static ssize_t show_phys_width(struct device *dev,
+2
drivers/hid/hid-playstation.c
··· 1942 1942 "Failed to retrieve DualShock4 calibration info: %d\n", 1943 1943 ret); 1944 1944 ret = -EILSEQ; 1945 + kfree(buf); 1945 1946 goto transfer_failed; 1946 1947 } else { 1947 1948 break; ··· 1960 1959 1961 1960 if (ret) { 1962 1961 hid_warn(hdev, "Failed to retrieve DualShock4 calibration info: %d\n", ret); 1962 + kfree(buf); 1963 1963 goto transfer_failed; 1964 1964 } 1965 1965 }
+14 -2
drivers/hid/hid-quirks.c
··· 410 410 #if IS_ENABLED(CONFIG_HID_ELECOM) 411 411 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) }, 412 412 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XGL20DLBK) }, 413 - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK) }, 413 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK_00FB) }, 414 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK_018F) }, 414 415 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK) }, 415 416 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT4DRBK) }, 416 417 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) }, ··· 916 915 #endif 917 916 { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) }, 918 917 { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_HP_5MP_CAMERA_5473) }, 919 - { HID_USB_DEVICE(USB_VENDOR_ID_SMARTLINKTECHNOLOGY, USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155) }, 920 918 { } 921 919 }; 922 920 ··· 1063 1063 if (!strncmp(hdev->name, elan_acpi_id[i].id, 1064 1064 strlen(elan_acpi_id[i].id))) 1065 1065 return true; 1066 + break; 1067 + case USB_VENDOR_ID_JIELI_SDK_DEFAULT: 1068 + /* 1069 + * Multiple USB devices with identical IDs (mic & touchscreen). 1070 + * The touch screen requires hid core processing, but the 1071 + * microphone does not. They can be distinguished by manufacturer 1072 + * and serial number. 1073 + */ 1074 + if (hdev->product == USB_DEVICE_ID_JIELI_SDK_4155 && 1075 + strncmp(hdev->name, "SmartlinkTechnology", 19) == 0 && 1076 + strncmp(hdev->uniq, "20201111000001", 14) == 0) 1077 + return true; 1066 1078 break; 1067 1079 } 1068 1080
+3 -1
drivers/hid/hid-uclogic-params.c
··· 1369 1369 event_hook->hdev = hdev; 1370 1370 event_hook->size = ARRAY_SIZE(reconnect_event); 1371 1371 event_hook->event = kmemdup(reconnect_event, event_hook->size, GFP_KERNEL); 1372 - if (!event_hook->event) 1372 + if (!event_hook->event) { 1373 + kfree(event_hook); 1373 1374 return -ENOMEM; 1375 + } 1374 1376 1375 1377 list_add_tail(&event_hook->list, &p->event_hooks->list); 1376 1378
+2 -2
drivers/hid/usbhid/hid-pidff.c
··· 806 806 807 807 static int pidff_needs_playback(struct pidff_device *pidff, int effect_id, int n) 808 808 { 809 - return pidff->effect[effect_id].is_infinite || 810 - pidff->effect[effect_id].loop_count != n; 809 + return !pidff->effect[effect_id].is_infinite || 810 + pidff->effect[effect_id].loop_count != n; 811 811 } 812 812 813 813 /*