Skip to content

Commit

Permalink
HID: uclogic: Add support for XP-PEN Deco LW
Browse files Browse the repository at this point in the history
The XP-PEN Deco LW is a UGEE v2 device with a frame with 8 buttons.
Its pen has 2 buttons, supports tilt and pressure.

It can be connected by USB cable or using a USB Bluetooth dongle to use
it in wireless mode. When it is connected using the dongle, the device
battery is used to power it.

Its 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.

Link: DIGImend/digimend-kernel-drivers#635
Tested-by: Mia Kanashi <chad@redpilled.dev>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
  • Loading branch information
JoseExposito committed Oct 16, 2022
1 parent 432b28f commit 31dfe7f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/hid/hid-uclogic-params.c
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,20 @@ static bool uclogic_params_ugee_v2_has_battery(struct hid_device *hdev)
{
struct uclogic_drvdata *drvdata = hid_get_drvdata(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 *product_name = "Deco LW";

if (strncmp(udev->product, product_name, strlen(product_name)) == 0)
return true;
}

if (drvdata->quirks & UCLOGIC_BATTERY_QUIRK)
return true;

Expand Down

0 comments on commit 31dfe7f

Please sign in to comment.