All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] Expose firmware name to identify tablets in libwacom
@ 2024-03-22  9:59 José Expósito
  2024-03-22  9:59 ` [PATCH v2 1/1] HID: uclogic: Expose firmware name José Expósito
  0 siblings, 1 reply; 3+ messages in thread
From: José Expósito @ 2024-03-22  9:59 UTC (permalink / raw)
  To: jikos
  Cc: benjamin.tissoires, linux-input, linux-kernel, José Expósito

Hi everyone,

This patch exposes the UCLogic tablets firmware name to user userspace.

libwacom can use it to identify this family of tablets, which has been
very difficult until now because vendor keep reusing the same VIP/PID.

This is the PR consuming the new interface:
https://github.com/linuxwacom/libwacom/pull/620

Finally, I created a tool to generate a list of firmware name <-> table
model for UCLogic-like drawing tablets:
https://github.com/JoseExposito/uclogic-firmware-names

Best wishes,
José Expósito

v1 -> v2:
Store the fw name in hid->uniq instead of using sysfs.
Thanks to Benjamin for his review!

José Expósito (1):
  HID: uclogic: Expose firmware name

 drivers/hid/hid-uclogic-params.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.44.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2 1/1] HID: uclogic: Expose firmware name
  2024-03-22  9:59 [PATCH v2 0/1] Expose firmware name to identify tablets in libwacom José Expósito
@ 2024-03-22  9:59 ` José Expósito
  2024-04-03 11:51   ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: José Expósito @ 2024-03-22  9:59 UTC (permalink / raw)
  To: jikos
  Cc: benjamin.tissoires, linux-input, linux-kernel, José Expósito

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 <jose.exposito89@gmail.com>
---
 drivers/hid/hid-uclogic-params.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c
index 9859dad36495..5bab006ec165 100644
--- a/drivers/hid/hid-uclogic-params.c
+++ b/drivers/hid/hid-uclogic-params.c
@@ -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,
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 1/1] HID: uclogic: Expose firmware name
  2024-03-22  9:59 ` [PATCH v2 1/1] HID: uclogic: Expose firmware name José Expósito
@ 2024-04-03 11:51   ` Jiri Kosina
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2024-04-03 11:51 UTC (permalink / raw)
  To: José Expósito; +Cc: benjamin.tissoires, linux-input, linux-kernel

On Fri, 22 Mar 2024, José Expósito wrote:

> 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 <jose.exposito89@gmail.com>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-03 11:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-22  9:59 [PATCH v2 0/1] Expose firmware name to identify tablets in libwacom José Expósito
2024-03-22  9:59 ` [PATCH v2 1/1] HID: uclogic: Expose firmware name José Expósito
2024-04-03 11:51   ` Jiri Kosina

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.