From: Daniel Schaefer <dhs@frame.work>
To: linux-input@vger.kernel.org
Cc: Daniel Schaefer <dhs@frame.work>,
Maximilian Luz <luzmaximilian@gmail.com>,
Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <bentiss@kernel.org>
Subject: [PATCH 3/4] HID: surface: Use device version instead of HID spec version
Date: Sat, 14 Mar 2026 01:56:58 +0800 [thread overview]
Message-ID: <20260313175659.268094-4-dhs@frame.work> (raw)
In-Reply-To: <20260313175659.268094-1-dhs@frame.work>
Use attrs.version instead of hid_desc.hid_version for hid->version.
The driver has two structures with version information:
- hid_desc.hid_version: HID specification version
- attrs.version: Device-specific version number
The current code incorrectly uses hid_version from the HID descriptor,
which reports the HID spec version rather than the actual device
version. This change aligns with how other HID drivers report device
version and matches the attrs structure which already provides vendor
and product IDs.
Cc: Maximilian Luz <luzmaximilian@gmail.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <bentiss@kernel.org>
Cc: linux-input@vger.kernel.org
Signed-off-by: Daniel Schaefer <dhs@frame.work>
---
drivers/hid/surface-hid/surface_hid_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/surface-hid/surface_hid_core.c b/drivers/hid/surface-hid/surface_hid_core.c
index 6690c24f28f0..e31d6597bc9b 100644
--- a/drivers/hid/surface-hid/surface_hid_core.c
+++ b/drivers/hid/surface-hid/surface_hid_core.c
@@ -206,7 +206,7 @@ int surface_hid_device_add(struct surface_hid_device *shid)
shid->hid->bus = BUS_HOST;
shid->hid->vendor = get_unaligned_le16(&shid->attrs.vendor);
shid->hid->product = get_unaligned_le16(&shid->attrs.product);
- shid->hid->version = get_unaligned_le16(&shid->hid_desc.hid_version);
+ shid->hid->version = get_unaligned_le16(&shid->attrs.version);
shid->hid->country = shid->hid_desc.country_code;
snprintf(shid->hid->name, sizeof(shid->hid->name), "Microsoft Surface %04X:%04X",
--
2.52.0
next prev parent reply other threads:[~2026-03-13 17:57 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 ` Daniel Schaefer [this message]
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
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=20260313175659.268094-4-dhs@frame.work \
--to=dhs@frame.work \
--cc=bentiss@kernel.org \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=luzmaximilian@gmail.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