From: Matteo Bruni <mbruni@codeweavers.com>
To: Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <bentiss@kernel.org>,
David Rheinsberg <david@readahead.eu>
Cc: linux-input@vger.kernel.org
Subject: [PATCH 1/2] HID: core: include product version in the uevent
Date: Thu, 26 Nov 2026 16:39:24 +0100 [thread overview]
Message-ID: <20261126153925.9488-1-mbruni@codeweavers.com> (raw)
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
next reply other threads:[~2026-11-26 15:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 15:39 Matteo Bruni [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261126153925.9488-1-mbruni@codeweavers.com \
--to=mbruni@codeweavers.com \
--cc=bentiss@kernel.org \
--cc=david@readahead.eu \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox