From 21319740756b7f6127f505000f57d74626466cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Fri, 22 Mar 2024 10:31:36 +0100 Subject: [PATCH] HID: uclogic: Expose firmware name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some vendors reuse the same product ID for different tablets, making it difficult for userspace to figure out which table is connected. While matching the device name has been used in the past by userspace to workaround this limitation, some devices have shown that this is not always a valid approach [1]. However, if userspace could access the firmware version name, it would be possible to know which tablet is actually connected by matching it against a list of known firmware names [2]. This patch exposes the firmware version name in the hid->uniq field. Link: https://github.com/linuxwacom/libwacom/issues/609 [1] Link: https://github.com/linuxwacom/libwacom/issues/610 [2] Signed-off-by: José Expósito --- hid-uclogic-params.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hid-uclogic-params.c b/hid-uclogic-params.c index 4acf318..daa7d27 100644 --- a/hid-uclogic-params.c +++ b/hid-uclogic-params.c @@ -882,6 +882,9 @@ static int uclogic_params_huion_init(struct uclogic_params *params, goto cleanup; } + /* The firmware is used in userspace as unique identifier */ + strscpy(hdev->uniq, ver_ptr, sizeof(hdev->uniq)); + /* If this is a transition firmware */ if (strcmp(ver_ptr, transition_ver) == 0) { hid_dbg(hdev,