Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uclogic XP-Pen Aritst 22HD all over again #133

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hid-ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#define USB_DEVICE_ID_UCLOGIC_WIRELESS_TABLET_TWHL850 0x0522
#define USB_DEVICE_ID_UCLOGIC_TABLET_TWHA60 0x0781
#define USB_DEVICE_ID_UCLOGIC_DRAWIMAGE_G3 0x3031
#define USB_DEVICE_ID_UCLOGIC_XPPEN_ARTIST_22HD 0x0047 //that's the added one for xppen artist 22

#define USB_DEVICE_ID_UCLOGIC_UGEE_TABLET_81 0x0081
#define USB_DEVICE_ID_UCLOGIC_UGEE_TABLET_45 0x0045
Expand Down
6 changes: 5 additions & 1 deletion hid-uclogic-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc,
break;
}
break;
case USB_DEVICE_ID_UCLOGIC_XPPEN_ARTIST_22HD:
rdesc = uclogic_rdesc_xppen_artist22HD_arr;
*rsize = uclogic_rdesc_xppen_artist22HD_size;
break;
}

return rdesc;
Expand Down Expand Up @@ -430,7 +434,7 @@ static int uclogic_probe(struct hid_device *hdev,
* than the pen, so use QUIRK_MULTI_INPUT for all tablets.
*/
hdev->quirks |= HID_QUIRK_MULTI_INPUT;
hdev->quirks |= HID_QUIRK_NO_EMPTY_INPUT;
/* hdev->quirks |= HID_QUIRK_NO_EMPTY_INPUT; */

/* Allocate and assign driver data */
drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL);
Expand Down
95 changes: 95 additions & 0 deletions hid-uclogic-rdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,3 +717,98 @@ const __u8 uclogic_rdesc_buttonpad_arr[] = {
const size_t uclogic_rdesc_buttonpad_size =
sizeof(uclogic_rdesc_buttonpad_arr);

/* fixed uclogic xppen artist 22HD report descriptor (old interface 1) */
__u8 uclogic_rdesc_xppen_artist22HD_arr[] = {
0x05, 0x01, /* Usage Page (Desktop), */
0x09, 0x02, /* Usage (Mouse), */
0xA1, 0x01, /* Collection (Application), */
0x09, 0x01, /* Usage (Pointer), */
0xA1, 0x00, /* Collection (Physical), */
0x85, 0x01, /* Report ID (1), */
0x05, 0x09, /* Usage Page (Button), */
0x19, 0x01, /* Usage Minimum (01h), */
0x29, 0x05, /* Usage Maximum (05h), */
0x95, 0x05, /* Report Count (5), */
0x75, 0x01, /* Report Size (1), */
0x15, 0x00, /* Logical Minimum (0), */
0x25, 0x01, /* Logical Maximum (1), */
0x81, 0x02, /* Input (Variable), */
0x95, 0x03, /* Report Count (3), */
0x81, 0x01, /* Input (Constant), */
0x05, 0x01, /* Usage Page (Desktop), */
0x09, 0x30, /* Usage (X), */
0x09, 0x31, /* Usage (Y), */
0x95, 0x02, /* Report Count (2), */
0x75, 0x10, /* Report Size (16), */
0x16, 0x00, 0x80, /* Logical Minimum (-32768), */
0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */
0x81, 0x06, /* Input (Variable, Relative), */
0x09, 0x38, /* Usage (Wheel), */
0x15, 0x81, /* Logical Minimum (-127), */
0x25, 0x7F, /* Logical Maximum (127), */
0x95, 0x01, /* Report Count (1), */
0x75, 0x08, /* Report Size (8), */
0x81, 0x06, /* Input (Variable, Relative), */
0x05, 0x0C, /* Usage Page (Consumer), */
0x0A, 0x38, 0x02, /* Usage (AC Pan), */
0x95, 0x01, /* Report Count (1), */
0x75, 0x08, /* Report Size (8), */
0x81, 0x06, /* Input (Variable, Relative), */
0xC0, /* End Collection, */
0xC0, /* End Collection, */
0x06, 0x01, 0xFF, /* Usage Page (FF01h), */
0x09, 0x00, /* Usage (00h), */
0xA1, 0x01, /* Collection (Application), */
0x85, 0x08, /* Report ID (8), */
0x15, 0x00, /* Logical Minimum (0), */
0x26, 0xFF, 0x00, /* Logical Maximum (255), */
0x09, 0x00, /* Usage (00h), */
0x75, 0x08, /* Report Size (8), */
0x95, 0x05, /* Report Count (5), */
0xB1, 0x02, /* Feature (Variable), */
0xC0, /* End Collection, */
0x05, 0x0D, /* Usage Page (Digitizer), */
0x09, 0x02, /* Usage (Pen), */
0xA1, 0x01, /* Collection (Application), */
0x85, 0x0A, /* Report ID (10), */
0x09, 0x20, /* Usage (Stylus), */
0xA1, 0x00, /* Collection (Physical), */
0x09, 0x42, /* Usage (Tip Switch), */
0x09, 0x44, /* Usage (Barrel Switch), */
0x09, 0x45, /* Usage (Eraser), */
0x09, 0x3C, /* Usage (Invert), */
0x09, 0x43, /* Usage (Secondary Tip Switch), */
0x09, 0x44, /* Usage (Barrel Switch), */
0x15, 0x00, /* Logical Minimum (0), */
0x25, 0x01, /* Logical Maximum (1), */
0x75, 0x01, /* Report Size (1), */
0x95, 0x06, /* Report Count (6), */
0x81, 0x02, /* Input (Variable), */
0x09, 0x32, /* Usage (In Range), */
0x75, 0x01, /* Report Size (1), */
0x95, 0x01, /* Report Count (1), */
0x81, 0x02, /* Input (Variable), */
0x81, 0x03, /* Input (Constant, Variable), */
0x05, 0x01, /* Usage Page (Desktop), */
0x09, 0x30, /* Usage (X), */
0x09, 0x31, /* Usage (Y), */
0x55, 0x0D, /* Unit Exponent (13), */
0x65, 0x33, /* Unit (Inch^3), */
0x26, 0x00, 0x08, /* Logical Maximum (2048), */
0x35, 0x00, /* Physical Minimum (0), */
0x46, 0x00, 0x08, /* Physical Maximum (2048), */
0x75, 0x10, /* Report Size (16), */
0x95, 0x02, /* Report Count (2), */
0x81, 0x02, /* Input (Variable), */
0x05, 0x0D, /* Usage Page (Digitizer), */
0x09, 0x30, /* Usage (Tip Pressure), */
0x26, 0xFF, 0x07, /* Logical Maximum (2047), */
0x75, 0x10, /* Report Size (16), */
0x95, 0x01, /* Report Count (1), */
0x81, 0x02, /* Input (Variable), */
0xC0, /* End Collection, */
0xC0 /* End Collection */
};

const size_t uclogic_rdesc_xppen_artist22HD_size =
sizeof(uclogic_rdesc_xppen_artist22HD_arr);
4 changes: 4 additions & 0 deletions hid-uclogic-rdesc.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,8 @@ extern const size_t uclogic_rdesc_ugee_ex07_template_size;
extern const __u8 uclogic_rdesc_buttonpad_arr[];
extern const size_t uclogic_rdesc_buttonpad_size;

/* Report descriptor for the XP pen artist 22HD */
extern __u8 uclogic_rdesc_xppen_artist22HD_arr[];
extern const size_t uclogic_rdesc_xppen_artist22HD_size;

#endif /* _HID_UCLOGIC_RDESC_H */