Skip to content

Commit 842427d

Browse files
committed
uclogic: Add support for XP-Pen Deco 01 frame controls
1 parent 4a0c4fc commit 842427d

3 files changed

Lines changed: 67 additions & 2 deletions

File tree

hid-uclogic-params.c

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,8 +1031,6 @@ int uclogic_params_probe(struct uclogic_params **pparams,
10311031
USB_DEVICE_ID_UGTIZER_TABLET_GP0610):
10321032
case VID_PID(USB_VENDOR_ID_UGEE,
10331033
USB_DEVICE_ID_UGEE_XPPEN_TABLET_G540):
1034-
case VID_PID(USB_VENDOR_ID_UGEE,
1035-
USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01):
10361034
/* If this is the pen interface */
10371035
if (bInterfaceNumber == 1) {
10381036
rc = uclogic_params_pen_v1_probe(&pen, hdev);
@@ -1052,6 +1050,34 @@ int uclogic_params_probe(struct uclogic_params **pparams,
10521050
}
10531051
}
10541052
break;
1053+
case VID_PID(USB_VENDOR_ID_UGEE,
1054+
USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01):
1055+
/* If this is the pen and frame interface */
1056+
if (bInterfaceNumber == 1) {
1057+
rc = uclogic_params_pen_v1_probe(&pen, hdev);
1058+
if (rc != 0) {
1059+
hid_err(hdev, "pen probing failed: %d\n", rc);
1060+
goto cleanup;
1061+
}
1062+
rc = uclogic_params_frame_from_desc(
1063+
&frame,
1064+
uclogic_rdesc_xppen_deco01_frame_arr,
1065+
uclogic_rdesc_xppen_deco01_frame_size);
1066+
if (rc != 0) {
1067+
goto cleanup;
1068+
}
1069+
rc = uclogic_params_from_pen_and_frame(
1070+
&params, pen, frame, 0, 0);
1071+
if (rc != 0) {
1072+
goto cleanup;
1073+
}
1074+
} else {
1075+
rc = uclogic_params_with_pen_unused(&params);
1076+
if (rc != 0) {
1077+
goto cleanup;
1078+
}
1079+
}
1080+
break;
10551081
case VID_PID(USB_VENDOR_ID_UGEE,
10561082
USB_DEVICE_ID_UGEE_TABLET_G5):
10571083
/* Ignore non-pen interfaces */

hid-uclogic-rdesc.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,41 @@ const __u8 uclogic_rdesc_ugee_g5_frame_arr[] = {
781781
const size_t uclogic_rdesc_ugee_g5_frame_size =
782782
sizeof(uclogic_rdesc_ugee_g5_frame_arr);
783783

784+
/* Fixed report descriptor for XP-Pen Deco 01 frame controls */
785+
const __u8 uclogic_rdesc_xppen_deco01_frame_arr[] = {
786+
0x05, 0x01, /* Usage Page (Desktop), */
787+
0x09, 0x07, /* Usage (Keypad), */
788+
0xA1, 0x01, /* Collection (Application), */
789+
0x85, 0x06, /* Report ID (6), */
790+
0x14, /* Logical Minimum (0), */
791+
0x25, 0x01, /* Logical Maximum (1), */
792+
0x75, 0x01, /* Report Size (1), */
793+
0x05, 0x0D, /* Usage Page (Digitizer), */
794+
0x09, 0x39, /* Usage (Tablet Function Keys), */
795+
0xA0, /* Collection (Physical), */
796+
0x05, 0x09, /* Usage Page (Button), */
797+
0x19, 0x01, /* Usage Minimum (01h), */
798+
0x29, 0x08, /* Usage Maximum (08h), */
799+
0x95, 0x08, /* Report Count (8), */
800+
0x81, 0x02, /* Input (Variable), */
801+
0x05, 0x0D, /* Usage Page (Digitizer), */
802+
0x09, 0x44, /* Usage (Barrel Switch), */
803+
0x95, 0x01, /* Report Count (1), */
804+
0x81, 0x02, /* Input (Variable), */
805+
0x05, 0x01, /* Usage Page (Desktop), */
806+
0x09, 0x30, /* Usage (X), */
807+
0x09, 0x31, /* Usage (Y), */
808+
0x95, 0x02, /* Report Count (2), */
809+
0x81, 0x02, /* Input (Variable), */
810+
0x95, 0x15, /* Report Count (21), */
811+
0x81, 0x01, /* Input (Constant), */
812+
0xC0, /* End Collection, */
813+
0xC0 /* End Collection */
814+
};
815+
816+
const size_t uclogic_rdesc_xppen_deco01_frame_size =
817+
sizeof(uclogic_rdesc_xppen_deco01_frame_arr);
818+
784819
/**
785820
* uclogic_rdesc_template_apply() - apply report descriptor parameters to a
786821
* report descriptor template, creating a report descriptor. Copies the

hid-uclogic-rdesc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ extern const size_t uclogic_rdesc_ugee_ex07_buttonpad_size;
138138
extern const __u8 uclogic_rdesc_ugee_g5_frame_arr[];
139139
extern const size_t uclogic_rdesc_ugee_g5_frame_size;
140140

141+
/* Fixed report descriptor for XP-Pen Deco 01 frame controls */
142+
extern const __u8 uclogic_rdesc_xppen_deco01_frame_arr[];
143+
extern const size_t uclogic_rdesc_xppen_deco01_frame_size;
144+
141145
/* Report ID of Ugee G5 frame control reports */
142146
#define UCLOGIC_RDESC_UGEE_G5_FRAME_ID 0x06
143147

0 commit comments

Comments
 (0)