10
10
#define VID_UGEE 0x28BD /* VID is shared with SinoWealth and Glorious and prob others */
11
11
#define PID_ARTIST_PRO14_GEN2 0x095A
12
12
#define PID_ARTIST_PRO16_GEN2 0x095B
13
+ #define PID_ARTIST_PRO19_GEN2 0x096A
13
14
14
15
HID_BPF_CONFIG (
15
16
HID_DEVICE (BUS_USB , HID_GROUP_GENERIC , VID_UGEE , PID_ARTIST_PRO14_GEN2 ),
16
- HID_DEVICE (BUS_USB , HID_GROUP_GENERIC , VID_UGEE , PID_ARTIST_PRO16_GEN2 )
17
+ HID_DEVICE (BUS_USB , HID_GROUP_GENERIC , VID_UGEE , PID_ARTIST_PRO16_GEN2 ),
18
+ HID_DEVICE (BUS_USB , HID_GROUP_GENERIC , VID_UGEE , PID_ARTIST_PRO19_GEN2 )
17
19
);
18
20
19
21
/*
@@ -22,7 +24,7 @@ HID_BPF_CONFIG(
22
24
* - when the eraser button is pressed and the stylus is touching the tablet,
23
25
* the device sends Tip Switch instead of sending Eraser
24
26
*
25
- * This descriptor uses physical dimensions of the 16" device.
27
+ * This descriptor uses the physical dimensions of the 16" device.
26
28
*/
27
29
static const __u8 fixed_rdesc [] = {
28
30
0x05 , 0x0d , // Usage Page (Digitizers) 0
@@ -100,6 +102,12 @@ int BPF_PROG(hid_fix_rdesc_xppen_artistpro16gen2, struct hid_bpf_ctx *hctx)
100
102
data [62 ] = 0x62 ;
101
103
data [73 ] = 0x1c ;
102
104
data [72 ] = 0xfd ;
105
+ } else if (hctx -> hid -> product == PID_ARTIST_PRO19_GEN2 ) {
106
+ /* 19" screen reports 16.101" x 9.057" */
107
+ data [63 ] = 0x3e ;
108
+ data [62 ] = 0xe5 ;
109
+ data [73 ] = 0x23 ;
110
+ data [72 ] = 0x61 ;
103
111
}
104
112
105
113
return sizeof (fixed_rdesc );
@@ -177,6 +185,27 @@ static const __u16 angle_offsets_vertical_16[128] = {
177
185
188 , 186 , 184 , 182 , 180 , 178 , 176 , 174 , 172
178
186
};
179
187
188
+ /* 19" inch screen 16.101" x 9.057" */
189
+ static const __u16 angle_offsets_horizontal_19 [128 ] = {
190
+ 0 , 2 , 4 , 6 , 8 , 10 , 12 , 14 , 16 , 18 , 20 , 22 , 24 , 25 , 27 , 29 , 31 , 33 , 35 , 37 , 39 , 41 ,
191
+ 42 , 44 , 46 , 48 , 50 , 51 , 53 , 55 , 57 , 58 , 60 , 62 , 63 , 65 , 67 , 68 , 70 , 71 , 73 , 74 , 76 ,
192
+ 77 , 79 , 80 , 82 , 83 , 84 , 86 , 87 , 88 , 89 , 90 , 92 , 93 , 94 , 95 , 96 , 97 , 98 , 99 , 100 ,
193
+ 101 , 102 , 103 , 104 , 104 , 105 , 106 , 106 , 107 , 108 , 108 , 109 , 109 , 110 , 110 , 111 ,
194
+ 111 , 112 , 112 , 112 , 112 , 113 , 113 , 113 , 113 , 113 , 113 , 113 , 113 , 113 , 113 , 113 ,
195
+ 113 , 113 , 112 , 112 , 112 , 112 , 111 , 111 , 110 , 110 , 109 , 109 , 108 , 108 , 107 , 106 ,
196
+ 106 , 105 , 104 , 104 , 103 , 102 , 101 , 100 , 99 , 98 , 97 , 96 , 95 , 94 , 93 , 92 , 90
197
+ };
198
+ static const __u16 angle_offsets_vertical_19 [128 ] = {
199
+ 0 , 4 , 7 , 11 , 14 , 18 , 21 , 25 , 28 , 32 , 35 , 38 , 42 , 45 , 49 , 52 , 56 , 59 , 62 , 66 , 69 , 72 ,
200
+ 75 , 79 , 82 , 85 , 88 , 91 , 95 , 98 , 101 , 104 , 107 , 110 , 113 , 116 , 118 , 121 , 124 , 127 ,
201
+ 129 , 132 , 135 , 137 , 140 , 142 , 145 , 147 , 150 , 152 , 154 , 157 , 159 , 161 , 163 , 165 , 167 ,
202
+ 169 , 171 , 173 , 174 , 176 , 178 , 179 , 181 , 183 , 184 , 185 , 187 , 188 , 189 , 190 , 192 , 193 ,
203
+ 194 , 195 , 195 , 196 , 197 , 198 , 198 , 199 , 199 , 200 , 200 , 201 , 201 , 201 , 201 , 201 , 201 ,
204
+ 201 , 201 , 201 , 201 , 201 , 200 , 200 , 199 , 199 , 198 , 198 , 197 , 196 , 195 , 195 , 194 , 193 ,
205
+ 192 , 190 , 189 , 188 , 187 , 185 , 184 , 183 , 181 , 179 , 178 , 176 , 174 , 173 , 171 , 169 , 167 ,
206
+ 165 , 163 , 161
207
+ };
208
+
180
209
static void compensate_coordinates_by_tilt (__u8 * data , const __u8 idx ,
181
210
const __s8 tilt , const __u16 (* compensation_table )[128 ])
182
211
{
@@ -241,12 +270,19 @@ static int xppen_16_fix_angle_offset(struct hid_bpf_ctx *hctx)
241
270
__s8 tilt_x = (__s8 ) data [8 ];
242
271
__s8 tilt_y = (__s8 ) data [9 ];
243
272
244
- if (hctx -> hid -> product == PID_ARTIST_PRO14_GEN2 ) {
273
+ switch (hctx -> hid -> product ) {
274
+ case PID_ARTIST_PRO14_GEN2 :
245
275
compensate_coordinates_by_tilt (data , 2 , tilt_x , & angle_offsets_horizontal_14 );
246
276
compensate_coordinates_by_tilt (data , 4 , tilt_y , & angle_offsets_vertical_14 );
247
- } else if (hctx -> hid -> product == PID_ARTIST_PRO16_GEN2 ) {
277
+ break ;
278
+ case PID_ARTIST_PRO16_GEN2 :
248
279
compensate_coordinates_by_tilt (data , 2 , tilt_x , & angle_offsets_horizontal_16 );
249
280
compensate_coordinates_by_tilt (data , 4 , tilt_y , & angle_offsets_vertical_16 );
281
+ break ;
282
+ case PID_ARTIST_PRO19_GEN2 :
283
+ compensate_coordinates_by_tilt (data , 2 , tilt_x , & angle_offsets_horizontal_19 );
284
+ compensate_coordinates_by_tilt (data , 4 , tilt_y , & angle_offsets_vertical_19 );
285
+ break ;
250
286
}
251
287
252
288
return 0 ;
0 commit comments