[PATCH 2/2] HID: uclogic: Report stylus invert state for UGEE v2 devices

From: Bartosz Barc

Date: Mon Oct 05 2026 - 20:39:55 EST


From: Bartosz Paweł Barc <bpbarc@xxxxxxxxx>

Captured raw reports from the XP-Pen Artist 12 (2nd Gen) show that the
first of the two bits immediately after Tip Switch, Barrel Switch,
Tablet Pick (one that is currently declared as padding) is set whenever
the stylus is flipped to the eraser end, and otherwise is set to zero:

hovering, nib: 1010 0000
pressing, nib: 1010 0001
hovering, eraser: 1010 1000
pressing, eraser: 1010 1001

Declare that bit as Usage (Invert) from the Digitizer page, which already
gets mapped to BTN_TOOL_RUBBER.

This field is part of the shared uclogic_rdesc_ugee_v2_pen_template_arr
template used by multiple devices. As this change only reclaims a
padding bit, it should not affect devices that do not support this
feature, assuming their hardware leaves that bit as a zero. I have only
tested this with the XP-Pen Artist 12 (2nd Gen), so further testing with
other UGEE v2 devices would be appreciated.

Signed-off-by: Bartosz Paweł Barc <bpbarc@xxxxxxxxx>
---
drivers/hid/hid-uclogic-rdesc.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/hid/hid-uclogic-rdesc.c b/drivers/hid/hid-uclogic-rdesc.c
index a1b31511b625..186beca6a26a 100644
--- a/drivers/hid/hid-uclogic-rdesc.c
+++ b/drivers/hid/hid-uclogic-rdesc.c
@@ -878,13 +878,14 @@ const __u8 uclogic_rdesc_ugee_v2_pen_template_arr[] = {
0x09, 0x42, /* Usage (Tip Switch), */
0x09, 0x44, /* Usage (Barrel Switch), */
0x09, 0x46, /* Usage (Tablet Pick), */
+ 0x09, 0x3c, /* Usage (Invert), */
0x75, 0x01, /* Report Size (1), */
- 0x95, 0x03, /* Report Count (3), */
+ 0x95, 0x04, /* Report Count (4), */
0x14, /* Logical Minimum (0), */
0x25, 0x01, /* Logical Maximum (1), */
0x81, 0x02, /* Input (Variable), */
- 0x95, 0x02, /* Report Count (2), */
- 0x81, 0x03, /* Input (Constant, Variable), */
+ 0x95, 0x01, /* Report Count (1), */
+ 0x81, 0x03, /* Input (Constant), */
0x09, 0x32, /* Usage (In Range), */
0x95, 0x01, /* Report Count (1), */
0x81, 0x02, /* Input (Variable), */
--
2.56.0