Skip to content

Commit

Permalink
HID: uclogic: Expose firmware name
Browse files Browse the repository at this point in the history
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: linuxwacom/libwacom#609  [1]
Link: linuxwacom/libwacom#610  [2]
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
  • Loading branch information
JoseExposito authored and Jiri Kosina committed Apr 3, 2024
1 parent 3e78a6c commit a721b14
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/hid/hid-uclogic-params.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,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,
Expand Down

0 comments on commit a721b14

Please sign in to comment.