Skip to content

Commit 92a214d

Browse files
committed
uclogic: Add support for Huion Q620M
1 parent 3352f47 commit 92a214d

3 files changed

Lines changed: 81 additions & 0 deletions

File tree

hid-uclogic-params.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,24 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
771771
p.frame_list[1].touch_ring_max = 12;
772772
p.frame_list[1].touch_ring_flip_at = 6;
773773

774+
/* Create v2 frame dial parameters */
775+
rc = uclogic_params_frame_init_with_desc(
776+
&p.frame_list[2],
777+
uclogic_rdesc_v2_frame_dial_arr,
778+
uclogic_rdesc_v2_frame_dial_size,
779+
UCLOGIC_RDESC_V2_FRAME_DIAL_ID);
780+
if (rc != 0) {
781+
hid_err(hdev,
782+
"failed creating v2 frame dial "
783+
"parameters: %d\n",
784+
rc);
785+
goto cleanup;
786+
}
787+
p.frame_list[2].suffix = "Dial";
788+
p.frame_list[2].dev_id_byte =
789+
UCLOGIC_RDESC_V2_FRAME_DIAL_DEV_ID_BYTE;
790+
p.frame_list[2].bitmap_dial_byte = 5;
791+
774792
/*
775793
* Link button and touch ring subreports from pen
776794
* reports
@@ -781,6 +799,9 @@ static int uclogic_params_huion_init(struct uclogic_params *params,
781799
p.pen.subreport_list[1].value = 0xf0;
782800
p.pen.subreport_list[1].id =
783801
UCLOGIC_RDESC_V2_FRAME_TOUCH_RING_ID;
802+
p.pen.subreport_list[2].value = 0xf1;
803+
p.pen.subreport_list[2].id =
804+
UCLOGIC_RDESC_V2_FRAME_DIAL_ID;
784805
goto output;
785806
}
786807
hid_dbg(hdev, "pen v2 parameters not found\n");

hid-uclogic-rdesc.c

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,56 @@ const __u8 uclogic_rdesc_v2_frame_touch_ring_arr[] = {
761761
const size_t uclogic_rdesc_v2_frame_touch_ring_size =
762762
sizeof(uclogic_rdesc_v2_frame_touch_ring_arr);
763763

764+
/* Fixed report descriptor for (tweaked) v2 frame dial reports */
765+
const __u8 uclogic_rdesc_v2_frame_dial_arr[] = {
766+
0x05, 0x01, /* Usage Page (Desktop), */
767+
0x09, 0x07, /* Usage (Keypad), */
768+
0xA1, 0x01, /* Collection (Application), */
769+
0x85, UCLOGIC_RDESC_V2_FRAME_DIAL_ID,
770+
/* Report ID (DIAL_ID), */
771+
0x14, /* Logical Minimum (0), */
772+
0x05, 0x0D, /* Usage Page (Digitizer), */
773+
0x09, 0x39, /* Usage (Tablet Function Keys), */
774+
0xA0, /* Collection (Physical), */
775+
0x25, 0x01, /* Logical Maximum (1), */
776+
0x75, 0x01, /* Report Size (1), */
777+
0x95, 0x01, /* Report Count (1), */
778+
0x81, 0x01, /* Input (Constant), */
779+
0x05, 0x09, /* Usage Page (Button), */
780+
0x09, 0x01, /* Usage (01h), */
781+
0x95, 0x01, /* Report Count (1), */
782+
0x81, 0x02, /* Input (Variable), */
783+
0x95, 0x06, /* Report Count (6), */
784+
0x81, 0x01, /* Input (Constant), */
785+
0x75, 0x08, /* Report Size (8), */
786+
0x95, 0x02, /* Report Count (2), */
787+
0x81, 0x01, /* Input (Constant), */
788+
0x05, 0x0D, /* Usage Page (Digitizer), */
789+
0x0A, 0xFF, 0xFF, /* Usage (FFFFh), */
790+
0x26, 0xFF, 0x00, /* Logical Maximum (255), */
791+
0x95, 0x01, /* Report Count (1), */
792+
0x81, 0x02, /* Input (Variable), */
793+
0x05, 0x01, /* Usage Page (Desktop), */
794+
0x09, 0x38, /* Usage (Wheel), */
795+
0x95, 0x01, /* Report Count (1), */
796+
0x15, 0xFF, /* Logical Minimum (-1), */
797+
0x25, 0x01, /* Logical Maximum (1), */
798+
0x81, 0x06, /* Input (Variable, Relative), */
799+
0x09, 0x30, /* Usage (X), */
800+
0x09, 0x31, /* Usage (Y), */
801+
0x14, /* Logical Minimum (0), */
802+
0x25, 0x01, /* Logical Maximum (1), */
803+
0x75, 0x01, /* Report Size (1), */
804+
0x95, 0x02, /* Report Count (2), */
805+
0x81, 0x02, /* Input (Variable), */
806+
0x95, 0x2E, /* Report Count (46), */
807+
0x81, 0x01, /* Input (Constant), */
808+
0xC0, /* End Collection, */
809+
0xC0 /* End Collection */
810+
};
811+
const size_t uclogic_rdesc_v2_frame_dial_size =
812+
sizeof(uclogic_rdesc_v2_frame_dial_arr);
813+
764814
/* Fixed report descriptor for Ugee EX07 frame */
765815
const __u8 uclogic_rdesc_ugee_ex07_frame_arr[] = {
766816
0x05, 0x01, /* Usage Page (Desktop), */

hid-uclogic-rdesc.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,16 @@ extern const size_t uclogic_rdesc_v2_frame_touch_ring_size;
141141
/* Device ID byte offset in v2 frame touch ring reports */
142142
#define UCLOGIC_RDESC_V2_FRAME_TOUCH_RING_DEV_ID_BYTE 0x4
143143

144+
/* Report ID for tweaked v2 frame dial reports */
145+
#define UCLOGIC_RDESC_V2_FRAME_DIAL_ID 0xf9
146+
147+
/* Fixed report descriptor for (tweaked) v2 frame dial reports */
148+
extern const __u8 uclogic_rdesc_v2_frame_dial_arr[];
149+
extern const size_t uclogic_rdesc_v2_frame_dial_size;
150+
151+
/* Device ID byte offset in v2 frame dial reports */
152+
#define UCLOGIC_RDESC_V2_FRAME_DIAL_DEV_ID_BYTE 0x4
153+
144154
/* Fixed report descriptor for Ugee EX07 frame */
145155
extern const __u8 uclogic_rdesc_ugee_ex07_frame_arr[];
146156
extern const size_t uclogic_rdesc_ugee_ex07_frame_size;

0 commit comments

Comments
 (0)