Commit | Line | Data |
---|---|---|
ff0c13d6 NK |
1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
2 | /* | |
3 | * HID driver for UC-Logic devices not fully compliant with HID standard | |
4 | * - original and fixed report descriptors | |
5 | * | |
6 | * Copyright (c) 2010-2018 Nikolai Kondrashov | |
7 | * Copyright (c) 2013 Martin Rusko | |
8 | */ | |
9 | ||
10 | /* | |
11 | * This program is free software; you can redistribute it and/or modify it | |
12 | * under the terms of the GNU General Public License as published by the Free | |
13 | * Software Foundation; either version 2 of the License, or (at your option) | |
14 | * any later version. | |
15 | */ | |
16 | ||
17 | #ifndef _HID_UCLOGIC_RDESC_H | |
18 | #define _HID_UCLOGIC_RDESC_H | |
19 | ||
20 | #include <linux/usb.h> | |
21 | ||
22 | /* Size of the original descriptor of WPXXXXU tablets */ | |
23 | #define UCLOGIC_RDESC_WPXXXXU_ORIG_SIZE 212 | |
24 | ||
25 | /* Fixed WP4030U report descriptor */ | |
26 | extern __u8 uclogic_rdesc_wp4030u_fixed_arr[]; | |
27 | extern const size_t uclogic_rdesc_wp4030u_fixed_size; | |
28 | ||
29 | /* Fixed WP5540U report descriptor */ | |
30 | extern __u8 uclogic_rdesc_wp5540u_fixed_arr[]; | |
31 | extern const size_t uclogic_rdesc_wp5540u_fixed_size; | |
32 | ||
33 | /* Fixed WP8060U report descriptor */ | |
34 | extern __u8 uclogic_rdesc_wp8060u_fixed_arr[]; | |
35 | extern const size_t uclogic_rdesc_wp8060u_fixed_size; | |
36 | ||
9c17f735 NK |
37 | /* Size of the original descriptor of the new WP5540U tablet */ |
38 | #define UCLOGIC_RDESC_WP5540U_V2_ORIG_SIZE 232 | |
39 | ||
ff0c13d6 NK |
40 | /* Size of the original descriptor of WP1062 tablet */ |
41 | #define UCLOGIC_RDESC_WP1062_ORIG_SIZE 254 | |
42 | ||
43 | /* Fixed WP1062 report descriptor */ | |
44 | extern __u8 uclogic_rdesc_wp1062_fixed_arr[]; | |
45 | extern const size_t uclogic_rdesc_wp1062_fixed_size; | |
46 | ||
47 | /* Size of the original descriptor of PF1209 tablet */ | |
48 | #define UCLOGIC_RDESC_PF1209_ORIG_SIZE 234 | |
49 | ||
50 | /* Fixed PF1209 report descriptor */ | |
51 | extern __u8 uclogic_rdesc_pf1209_fixed_arr[]; | |
52 | extern const size_t uclogic_rdesc_pf1209_fixed_size; | |
53 | ||
54 | /* Size of the original descriptors of TWHL850 tablet */ | |
55 | #define UCLOGIC_RDESC_TWHL850_ORIG0_SIZE 182 | |
56 | #define UCLOGIC_RDESC_TWHL850_ORIG1_SIZE 161 | |
57 | #define UCLOGIC_RDESC_TWHL850_ORIG2_SIZE 92 | |
58 | ||
59 | /* Fixed PID 0522 tablet report descriptor, interface 0 (stylus) */ | |
60 | extern __u8 uclogic_rdesc_twhl850_fixed0_arr[]; | |
61 | extern const size_t uclogic_rdesc_twhl850_fixed0_size; | |
62 | ||
63 | /* Fixed PID 0522 tablet report descriptor, interface 1 (mouse) */ | |
64 | extern __u8 uclogic_rdesc_twhl850_fixed1_arr[]; | |
65 | extern const size_t uclogic_rdesc_twhl850_fixed1_size; | |
66 | ||
67 | /* Fixed PID 0522 tablet report descriptor, interface 2 (frame buttons) */ | |
68 | extern __u8 uclogic_rdesc_twhl850_fixed2_arr[]; | |
69 | extern const size_t uclogic_rdesc_twhl850_fixed2_size; | |
70 | ||
71 | /* Size of the original descriptors of TWHA60 tablet */ | |
72 | #define UCLOGIC_RDESC_TWHA60_ORIG0_SIZE 254 | |
73 | #define UCLOGIC_RDESC_TWHA60_ORIG1_SIZE 139 | |
74 | ||
75 | /* Fixed TWHA60 report descriptor, interface 0 (stylus) */ | |
76 | extern __u8 uclogic_rdesc_twha60_fixed0_arr[]; | |
77 | extern const size_t uclogic_rdesc_twha60_fixed0_size; | |
78 | ||
79 | /* Fixed TWHA60 report descriptor, interface 1 (frame buttons) */ | |
80 | extern __u8 uclogic_rdesc_twha60_fixed1_arr[]; | |
81 | extern const size_t uclogic_rdesc_twha60_fixed1_size; | |
82 | ||
83 | /* Report descriptor template placeholder head */ | |
76e645be | 84 | #define UCLOGIC_RDESC_PEN_PH_HEAD 0xFE, 0xED, 0x1D |
867c8925 | 85 | #define UCLOGIC_RDESC_FRAME_PH_BTN_HEAD 0xFE, 0xED |
ff0c13d6 NK |
86 | |
87 | /* Apply report descriptor parameters to a report descriptor template */ | |
88 | extern __u8 *uclogic_rdesc_template_apply(const __u8 *template_ptr, | |
89 | size_t template_size, | |
90 | const s32 *param_list, | |
91 | size_t param_num); | |
92 | ||
76e645be JE |
93 | /* Report descriptor template placeholder IDs */ |
94 | enum uclogic_rdesc_ph_id { | |
ff0c13d6 NK |
95 | UCLOGIC_RDESC_PEN_PH_ID_X_LM, |
96 | UCLOGIC_RDESC_PEN_PH_ID_X_PM, | |
97 | UCLOGIC_RDESC_PEN_PH_ID_Y_LM, | |
98 | UCLOGIC_RDESC_PEN_PH_ID_Y_PM, | |
99 | UCLOGIC_RDESC_PEN_PH_ID_PRESSURE_LM, | |
867c8925 | 100 | UCLOGIC_RDESC_FRAME_PH_ID_UM, |
76e645be | 101 | UCLOGIC_RDESC_PH_ID_NUM |
ff0c13d6 NK |
102 | }; |
103 | ||
104 | /* Report descriptor pen template placeholder */ | |
105 | #define UCLOGIC_RDESC_PEN_PH(_ID) \ | |
76e645be | 106 | UCLOGIC_RDESC_PEN_PH_HEAD, UCLOGIC_RDESC_PEN_PH_ID_##_ID |
ff0c13d6 | 107 | |
867c8925 JE |
108 | /* Report descriptor frame buttons template placeholder */ |
109 | #define UCLOGIC_RDESC_FRAME_PH_BTN \ | |
110 | UCLOGIC_RDESC_FRAME_PH_BTN_HEAD, UCLOGIC_RDESC_FRAME_PH_ID_UM | |
111 | ||
eecb5b84 | 112 | /* Report ID for v1 pen reports */ |
a985de58 | 113 | #define UCLOGIC_RDESC_V1_PEN_ID 0x07 |
ff0c13d6 | 114 | |
eecb5b84 | 115 | /* Fixed report descriptor template for (tweaked) v1 pen reports */ |
a985de58 NK |
116 | extern const __u8 uclogic_rdesc_v1_pen_template_arr[]; |
117 | extern const size_t uclogic_rdesc_v1_pen_template_size; | |
ff0c13d6 | 118 | |
2c3a88c6 | 119 | /* Report ID for v2 pen reports */ |
a985de58 | 120 | #define UCLOGIC_RDESC_V2_PEN_ID 0x08 |
2c3a88c6 NK |
121 | |
122 | /* Fixed report descriptor template for (tweaked) v2 pen reports */ | |
a985de58 NK |
123 | extern const __u8 uclogic_rdesc_v2_pen_template_arr[]; |
124 | extern const size_t uclogic_rdesc_v2_pen_template_size; | |
2c3a88c6 | 125 | |
2daaeff3 NK |
126 | /* Report ID for tweaked v1 frame reports */ |
127 | #define UCLOGIC_RDESC_V1_FRAME_ID 0xf7 | |
128 | ||
2e28f3e0 | 129 | /* Fixed report descriptor for (tweaked) v1 frame reports */ |
a985de58 NK |
130 | extern const __u8 uclogic_rdesc_v1_frame_arr[]; |
131 | extern const size_t uclogic_rdesc_v1_frame_size; | |
ff0c13d6 | 132 | |
c3e6e59a NK |
133 | /* Report ID for tweaked v2 frame button reports */ |
134 | #define UCLOGIC_RDESC_V2_FRAME_BUTTONS_ID 0xf7 | |
ff0c13d6 | 135 | |
c3e6e59a NK |
136 | /* Fixed report descriptor for (tweaked) v2 frame button reports */ |
137 | extern const __u8 uclogic_rdesc_v2_frame_buttons_arr[]; | |
138 | extern const size_t uclogic_rdesc_v2_frame_buttons_size; | |
139 | ||
caf7e934 NK |
140 | /* Report ID for tweaked v2 frame touch ring/strip reports */ |
141 | #define UCLOGIC_RDESC_V2_FRAME_TOUCH_ID 0xf8 | |
c3e6e59a NK |
142 | |
143 | /* Fixed report descriptor for (tweaked) v2 frame touch ring reports */ | |
144 | extern const __u8 uclogic_rdesc_v2_frame_touch_ring_arr[]; | |
145 | extern const size_t uclogic_rdesc_v2_frame_touch_ring_size; | |
146 | ||
118dfdea NK |
147 | /* Fixed report descriptor for (tweaked) v2 frame touch strip reports */ |
148 | extern const __u8 uclogic_rdesc_v2_frame_touch_strip_arr[]; | |
149 | extern const size_t uclogic_rdesc_v2_frame_touch_strip_size; | |
150 | ||
caf7e934 NK |
151 | /* Device ID byte offset in v2 frame touch ring/strip reports */ |
152 | #define UCLOGIC_RDESC_V2_FRAME_TOUCH_DEV_ID_BYTE 0x4 | |
2c3a88c6 | 153 | |
6facd076 NK |
154 | /* Report ID for tweaked v2 frame dial reports */ |
155 | #define UCLOGIC_RDESC_V2_FRAME_DIAL_ID 0xf9 | |
156 | ||
157 | /* Fixed report descriptor for (tweaked) v2 frame dial reports */ | |
158 | extern const __u8 uclogic_rdesc_v2_frame_dial_arr[]; | |
159 | extern const size_t uclogic_rdesc_v2_frame_dial_size; | |
160 | ||
161 | /* Device ID byte offset in v2 frame dial reports */ | |
162 | #define UCLOGIC_RDESC_V2_FRAME_DIAL_DEV_ID_BYTE 0x4 | |
163 | ||
f9ce4db0 JE |
164 | /* Report ID for tweaked UGEE v2 battery reports */ |
165 | #define UCLOGIC_RDESC_UGEE_V2_BATTERY_ID 0xba | |
166 | ||
0cb1fc09 JE |
167 | /* Fixed report descriptor template for UGEE v2 pen reports */ |
168 | extern const __u8 uclogic_rdesc_ugee_v2_pen_template_arr[]; | |
169 | extern const size_t uclogic_rdesc_ugee_v2_pen_template_size; | |
170 | ||
171 | /* Fixed report descriptor template for UGEE v2 frame reports (buttons only) */ | |
172 | extern const __u8 uclogic_rdesc_ugee_v2_frame_btn_template_arr[]; | |
173 | extern const size_t uclogic_rdesc_ugee_v2_frame_btn_template_size; | |
174 | ||
b67439d7 JE |
175 | /* Fixed report descriptor template for UGEE v2 frame reports (dial) */ |
176 | extern const __u8 uclogic_rdesc_ugee_v2_frame_dial_template_arr[]; | |
177 | extern const size_t uclogic_rdesc_ugee_v2_frame_dial_template_size; | |
178 | ||
387dcab7 JE |
179 | /* Fixed report descriptor template for UGEE v2 frame reports (mouse) */ |
180 | extern const __u8 uclogic_rdesc_ugee_v2_frame_mouse_template_arr[]; | |
181 | extern const size_t uclogic_rdesc_ugee_v2_frame_mouse_template_size; | |
182 | ||
f9ce4db0 JE |
183 | /* Fixed report descriptor template for UGEE v2 battery reports */ |
184 | extern const __u8 uclogic_rdesc_ugee_v2_battery_template_arr[]; | |
185 | extern const size_t uclogic_rdesc_ugee_v2_battery_template_size; | |
186 | ||
2e28f3e0 NK |
187 | /* Fixed report descriptor for Ugee EX07 frame */ |
188 | extern const __u8 uclogic_rdesc_ugee_ex07_frame_arr[]; | |
189 | extern const size_t uclogic_rdesc_ugee_ex07_frame_size; | |
1ee7c685 | 190 | |
08367be1 NK |
191 | /* Fixed report descriptor for XP-Pen Deco 01 frame controls */ |
192 | extern const __u8 uclogic_rdesc_xppen_deco01_frame_arr[]; | |
193 | extern const size_t uclogic_rdesc_xppen_deco01_frame_size; | |
194 | ||
e902ed93 NK |
195 | /* Fixed report descriptor for Ugee G5 frame controls */ |
196 | extern const __u8 uclogic_rdesc_ugee_g5_frame_arr[]; | |
197 | extern const size_t uclogic_rdesc_ugee_g5_frame_size; | |
198 | ||
199 | /* Report ID of Ugee G5 frame control reports */ | |
200 | #define UCLOGIC_RDESC_UGEE_G5_FRAME_ID 0x06 | |
201 | ||
202 | /* Device ID byte offset in Ugee G5 frame report */ | |
203 | #define UCLOGIC_RDESC_UGEE_G5_FRAME_DEV_ID_BYTE 0x2 | |
204 | ||
205 | /* Least-significant bit of Ugee G5 frame rotary encoder state */ | |
206 | #define UCLOGIC_RDESC_UGEE_G5_FRAME_RE_LSB 38 | |
207 | ||
ff0c13d6 | 208 | #endif /* _HID_UCLOGIC_RDESC_H */ |