Skip to content

Commit 79b95d7

Browse files
committed
Merge tag 'hid-for-linus-2026010801' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Pull HID fixes from Jiri Kosina: - build fix for HID-BPF (Benjamin Tissoires) - fix for potential buffer overflow in i2c-hid (Kwok Kin Ming) - a couple of selftests/hid fixes (Peter Hutterer) - fix for handling pressure pads in hid-multitouch (Peter Hutterer) - fix for potential NULL pointer dereference in intel-thc-hid (Even Xu) - fix for interrupt delay control in intel-thc-hid (Even Xu) - fix finger release detection on some VTL-class touchpads (DaytonCL) - fix for correct enumeration on intel-ish-hid systems with no sensors (Zhang Lixu) - assorted device ID additions and device-specific quirks * tag 'hid-for-linus-2026010801' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (21 commits) HID: logitech: add HID++ support for Logitech MX Anywhere 3S HID: Elecom: Add support for ELECOM M-XT3DRBK (018C) HID: quirks: work around VID/PID conflict for appledisplay HID: Apply quirk HID_QUIRK_ALWAYS_POLL to Edifier QR30 (2d99:a101) HID: i2c-hid: fix potential buffer overflow in i2c_hid_get_report() selftests/hid: add a test for the Digitizer/Button Type pressurepad selftests/hid: use a enum class for the different button types selftests/hid: require hidtools 0.12 HID: multitouch: set INPUT_PROP_PRESSUREPAD based on Digitizer/Button Type HID: quirks: Add another Chicony HP 5MP Cameras to hid_ignore_list HID: Intel-thc-hid: Intel-thc: Add safety check for reading DMA buffer hid: intel-thc-hid: Select SGL_ALLOC selftests/hid: fix bpf compilations due to -fms-extensions HID: bpf: fix bpf compilation with -fms-extensions HID: Intel-thc-hid: Intel-thc: Fix wrong register reading HID: multitouch: add MT_QUIRK_STICKY_FINGERS to MT_CLS_VTL HID: intel-ish-hid: Reset enum_devices_done before enumeration HID: intel-ish-hid: Update ishtp bus match to support device ID table HID: Intel-thc-hid: Intel-thc: fix dma_unmap_sg() nents value HID: playstation: Center initial joystick axes to prevent spurious events ...
2 parents 108b661 + d7f6629 commit 79b95d7

18 files changed

Lines changed: 160 additions & 26 deletions

File tree

drivers/hid/bpf/progs/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ clean:
5656

5757
%.bpf.o: %.bpf.c vmlinux.h $(BPFOBJ) | $(OUTPUT)
5858
$(call msg,BPF,$@)
59-
$(Q)$(CLANG) -g -O2 --target=bpf -Wall -Werror $(INCLUDES) \
60-
-c $(filter %.c,$^) -o $@ && \
59+
$(Q)$(CLANG) -g -O2 --target=bpf -Wall -Werror $(INCLUDES) \
60+
-Wno-microsoft-anon-tag \
61+
-fms-extensions \
62+
-c $(filter %.c,$^) -o $@ && \
6163
$(LLVM_STRIP) -g $@
6264

6365
vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL) | $(INCLUDE_DIR)

drivers/hid/hid-elecom.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static const __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
7777
break;
7878
case USB_DEVICE_ID_ELECOM_M_XT3URBK_00FB:
7979
case USB_DEVICE_ID_ELECOM_M_XT3URBK_018F:
80-
case USB_DEVICE_ID_ELECOM_M_XT3DRBK:
80+
case USB_DEVICE_ID_ELECOM_M_XT3DRBK_00FC:
8181
case USB_DEVICE_ID_ELECOM_M_XT4DRBK:
8282
/*
8383
* Report descriptor format:
@@ -102,6 +102,16 @@ static const __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
102102
*/
103103
mouse_button_fixup(hdev, rdesc, *rsize, 12, 30, 14, 20, 8);
104104
break;
105+
case USB_DEVICE_ID_ELECOM_M_XT3DRBK_018C:
106+
/*
107+
* Report descriptor format:
108+
* 22: button bit count
109+
* 30: padding bit count
110+
* 24: button report size
111+
* 16: button usage maximum
112+
*/
113+
mouse_button_fixup(hdev, rdesc, *rsize, 22, 30, 24, 16, 6);
114+
break;
105115
case USB_DEVICE_ID_ELECOM_M_DT2DRBK:
106116
case USB_DEVICE_ID_ELECOM_M_HT1DRBK_011C:
107117
/*
@@ -122,7 +132,8 @@ static const struct hid_device_id elecom_devices[] = {
122132
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XGL20DLBK) },
123133
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK_00FB) },
124134
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK_018F) },
125-
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK) },
135+
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK_00FC) },
136+
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK_018C) },
126137
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT4DRBK) },
127138
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) },
128139
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1DRBK) },

drivers/hid/hid-ids.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@
317317
#define USB_DEVICE_ID_CHICONY_ACER_SWITCH12 0x1421
318318
#define USB_DEVICE_ID_CHICONY_HP_5MP_CAMERA 0xb824
319319
#define USB_DEVICE_ID_CHICONY_HP_5MP_CAMERA2 0xb82c
320+
#define USB_DEVICE_ID_CHICONY_HP_5MP_CAMERA3 0xb882
320321

321322
#define USB_VENDOR_ID_CHUNGHWAT 0x2247
322323
#define USB_DEVICE_ID_CHUNGHWAT_MULTITOUCH 0x0001
@@ -438,6 +439,9 @@
438439
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_A001 0xa001
439440
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_C002 0xc002
440441

442+
#define USB_VENDOR_ID_EDIFIER 0x2d99
443+
#define USB_DEVICE_ID_EDIFIER_QR30 0xa101 /* EDIFIER Hal0 2.0 SE */
444+
441445
#define USB_VENDOR_ID_ELAN 0x04f3
442446
#define USB_DEVICE_ID_TOSHIBA_CLICK_L9W 0x0401
443447
#define USB_DEVICE_ID_HP_X2 0x074d
@@ -451,7 +455,8 @@
451455
#define USB_DEVICE_ID_ELECOM_M_XGL20DLBK 0x00e6
452456
#define USB_DEVICE_ID_ELECOM_M_XT3URBK_00FB 0x00fb
453457
#define USB_DEVICE_ID_ELECOM_M_XT3URBK_018F 0x018f
454-
#define USB_DEVICE_ID_ELECOM_M_XT3DRBK 0x00fc
458+
#define USB_DEVICE_ID_ELECOM_M_XT3DRBK_00FC 0x00fc
459+
#define USB_DEVICE_ID_ELECOM_M_XT3DRBK_018C 0x018c
455460
#define USB_DEVICE_ID_ELECOM_M_XT4DRBK 0x00fd
456461
#define USB_DEVICE_ID_ELECOM_M_DT1URBK 0x00fe
457462
#define USB_DEVICE_ID_ELECOM_M_DT1DRBK 0x00ff

drivers/hid/hid-logitech-hidpp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4662,6 +4662,8 @@ static const struct hid_device_id hidpp_devices[] = {
46624662
HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb025) },
46634663
{ /* MX Master 3S mouse over Bluetooth */
46644664
HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb034) },
4665+
{ /* MX Anywhere 3S mouse over Bluetooth */
4666+
HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb037) },
46654667
{ /* MX Anywhere 3SB mouse over Bluetooth */
46664668
HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb038) },
46674669
{}

drivers/hid/hid-multitouch.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ MODULE_LICENSE("GPL");
8181
#define MT_INPUTMODE_TOUCHPAD 0x03
8282

8383
#define MT_BUTTONTYPE_CLICKPAD 0
84+
#define MT_BUTTONTYPE_PRESSUREPAD 1
8485

8586
enum latency_mode {
8687
HID_LATENCY_NORMAL = 0,
@@ -179,6 +180,7 @@ struct mt_device {
179180
__u8 inputmode_value; /* InputMode HID feature value */
180181
__u8 maxcontacts;
181182
bool is_buttonpad; /* is this device a button pad? */
183+
bool is_pressurepad; /* is this device a pressurepad? */
182184
bool is_haptic_touchpad; /* is this device a haptic touchpad? */
183185
bool serial_maybe; /* need to check for serial protocol */
184186

@@ -393,6 +395,7 @@ static const struct mt_class mt_classes[] = {
393395
{ .name = MT_CLS_VTL,
394396
.quirks = MT_QUIRK_ALWAYS_VALID |
395397
MT_QUIRK_CONTACT_CNT_ACCURATE |
398+
MT_QUIRK_STICKY_FINGERS |
396399
MT_QUIRK_FORCE_GET_FEATURE,
397400
},
398401
{ .name = MT_CLS_GOOGLE,
@@ -530,8 +533,14 @@ static void mt_feature_mapping(struct hid_device *hdev,
530533
}
531534

532535
mt_get_feature(hdev, field->report);
533-
if (field->value[usage->usage_index] == MT_BUTTONTYPE_CLICKPAD)
536+
switch (field->value[usage->usage_index]) {
537+
case MT_BUTTONTYPE_CLICKPAD:
534538
td->is_buttonpad = true;
539+
break;
540+
case MT_BUTTONTYPE_PRESSUREPAD:
541+
td->is_pressurepad = true;
542+
break;
543+
}
535544

536545
break;
537546
case 0xff0000c5:
@@ -1393,6 +1402,8 @@ static int mt_touch_input_configured(struct hid_device *hdev,
13931402

13941403
if (td->is_buttonpad)
13951404
__set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
1405+
if (td->is_pressurepad)
1406+
__set_bit(INPUT_PROP_PRESSUREPAD, input->propbit);
13961407

13971408
app->pending_palm_slots = devm_kcalloc(&hi->input->dev,
13981409
BITS_TO_LONGS(td->maxcontacts),

drivers/hid/hid-playstation.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,11 +753,16 @@ ps_gamepad_create(struct hid_device *hdev,
753753
if (IS_ERR(gamepad))
754754
return ERR_CAST(gamepad);
755755

756+
/* Set initial resting state for joysticks to 128 (center) */
756757
input_set_abs_params(gamepad, ABS_X, 0, 255, 0, 0);
758+
gamepad->absinfo[ABS_X].value = 128;
757759
input_set_abs_params(gamepad, ABS_Y, 0, 255, 0, 0);
760+
gamepad->absinfo[ABS_Y].value = 128;
758761
input_set_abs_params(gamepad, ABS_Z, 0, 255, 0, 0);
759762
input_set_abs_params(gamepad, ABS_RX, 0, 255, 0, 0);
763+
gamepad->absinfo[ABS_RX].value = 128;
760764
input_set_abs_params(gamepad, ABS_RY, 0, 255, 0, 0);
765+
gamepad->absinfo[ABS_RY].value = 128;
761766
input_set_abs_params(gamepad, ABS_RZ, 0, 255, 0, 0);
762767

763768
input_set_abs_params(gamepad, ABS_HAT0X, -1, 1, 0, 0);

drivers/hid/hid-quirks.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ static const struct hid_device_id hid_quirks[] = {
8181
{ HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_PS3), HID_QUIRK_MULTI_INPUT },
8282
{ HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_WIIU), HID_QUIRK_MULTI_INPUT },
8383
{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER), HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET },
84+
{ HID_USB_DEVICE(USB_VENDOR_ID_EDIFIER, USB_DEVICE_ID_EDIFIER_QR30), HID_QUIRK_ALWAYS_POLL },
8485
{ HID_USB_DEVICE(USB_VENDOR_ID_ELAN, HID_ANY_ID), HID_QUIRK_ALWAYS_POLL },
8586
{ HID_USB_DEVICE(USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700), HID_QUIRK_NOGET },
8687
{ HID_USB_DEVICE(USB_VENDOR_ID_EMS, USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II), HID_QUIRK_MULTI_INPUT },
@@ -232,6 +233,15 @@ static const struct hid_device_id hid_quirks[] = {
232233
* used as a driver. See hid_scan_report().
233234
*/
234235
static const struct hid_device_id hid_have_special_driver[] = {
236+
#if IS_ENABLED(CONFIG_APPLEDISPLAY)
237+
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, 0x9218) },
238+
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, 0x9219) },
239+
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, 0x921c) },
240+
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, 0x921d) },
241+
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, 0x9222) },
242+
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, 0x9226) },
243+
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, 0x9236) },
244+
#endif
235245
#if IS_ENABLED(CONFIG_HID_A4TECH)
236246
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) },
237247
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) },
@@ -412,7 +422,8 @@ static const struct hid_device_id hid_have_special_driver[] = {
412422
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XGL20DLBK) },
413423
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK_00FB) },
414424
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK_018F) },
415-
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK) },
425+
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK_00FC) },
426+
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK_018C) },
416427
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT4DRBK) },
417428
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) },
418429
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1DRBK) },
@@ -769,6 +780,7 @@ static const struct hid_device_id hid_ignore_list[] = {
769780
{ HID_USB_DEVICE(USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD) },
770781
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_HP_5MP_CAMERA) },
771782
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_HP_5MP_CAMERA2) },
783+
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_HP_5MP_CAMERA3) },
772784
{ HID_USB_DEVICE(USB_VENDOR_ID_CIDC, 0x0103) },
773785
{ HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI470X) },
774786
{ HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI4713) },

drivers/hid/i2c-hid/i2c-hid-core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ static int i2c_hid_get_report(struct i2c_hid *ihid,
286286
* In addition to report data device will supply data length
287287
* in the first 2 bytes of the response, so adjust .
288288
*/
289+
recv_len = min(recv_len, ihid->bufsize - sizeof(__le16));
289290
error = i2c_hid_xfer(ihid, ihid->cmdbuf, length,
290291
ihid->rawbuf, recv_len + sizeof(__le16));
291292
if (error) {

drivers/hid/intel-ish-hid/ishtp-hid-client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ static int ishtp_enum_enum_devices(struct ishtp_cl *hid_ishtp_cl)
495495
int rv;
496496

497497
/* Send HOSTIF_DM_ENUM_DEVICES */
498+
client_data->enum_devices_done = false;
498499
memset(&msg, 0, sizeof(struct hostif_msg));
499500
msg.hdr.command = HOSTIF_DM_ENUM_DEVICES;
500501
rv = ishtp_cl_send(hid_ishtp_cl, (unsigned char *)&msg,

drivers/hid/intel-ish-hid/ishtp/bus.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,17 @@ static int ishtp_cl_bus_match(struct device *dev, const struct device_driver *dr
240240
{
241241
struct ishtp_cl_device *device = to_ishtp_cl_device(dev);
242242
struct ishtp_cl_driver *driver = to_ishtp_cl_driver(drv);
243+
struct ishtp_fw_client *client = device->fw_client;
244+
const struct ishtp_device_id *id;
243245

244-
return(device->fw_client ? guid_equal(&driver->id[0].guid,
245-
&device->fw_client->props.protocol_name) : 0);
246+
if (client) {
247+
for (id = driver->id; !guid_is_null(&id->guid); id++) {
248+
if (guid_equal(&id->guid, &client->props.protocol_name))
249+
return 1;
250+
}
251+
}
252+
253+
return 0;
246254
}
247255

248256
/**

0 commit comments

Comments
 (0)