]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: intel-thc-hid: Set HID_PHYS with PCI BDF
authorDaniel Schaefer <git@danielschaefer.me>
Fri, 13 Mar 2026 13:39:25 +0000 (21:39 +0800)
committerJiri Kosina <jkosina@suse.com>
Mon, 16 Mar 2026 10:25:07 +0000 (11:25 +0100)
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 <even.xu@intel.com>
Cc: Xinpeng Sun <xinpeng.sun@intel.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <bentiss@kernel.org>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Daniel Schaefer <git@danielschaefer.me>
Reviewed-by: Even Xu <even.xu@intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-hid.c
drivers/hid/intel-thc-hid/intel-quickspi/quickspi-hid.c

index f9fcb398673b2080b61bcd05aa3f16701040cd88..8075992e8732ef86bf8598e61bdd17116cfbc1ce 100644 (file)
@@ -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) {
index 82c72bfa2795ea8a7b7d42844bec6a69d47ee04f..91d5807b4a8302c1dc4967a38c2054d8edd10d37 100644 (file)
@@ -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) {