Thread (3 messages) 3 messages, 2 authors, 2022-10-28

Re: [PATCH] HID: uclogic: Add support for XP-PEN Deco LW

From: José Expósito <hidden>
Date: 2022-10-28 08:17:05
Also in: lkml

Hi Barnabás,

Thanks for reviewing the patch.

On Thu, Oct 27, 2022 at 09:32:24PM +0000, Barnabás Pőcze wrote:
Hi


2022. október 27., csütörtök 23:10 keltezéssel, José Expósito írta:
quoted
[...]
+/**
+ * uclogic_params_ugee_v2_has_battery() - check whether a UGEE v2 device has
+ * battery or not.
+ * @hdev:	The HID device of the tablet interface.
+ *
+ * Returns:
+ *	True if the device has battery, false otherwise.
+ */
+static bool uclogic_params_ugee_v2_has_battery(struct hid_device *hdev)
+{
+	/* The XP-PEN Deco LW vendor, product and version are identical to the
+	 * Deco L. The only difference reported by their firmware is the product
+	 * name. Add a quirk to support battery reporting on the wireless
+	 * version.
+	 */
+	if (hdev->vendor == USB_VENDOR_ID_UGEE &&
+	    hdev->product == USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_L) {
+		struct usb_device *udev = hid_to_usb_dev(hdev);
+		const char *lw_name = "Deco LW";
+
+		if (strncmp(udev->product, lw_name, strlen(lw_name)) == 0)
Please use `strstarts()` here instead.
Good point, I'll send v2 in a minute with this change.

Jose
 
quoted
+			return true;
+	}
+
+	return false;
+}
[...]

Regards,
Barnabás Pőcze
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help