public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Daniel Schaefer <dhs@frame.work>, linux-input@vger.kernel.org
Cc: Richard Hughes <richard@hughsie.com>,
	Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <bentiss@kernel.org>,
	linux@frame.work
Subject: Re: [PATCH 4/4] HID: core: Export device version via HID_FIRMWARE_VERSION uevent
Date: Fri, 13 Mar 2026 12:59:59 -0500	[thread overview]
Message-ID: <6b53a537-9989-4b34-b033-402773c871be@amd.com> (raw)
In-Reply-To: <20260313175659.268094-5-dhs@frame.work>



On 3/13/2026 12:56 PM, Daniel Schaefer wrote:
> Expose the HID device version to userspace via the new
> HID_FIRMWARE_VERSION uevent property. This enables userspace tools
> (such as fwupd and hidapi) to retrieve device firmware version
> information, providing parity with Windows HidD_GetAttributes() API
> which returns VID, PID, and VersionNumber.
> 
> The version is exported as a 4-digit uppercase hexadecimal value
> (e.g., "0100" for version 1.0), consistent with how USB devices
> report bcdDevice.
> 
> fwupd can handle this since:
> https://github.com/fwupd/fwupd/commit/fb0d4cc98abe253003ea0e1837277fd42971e0de
> But the kernel hasn't yet exposed this.
> 
> hidapi patch is in-flight: https://github.com/libusb/hidapi/pull/777
> 
> Cc: Richard Hughes <richard@hughsie.com>
> Cc: Mario Limonciello <mario.limonciello@amd.com>
> Cc: Jiri Kosina <jikos@kernel.org>
> Cc: Benjamin Tissoires <bentiss@kernel.org>
> Cc: linux@frame.work
> Signed-off-by: Daniel Schaefer <dhs@frame.work>
> ---
>   drivers/hid/hid-core.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index da57cbf0af26..c2075d5b40c3 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -2884,6 +2884,9 @@ static int hid_uevent(const struct device *dev, struct kobj_uevent_env *env)
>   	if (add_uevent_var(env, "HID_UNIQ=%s", hdev->uniq))
>   		return -ENOMEM;
>   
> +	if (add_uevent_var(env, "HID_FIRMWARE_VERSION=%04X", hdev->version))
> +		return -ENOMEM;
> +
>   	if (add_uevent_var(env, "MODALIAS=hid:b%04Xg%04Xv%08Xp%08X",
>   			   hdev->bus, hdev->group, hdev->vendor, hdev->product))
>   		return -ENOMEM;

Isn't this in

hid.git#for-7.1/lenovo-v2

  reply	other threads:[~2026-03-13 18:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13 17:56 [PATCH 0/4] HID: Use wVersionID for device version Daniel Schaefer
2026-03-13 17:56 ` [PATCH 1/4] HID: i2c-hid: " Daniel Schaefer
2026-03-13 17:56 ` [PATCH 2/4] HID: goodix-spi: Use version_id " Daniel Schaefer
2026-03-13 17:56 ` [PATCH 3/4] HID: surface: Use device version instead of HID spec version Daniel Schaefer
2026-03-13 17:56 ` [PATCH 4/4] HID: core: Export device version via HID_FIRMWARE_VERSION uevent Daniel Schaefer
2026-03-13 17:59   ` Mario Limonciello [this message]
2026-03-13 18:20     ` Daniel Schaefer

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=6b53a537-9989-4b34-b033-402773c871be@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=bentiss@kernel.org \
    --cc=dhs@frame.work \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux@frame.work \
    --cc=richard@hughsie.com \
    /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