Skip to contentSkip to conversation

HID: intel-thc-hid: Set HID_PHYS with PCI BDF

PATCH Applied Daniel Schaefer 3 participants 3 messages Mar 13 – Mar 16

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: intel-thc-hid: Set HID_PHYS with PCI BDF

Currently HID_PHYS is empty, which means userspace tools (e.g. fwupd) that depend on it for distinguishing the devices, are unable to do so. Other drivers like i2c-hid, usbhid, surface-hid, all populate it.

With this change it's set to, for example: HID_PHYS=0000:00:10.0

Each function has just a single HID device, as far as I can tell, so there is no need to add a suffix.

Tested with fwupd 2.1.1, can avoid https://github.com/fwupd/fwupd/pull/9995

Cc Even Xu <[email protected]>
Cc Xinpeng Sun <[email protected]>
Cc Jiri Kosina <[email protected]>
Cc Benjamin Tissoires <[email protected]>
Cc Sakari Ailus <[email protected]>
---
 drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c | 1 +
 drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c | 1 +
 2 files changed, 2 insertions(+)
drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c +1 -0
index f9fcb398673b..8075992e8732 100644
@@ -127,6 +127,7 @@ int quicki2c_hid_probe(struct quicki2c_device *qcdev)
 	hid->product = le16_to_cpu(qcdev->dev_desc.product_id);
 	snprintf(hid->name, sizeof(hid->name), "%s %04X:%04X", "quicki2c-hid",
 		 hid->vendor, hid->product);
+	strscpy(hid->phys, dev_name(qcdev->dev), sizeof(hid->phys));
 
 	ret = hid_add_device(hid);
 	if (ret) {
drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c +1 -0
index 82c72bfa2795..91d5807b4a83 100644
@@ -118,6 +118,7 @@ int quickspi_hid_probe(struct quickspi_device *qsdev)
 	hid->product = le16_to_cpu(qsdev->dev_desc.product_id);
 	snprintf(hid->name, sizeof(hid->name), "%s %04X:%04X", "quickspi-hid",
 		 hid->vendor, hid->product);
+	strscpy(hid->phys, dev_name(qsdev->dev), sizeof(hid->phys));
 
 	ret = hid_add_device(hid);
 	if (ret) {
Signature · 1 line
2.52.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 52 lines

-----Original Message-----
From: Daniel Schaefer <[email protected]>
Sent: Friday, March 13, 2026 9:39 PM
To: [email protected]
Cc: Daniel Schaefer <[email protected]>; Xu, Even <[email protected]>; Sun, Xinpeng <[email protected]>; Jiri Kosina <[email protected]>; Benjamin Tissoires <[email protected]>; Sakari Ailus <[email protected]>
Subject: [PATCH] HID: intel-thc-hid: Set HID_PHYS with PCI BDF

Currently HID_PHYS is empty, which means userspace tools (e.g. fwupd) that depend on it for distinguishing the devices, are unable to do so. Other drivers like i2c-hid, usbhid, surface-hid, all populate it.

With this change it's set to, for example: HID_PHYS=0000:00:10.0

Each function has just a single HID device, as far as I can tell, so there is no need to add a suffix.

Tested with fwupd 2.1.1, can avoid https://github.com/fwupd/fwupd/pull/9995

Cc Even Xu <[email protected]>
Cc Xinpeng Sun <[email protected]>
Cc Jiri Kosina <[email protected]>
Cc Benjamin Tissoires <[email protected]>
Cc Sakari Ailus <[email protected]>

---
drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c | 1 + drivers/hid/intel-thc-
hid/intel-quickspi/quickspi-hid.c | 1 +

 2 files changed, 2 insertions(+)
drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c +1 -0
index f9fcb398673b..8075992e8732 100644
@@ -127,6 +127,7 @@ int quicki2c_hid_probe(struct quicki2c_device *qcdev)
 	hid->product = le16_to_cpu(qcdev->dev_desc.product_id);
 	snprintf(hid->name, sizeof(hid->name), "%s %04X:%04X", "quicki2c-hid",
 		 hid->vendor, hid->product);
+	strscpy(hid->phys, dev_name(qcdev->dev), sizeof(hid->phys));
 
 	ret = hid_add_device(hid);
 	if (ret) {
drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c +0 -0
index 82c72bfa2795..91d5807b4a83 100644

drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c int quickspi_hid_probe(struct quickspi_device *qsdev) · line 121

Quoted 4 lines
drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c +1 -0
@@ -118,6 +118,7 @@ int quickspi_hid_probe(struct quickspi_device *qsdev)
 	hid->product = le16_to_cpu(qsdev->dev_desc.product_id);
 	snprintf(hid->name, sizeof(hid->name), "%s %04X:%04X", "quickspi-hid",
 		 hid->vendor, hid->product);
+	strscpy(hid->phys, dev_name(qsdev->dev), sizeof(hid->phys));

Thanks for the patch!

Quoted 5 lines
drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c +0 -1
 	ret = hid_add_device(hid);
 	if (ret) {
--

2.52.0

maintainer Applied
#2 lore raw
In reply to Daniel Schaefer
Quoted 9 lines · Daniel Schaefer

Currently HID_PHYS is empty, which means userspace tools (e.g. fwupd) that depend on it for distinguishing the devices, are unable to do so. Other drivers like i2c-hid, usbhid, surface-hid, all populate it.

With this change it's set to, for example: HID_PHYS=0000:00:10.0

Each function has just a single HID device, as far as I can tell, so there is no need to add a suffix.

Quoted 8 lines

Tested with fwupd 2.1.1, can avoid https://github.com/fwupd/fwupd/pull/9995

Cc Even Xu <[email protected]>
Cc Xinpeng Sun <[email protected]>
Cc Jiri Kosina <[email protected]>
Cc Benjamin Tissoires <[email protected]>
Cc Sakari Ailus <[email protected]>

Applied to hid.git#for-7.0/upstream-fixes, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs