Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH 1/2] HID: core: include product version in the uevent
@ 2026-11-26 15:39 Matteo Bruni
  2026-11-26 15:39 ` [PATCH 2/2] samples: uhid: use a non-zero version Matteo Bruni
  2026-11-26 15:50 ` [PATCH 1/2] HID: core: include product version in the uevent sashiko-bot
  0 siblings, 2 replies; 5+ messages in thread
From: Matteo Bruni @ 2026-11-26 15:39 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, David Rheinsberg; +Cc: linux-input

Currently userspace can't really recover the device version for UHID
devices. Compared to e.g. a USB game controller, starting from the HID
device, one can recover the version from the PRODUCT uevent of the
parent USB node; there's no such parent for a UHID device.

This is going to be used by Wine, to be able to report the HID device
version for UHID devices. You can find the corresponding Wine patch at
https://gitlab.winehq.org/Mystral/wine/-/commit/5c2d90f7a4d13c92b10b5c4d82171d22951ea32b

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
---
 drivers/hid/hid-core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 4a47deb9d..918db22e8 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -3004,6 +3004,10 @@ static int hid_uevent(const struct device *dev, struct kobj_uevent_env *env)
 			return -ENOMEM;
 	}
 
+	if (add_uevent_var(env, "PRODUCT=%x/%x/%x/%x",
+			   hdev->bus, hdev->vendor, hdev->product, hdev->version))
+		return -ENOMEM;
+
 	return 0;
 }
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-27 12:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 15:39 [PATCH 1/2] HID: core: include product version in the uevent Matteo Bruni
2026-11-26 15:39 ` [PATCH 2/2] samples: uhid: use a non-zero version Matteo Bruni
2026-11-26 15:43   ` sashiko-bot
2026-11-26 15:50 ` [PATCH 1/2] HID: core: include product version in the uevent sashiko-bot
2026-11-27 12:46   ` Matteo Bruni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox