Skip to content

XPPen Deco01 v2 support #375

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions hid-ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@
#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_G640 0x0094
#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01 0x0042
#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01_V2 0x0905

#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_L 0x0935
#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_M 0x0936
#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_PRO_MW 0x0934
#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_PRO_S 0x0909
#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_PRO_SW 0x0933

#define USB_DEVICE_ID_UGEE_XPPEN_TABLET_STAR06 0x0078
#define USB_DEVICE_ID_UGEE_TABLET_G5 0x0074
#define USB_DEVICE_ID_UGEE_TABLET_EX07S 0x0071
Expand Down
29 changes: 27 additions & 2 deletions hid-uclogic-params.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ static int uclogic_params_pen_init_v1(struct uclogic_params_pen *pen,
desc_params[UCLOGIC_RDESC_PEN_PH_ID_Y_LM] * 1000 /
resolution;
}

kfree(buf);
buf = NULL;

Expand Down Expand Up @@ -1799,10 +1800,34 @@ int uclogic_params_init(struct uclogic_params *params,
uclogic_params_init_invalid(&p);
}
break;
case VID_PID(USB_VENDOR_ID_UGEE,
USB_DEVICE_ID_UGEE_PARBLO_A610_PRO):
case VID_PID(USB_VENDOR_ID_UGEE,
USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01_V2):
switch (bInterfaceNumber) {
case 0: // Keyboard
rc = uclogic_params_frame_init_with_desc(
&p.frame_list[0],
uclogic_rdesc_xppen_deco01v2_fixed0_arr,
uclogic_rdesc_xppen_deco01v2_fixed0_size,
0);
if (rc != 0)
goto cleanup;
break;
case 1: // Tablet
rc = uclogic_params_frame_init_with_desc(
&p.frame_list[1],
uclogic_rdesc_xppen_deco01v2_fixed1_arr,
uclogic_rdesc_xppen_deco01v2_fixed1_size,
0);
if (rc != 0)
goto cleanup;
break;
case 2: //What is this interface?
uclogic_params_init_invalid(&p);
break;
}
break;
case VID_PID(USB_VENDOR_ID_UGEE,
USB_DEVICE_ID_UGEE_PARBLO_A610_PRO):
case VID_PID(USB_VENDOR_ID_UGEE,
USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_L):
case VID_PID(USB_VENDOR_ID_UGEE,
Expand Down
94 changes: 93 additions & 1 deletion hid-uclogic-rdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1196,10 +1196,102 @@ const __u8 uclogic_rdesc_xppen_deco01_frame_arr[] = {
0xC0, /* End Collection, */
0xC0 /* End Collection */
};

const size_t uclogic_rdesc_xppen_deco01_frame_size =
sizeof(uclogic_rdesc_xppen_deco01_frame_arr);

/* Ignore everything but keyboard */


__u8 uclogic_rdesc_xppen_deco01v2_fixed0_arr[] = {
0x05, 0x01, /* Usage Page (Desktop), */
0x09, 0x06, /* Usage (Keyboard), */
0xA1, 0x01, /* Collection (Application), */
0x85, 0x06, /* Report ID (6), */
0x05, 0x07, /* Usage Page (Keyboard), */
0x19, 0xE0, /* Usage Minimum (KB Leftcontrol), */
0x29, 0xE7, /* Usage Maximum (KB Right GUI), */
0x15, 0x00, /* Logical Minimum (0), */
0x25, 0x01, /* Logical Maximum (1), */
0x75, 0x01, /* Report Size (1), */
0x95, 0x08, /* Report Count (8), */
0x81, 0x02, /* Input (Variable), */

/* Changed from 0-255 to 16-127, otherwise seems to break dimensions??? */
0x05, 0x07, /* Usage Page (Keyboard), */
0x19, 0x10, /* Usage Minimum (None), */
0x29, 0x7F, /* Usage Maximum (FFh), */
// 0x19, 0x0, /* Usage Minimum (None), */
// 0x29, 0xFF, /* Usage Maximum (FFh), */

0x26, 0xFF, 0x00, /* Logical Maximum (255), */
0x75, 0x08, /* Report Size (8), */
0x95, 0x06, /* Report Count (6), */
0x81, 0x00, /* Input, */

0xC0 /* End Collection */
};
const size_t uclogic_rdesc_xppen_deco01v2_fixed0_size =
sizeof(uclogic_rdesc_xppen_deco01v2_fixed0_arr);

__u8 uclogic_rdesc_xppen_deco01v2_fixed1_arr[] = {
0x05, 0x0D, /* Usage Page (Digitizer), */
0x09, 0x02, /* Usage (Digitizer), */
0xA1, 0x01, /* Collection (Application), */
0x85, 0x07, /* Report ID (7), */
0x09, 0x20, /* Usage (Stylus), */
0xA1, 0x00, /* Collection (Physical), */
0x09, 0x42, /* Usage (Tip Switch), */
0x09, 0x44, /* Usage (Barrel Switch), */
0x09, 0x45, /* Usage (Eraser), */
0x15, 0x00, /* Logical Minimum (0), */
0x25, 0x01, /* Logical Maximum (1), */
0x75, 0x01, /* Report Size (1), */
0x95, 0x03, /* Report Count (3), */
0x81, 0x02, /* Input (Variable), */
0x95, 0x02, /* Report Count (2), */
0x81, 0x03, /* Input (Constant, Variable), */
0x09, 0x32, /* Usage (In Range), */
0x95, 0x01, /* Report Count (1), */
0x81, 0x02, /* Input (Variable), */
0x95, 0x02, /* Report Count (2), */
0x81, 0x03, /* Input (Constant, Variable), */
0x75, 0x10, /* Report Size (16), */
0x95, 0x01, /* Report Count (1), */
0x35, 0x00, /* Physical Minimum (0), */
0xA4, /* Push, */
0x05, 0x01, /* Usage Page (Desktop), */
0x09, 0x30, /* Usage (X), */
0x65, 0x13, /* Unit (Inch), */
//Changed to -3
0x55, 0xFD, /* Unit Exponent (-3), */
0x46, 0x10, 0x27, /* Physical Maximum (10000), */
0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */
0x81, 0x02, /* Input (Variable), */
0x09, 0x31, /* Usage (Y), */
0x46, 0x6A, 0x18, /* Physical Maximum (6250), */
0x26, 0xFF, 0x7F, /* Logical Maximum (32767), */
0x81, 0x02, /* Input (Variable), */
0xB4, /* Pop, */
0x09, 0x30, /* Usage (Tip Pressure), */
0x45, 0x00, /* Physical Maximum (0), */
0x26, 0xFF, 0x1F, /* Logical Maximum (8191), */
0x81, 0x42, /* Input (Variable, Null State), */
0x09, 0x3D, /* Usage (X Tilt), */
0x15, 0x81, /* Logical Minimum (-127), */
0x25, 0x7F, /* Logical Maximum (127), */
0x75, 0x08, /* Report Size (8), */
0x95, 0x01, /* Report Count (1), */
0x81, 0x02, /* Input (Variable), */
0x09, 0x3E, /* Usage (Y Tilt), */
0x15, 0x81, /* Logical Minimum (-127), */
0x25, 0x7F, /* Logical Maximum (127), */
0x81, 0x02, /* Input (Variable), */
0xC0, /* End Collection, */
0xC0 /* End Collection */
};
const size_t uclogic_rdesc_xppen_deco01v2_fixed1_size =
sizeof(uclogic_rdesc_xppen_deco01v2_fixed1_arr);

/**
* uclogic_rdesc_template_apply() - apply report descriptor parameters to a
* report descriptor template, creating a report descriptor. Copies the
Expand Down
7 changes: 7 additions & 0 deletions hid-uclogic-rdesc.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@ extern const size_t uclogic_rdesc_ugee_ex07_frame_size;
extern const __u8 uclogic_rdesc_xppen_deco01_frame_arr[];
extern const size_t uclogic_rdesc_xppen_deco01_frame_size;

/* XP-Pen Deco 01 v2 frame controls */
extern __u8 uclogic_rdesc_xppen_deco01v2_fixed0_arr[];
extern const size_t uclogic_rdesc_xppen_deco01v2_fixed0_size;

extern __u8 uclogic_rdesc_xppen_deco01v2_fixed1_arr[];
extern const size_t uclogic_rdesc_xppen_deco01v2_fixed1_size;

/* Fixed report descriptor for Ugee G5 frame controls */
extern const __u8 uclogic_rdesc_ugee_g5_frame_arr[];
extern const size_t uclogic_rdesc_ugee_g5_frame_size;
Expand Down
2 changes: 1 addition & 1 deletion xorg.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ EndSection

Section "InputClass"
Identifier "Ugee/XP-Pen tablets with Wacom driver"
MatchUSBID "28bd:007[1458]|28bd:0094|28bd:0042|5543:004[57a]|5543:0081|5543:0004|5543:3031"
MatchUSBID "28bd:007[1458]|28bd:0094|28bd:0042|28bd:0905|5543:004[57a]|5543:0081|5543:0004|5543:3031"
MatchDevicePath "/dev/input/event*"
Driver "wacom"
EndSection
Expand Down