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 | * | |
5 | * Copyright (c) 2010-2014 Nikolai Kondrashov | |
6 | * Copyright (c) 2013 Martin Rusko | |
7 | */ | |
8 | ||
9 | /* | |
10 | * This program is free software; you can redistribute it and/or modify it | |
11 | * under the terms of the GNU General Public License as published by the Free | |
12 | * Software Foundation; either version 2 of the License, or (at your option) | |
13 | * any later version. | |
14 | */ | |
15 | ||
16 | #include <linux/device.h> | |
17 | #include <linux/hid.h> | |
18 | #include <linux/module.h> | |
01309e29 | 19 | #include <linux/timer.h> |
ff0c13d6 | 20 | #include "usbhid/usbhid.h" |
9614219e | 21 | #include "hid-uclogic-params.h" |
ff0c13d6 NK |
22 | |
23 | #include "hid-ids.h" | |
24 | ||
01309e29 NK |
25 | /** |
26 | * uclogic_inrange_timeout - handle pen in-range state timeout. | |
27 | * Emulate input events normally generated when pen goes out of range for | |
28 | * tablets which don't report that. | |
29 | * | |
30 | * @t: The timer the timeout handler is attached to, stored in a struct | |
31 | * uclogic_drvdata. | |
32 | */ | |
33 | static void uclogic_inrange_timeout(struct timer_list *t) | |
34 | { | |
35 | struct uclogic_drvdata *drvdata = from_timer(drvdata, t, | |
36 | inrange_timer); | |
37 | struct input_dev *input = drvdata->pen_input; | |
38 | ||
39 | if (input == NULL) | |
40 | return; | |
41 | input_report_abs(input, ABS_PRESSURE, 0); | |
42 | /* If BTN_TOUCH state is changing */ | |
43 | if (test_bit(BTN_TOUCH, input->key)) { | |
44 | input_event(input, EV_MSC, MSC_SCAN, | |
45 | /* Digitizer Tip Switch usage */ | |
46 | 0xd0042); | |
47 | input_report_key(input, BTN_TOUCH, 0); | |
48 | } | |
49 | input_report_key(input, BTN_TOOL_PEN, 0); | |
50 | input_sync(input); | |
51 | } | |
52 | ||
ff0c13d6 NK |
53 | static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc, |
54 | unsigned int *rsize) | |
55 | { | |
ff0c13d6 NK |
56 | struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev); |
57 | ||
9614219e NK |
58 | if (drvdata->desc_ptr != NULL) { |
59 | rdesc = drvdata->desc_ptr; | |
60 | *rsize = drvdata->desc_size; | |
ff0c13d6 | 61 | } |
ff0c13d6 NK |
62 | return rdesc; |
63 | } | |
64 | ||
f5927973 NK |
65 | static int uclogic_input_mapping(struct hid_device *hdev, |
66 | struct hid_input *hi, | |
67 | struct hid_field *field, | |
68 | struct hid_usage *usage, | |
69 | unsigned long **bit, | |
70 | int *max) | |
71 | { | |
72 | struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev); | |
73 | struct uclogic_params *params = &drvdata->params; | |
74 | ||
75 | /* Discard invalid pen usages */ | |
76 | if (params->pen.usage_invalid && (field->application == HID_DG_PEN)) | |
77 | return -1; | |
78 | ||
79 | /* Let hid-core decide what to do */ | |
80 | return 0; | |
81 | } | |
82 | ||
ff0c13d6 NK |
83 | static int uclogic_input_configured(struct hid_device *hdev, |
84 | struct hid_input *hi) | |
85 | { | |
01309e29 NK |
86 | struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev); |
87 | struct uclogic_params *params = &drvdata->params; | |
ff0c13d6 NK |
88 | char *name; |
89 | const char *suffix = NULL; | |
90 | struct hid_field *field; | |
91 | size_t len; | |
d170e8e0 NK |
92 | size_t i; |
93 | const struct uclogic_params_frame *frame; | |
ff0c13d6 NK |
94 | |
95 | /* no report associated (HID_QUIRK_MULTI_INPUT not set) */ | |
96 | if (!hi->report) | |
97 | return 0; | |
98 | ||
01309e29 NK |
99 | /* |
100 | * If this is the input corresponding to the pen report | |
101 | * in need of tweaking. | |
102 | */ | |
103 | if (hi->report->id == params->pen.id) { | |
104 | /* Remember the input device so we can simulate events */ | |
105 | drvdata->pen_input = hi->input; | |
106 | } | |
107 | ||
d170e8e0 NK |
108 | /* If it's one of the frame devices */ |
109 | for (i = 0; i < ARRAY_SIZE(params->frame_list); i++) { | |
110 | frame = ¶ms->frame_list[i]; | |
111 | if (hi->report->id == frame->id) { | |
ee007036 NK |
112 | /* Assign custom suffix, if any */ |
113 | suffix = frame->suffix; | |
d170e8e0 NK |
114 | /* |
115 | * Disable EV_MSC reports for touch ring interfaces to | |
116 | * make the Wacom driver pickup touch ring extents | |
117 | */ | |
caf7e934 | 118 | if (frame->touch_byte > 0) |
d170e8e0 NK |
119 | __clear_bit(EV_MSC, hi->input->evbit); |
120 | } | |
121 | } | |
122 | ||
ee007036 NK |
123 | if (!suffix) { |
124 | field = hi->report->field[0]; | |
ff0c13d6 | 125 | |
ee007036 NK |
126 | switch (field->application) { |
127 | case HID_GD_KEYBOARD: | |
128 | suffix = "Keyboard"; | |
129 | break; | |
130 | case HID_GD_MOUSE: | |
131 | suffix = "Mouse"; | |
132 | break; | |
133 | case HID_GD_KEYPAD: | |
134 | suffix = "Pad"; | |
135 | break; | |
136 | case HID_DG_PEN: | |
0977fda0 | 137 | case HID_DG_DIGITIZER: |
ee007036 NK |
138 | suffix = "Pen"; |
139 | break; | |
140 | case HID_CP_CONSUMER_CONTROL: | |
141 | suffix = "Consumer Control"; | |
142 | break; | |
143 | case HID_GD_SYSTEM_CONTROL: | |
144 | suffix = "System Control"; | |
145 | break; | |
146 | } | |
ff0c13d6 NK |
147 | } |
148 | ||
149 | if (suffix) { | |
150 | len = strlen(hdev->name) + 2 + strlen(suffix); | |
151 | name = devm_kzalloc(&hi->input->dev, len, GFP_KERNEL); | |
152 | if (name) { | |
153 | snprintf(name, len, "%s %s", hdev->name, suffix); | |
154 | hi->input->name = name; | |
155 | } | |
156 | } | |
157 | ||
158 | return 0; | |
159 | } | |
160 | ||
ff0c13d6 NK |
161 | static int uclogic_probe(struct hid_device *hdev, |
162 | const struct hid_device_id *id) | |
163 | { | |
164 | int rc; | |
9614219e NK |
165 | struct uclogic_drvdata *drvdata = NULL; |
166 | bool params_initialized = false; | |
ff0c13d6 | 167 | |
93020953 GKH |
168 | if (!hid_is_usb(hdev)) |
169 | return -EINVAL; | |
170 | ||
ff0c13d6 NK |
171 | /* |
172 | * libinput requires the pad interface to be on a different node | |
173 | * than the pen, so use QUIRK_MULTI_INPUT for all tablets. | |
174 | */ | |
175 | hdev->quirks |= HID_QUIRK_MULTI_INPUT; | |
3405a4be | 176 | hdev->quirks |= HID_QUIRK_HIDINPUT_FORCE; |
ff0c13d6 NK |
177 | |
178 | /* Allocate and assign driver data */ | |
179 | drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL); | |
9614219e NK |
180 | if (drvdata == NULL) { |
181 | rc = -ENOMEM; | |
182 | goto failure; | |
183 | } | |
01309e29 | 184 | timer_setup(&drvdata->inrange_timer, uclogic_inrange_timeout, 0); |
8a47670c | 185 | drvdata->re_state = U8_MAX; |
14b71e6a | 186 | drvdata->quirks = id->driver_data; |
ff0c13d6 NK |
187 | hid_set_drvdata(hdev, drvdata); |
188 | ||
9614219e NK |
189 | /* Initialize the device and retrieve interface parameters */ |
190 | rc = uclogic_params_init(&drvdata->params, hdev); | |
191 | if (rc != 0) { | |
192 | hid_err(hdev, "failed probing parameters: %d\n", rc); | |
193 | goto failure; | |
194 | } | |
195 | params_initialized = true; | |
a228809f NK |
196 | hid_dbg(hdev, "parameters:\n"); |
197 | uclogic_params_hid_dbg(hdev, &drvdata->params); | |
9614219e NK |
198 | if (drvdata->params.invalid) { |
199 | hid_info(hdev, "interface is invalid, ignoring\n"); | |
200 | rc = -ENODEV; | |
201 | goto failure; | |
202 | } | |
ff0c13d6 | 203 | |
9614219e NK |
204 | /* Generate replacement report descriptor */ |
205 | rc = uclogic_params_get_desc(&drvdata->params, | |
206 | &drvdata->desc_ptr, | |
207 | &drvdata->desc_size); | |
208 | if (rc) { | |
209 | hid_err(hdev, | |
210 | "failed generating replacement report descriptor: %d\n", | |
211 | rc); | |
212 | goto failure; | |
ff0c13d6 NK |
213 | } |
214 | ||
215 | rc = hid_parse(hdev); | |
216 | if (rc) { | |
217 | hid_err(hdev, "parse failed\n"); | |
9614219e | 218 | goto failure; |
ff0c13d6 NK |
219 | } |
220 | ||
221 | rc = hid_hw_start(hdev, HID_CONNECT_DEFAULT); | |
222 | if (rc) { | |
223 | hid_err(hdev, "hw start failed\n"); | |
9614219e | 224 | goto failure; |
ff0c13d6 NK |
225 | } |
226 | ||
227 | return 0; | |
9614219e NK |
228 | failure: |
229 | /* Assume "remove" might not be called if "probe" failed */ | |
230 | if (params_initialized) | |
231 | uclogic_params_cleanup(&drvdata->params); | |
232 | return rc; | |
ff0c13d6 NK |
233 | } |
234 | ||
251b4275 NK |
235 | #ifdef CONFIG_PM |
236 | static int uclogic_resume(struct hid_device *hdev) | |
237 | { | |
238 | int rc; | |
239 | struct uclogic_params params; | |
240 | ||
241 | /* Re-initialize the device, but discard parameters */ | |
242 | rc = uclogic_params_init(¶ms, hdev); | |
243 | if (rc != 0) | |
244 | hid_err(hdev, "failed to re-initialize the device\n"); | |
245 | else | |
246 | uclogic_params_cleanup(¶ms); | |
247 | ||
248 | return rc; | |
249 | } | |
250 | #endif | |
251 | ||
a251d657 JE |
252 | /** |
253 | * uclogic_exec_event_hook - if the received event is hooked schedules the | |
254 | * associated work. | |
255 | * | |
256 | * @p: Tablet interface report parameters. | |
257 | * @event: Raw event. | |
258 | * @size: The size of event. | |
259 | * | |
260 | * Returns: | |
261 | * Whether the event was hooked or not. | |
262 | */ | |
263 | static bool uclogic_exec_event_hook(struct uclogic_params *p, u8 *event, int size) | |
264 | { | |
265 | struct uclogic_raw_event_hook *curr; | |
266 | ||
267 | if (!p->event_hooks) | |
268 | return false; | |
269 | ||
270 | list_for_each_entry(curr, &p->event_hooks->list, list) { | |
271 | if (curr->size == size && memcmp(curr->event, event, size) == 0) { | |
272 | schedule_work(&curr->work); | |
273 | return true; | |
274 | } | |
275 | } | |
276 | ||
277 | return false; | |
278 | } | |
279 | ||
7e418667 NK |
280 | /** |
281 | * uclogic_raw_event_pen - handle raw pen events (pen HID reports). | |
282 | * | |
283 | * @drvdata: Driver data. | |
284 | * @data: Report data buffer, can be modified. | |
285 | * @size: Report data size, bytes. | |
286 | * | |
287 | * Returns: | |
288 | * Negative value on error (stops event delivery), zero for success. | |
289 | */ | |
290 | static int uclogic_raw_event_pen(struct uclogic_drvdata *drvdata, | |
291 | u8 *data, int size) | |
292 | { | |
7f12dd24 | 293 | struct uclogic_params_pen *pen = &drvdata->params.pen; |
7e418667 NK |
294 | |
295 | WARN_ON(drvdata == NULL); | |
296 | WARN_ON(data == NULL && size != 0); | |
297 | ||
298 | /* If in-range reports are inverted */ | |
7f12dd24 | 299 | if (pen->inrange == |
7e418667 NK |
300 | UCLOGIC_PARAMS_PEN_INRANGE_INVERTED) { |
301 | /* Invert the in-range bit */ | |
302 | data[1] ^= 0x40; | |
303 | } | |
304 | /* | |
305 | * If report contains fragmented high-resolution pen | |
306 | * coordinates | |
307 | */ | |
7f12dd24 | 308 | if (size >= 10 && pen->fragmented_hires) { |
7e418667 NK |
309 | u8 pressure_low_byte; |
310 | u8 pressure_high_byte; | |
311 | ||
312 | /* Lift pressure bytes */ | |
313 | pressure_low_byte = data[6]; | |
314 | pressure_high_byte = data[7]; | |
315 | /* | |
316 | * Move Y coord to make space for high-order X | |
317 | * coord byte | |
318 | */ | |
319 | data[6] = data[5]; | |
320 | data[5] = data[4]; | |
321 | /* Move high-order X coord byte */ | |
322 | data[4] = data[8]; | |
323 | /* Move high-order Y coord byte */ | |
324 | data[7] = data[9]; | |
325 | /* Place pressure bytes */ | |
326 | data[8] = pressure_low_byte; | |
327 | data[9] = pressure_high_byte; | |
328 | } | |
329 | /* If we need to emulate in-range detection */ | |
7f12dd24 | 330 | if (pen->inrange == UCLOGIC_PARAMS_PEN_INRANGE_NONE) { |
7e418667 NK |
331 | /* Set in-range bit */ |
332 | data[1] |= 0x40; | |
333 | /* (Re-)start in-range timeout */ | |
334 | mod_timer(&drvdata->inrange_timer, | |
335 | jiffies + msecs_to_jiffies(100)); | |
336 | } | |
337 | /* If we report tilt and Y direction is flipped */ | |
7f12dd24 | 338 | if (size >= 12 && pen->tilt_y_flipped) |
7e418667 NK |
339 | data[11] = -data[11]; |
340 | ||
341 | return 0; | |
342 | } | |
343 | ||
344 | /** | |
345 | * uclogic_raw_event_frame - handle raw frame events (frame HID reports). | |
346 | * | |
347 | * @drvdata: Driver data. | |
337fa051 | 348 | * @frame: The parameters of the frame controls to handle. |
7e418667 NK |
349 | * @data: Report data buffer, can be modified. |
350 | * @size: Report data size, bytes. | |
351 | * | |
352 | * Returns: | |
353 | * Negative value on error (stops event delivery), zero for success. | |
354 | */ | |
337fa051 NK |
355 | static int uclogic_raw_event_frame( |
356 | struct uclogic_drvdata *drvdata, | |
357 | const struct uclogic_params_frame *frame, | |
358 | u8 *data, int size) | |
7e418667 | 359 | { |
7e418667 NK |
360 | WARN_ON(drvdata == NULL); |
361 | WARN_ON(data == NULL && size != 0); | |
362 | ||
363 | /* If need to, and can, set pad device ID for Wacom drivers */ | |
7f12dd24 | 364 | if (frame->dev_id_byte > 0 && frame->dev_id_byte < size) { |
d170e8e0 | 365 | /* If we also have a touch ring and the finger left it */ |
caf7e934 NK |
366 | if (frame->touch_byte > 0 && frame->touch_byte < size && |
367 | data[frame->touch_byte] == 0) { | |
d170e8e0 NK |
368 | data[frame->dev_id_byte] = 0; |
369 | } else { | |
370 | data[frame->dev_id_byte] = 0xf; | |
371 | } | |
7e418667 | 372 | } |
d170e8e0 | 373 | |
7e418667 | 374 | /* If need to, and can, read rotary encoder state change */ |
7f12dd24 NK |
375 | if (frame->re_lsb > 0 && frame->re_lsb / 8 < size) { |
376 | unsigned int byte = frame->re_lsb / 8; | |
377 | unsigned int bit = frame->re_lsb % 8; | |
7e418667 NK |
378 | |
379 | u8 change; | |
380 | u8 prev_state = drvdata->re_state; | |
381 | /* Read Gray-coded state */ | |
382 | u8 state = (data[byte] >> bit) & 0x3; | |
383 | /* Encode state change into 2-bit signed integer */ | |
384 | if ((prev_state == 1 && state == 0) || | |
385 | (prev_state == 2 && state == 3)) { | |
386 | change = 1; | |
387 | } else if ((prev_state == 2 && state == 0) || | |
388 | (prev_state == 1 && state == 3)) { | |
389 | change = 3; | |
390 | } else { | |
391 | change = 0; | |
392 | } | |
393 | /* Write change */ | |
394 | data[byte] = (data[byte] & ~((u8)3 << bit)) | | |
395 | (change << bit); | |
396 | /* Remember state */ | |
397 | drvdata->re_state = state; | |
398 | } | |
399 | ||
d170e8e0 | 400 | /* If need to, and can, transform the touch ring reports */ |
fbc08b4e | 401 | if (frame->touch_byte > 0 && frame->touch_byte < size) { |
caf7e934 | 402 | __s8 value = data[frame->touch_byte]; |
d170e8e0 | 403 | |
fbc08b4e NK |
404 | if (value != 0) { |
405 | if (frame->touch_flip_at != 0) { | |
406 | value = frame->touch_flip_at - value; | |
407 | if (value <= 0) | |
408 | value = frame->touch_max + value; | |
409 | } | |
410 | data[frame->touch_byte] = value - 1; | |
d170e8e0 NK |
411 | } |
412 | } | |
413 | ||
2112b49e NK |
414 | /* If need to, and can, transform the bitmap dial reports */ |
415 | if (frame->bitmap_dial_byte > 0 && frame->bitmap_dial_byte < size) { | |
416 | if (data[frame->bitmap_dial_byte] == 2) | |
417 | data[frame->bitmap_dial_byte] = -1; | |
418 | } | |
419 | ||
7e418667 NK |
420 | return 0; |
421 | } | |
422 | ||
9614219e NK |
423 | static int uclogic_raw_event(struct hid_device *hdev, |
424 | struct hid_report *report, | |
425 | u8 *data, int size) | |
ff0c13d6 | 426 | { |
044fa816 | 427 | unsigned int report_id = report->id; |
ff0c13d6 | 428 | struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev); |
9614219e | 429 | struct uclogic_params *params = &drvdata->params; |
8b013098 NK |
430 | struct uclogic_params_pen_subreport *subreport; |
431 | struct uclogic_params_pen_subreport *subreport_list_end; | |
337fa051 | 432 | size_t i; |
ff0c13d6 | 433 | |
fea53b9f NK |
434 | /* Do not handle anything but input reports */ |
435 | if (report->type != HID_INPUT_REPORT) | |
436 | return 0; | |
437 | ||
a251d657 JE |
438 | if (uclogic_exec_event_hook(params, data, size)) |
439 | return 0; | |
440 | ||
8b013098 NK |
441 | while (true) { |
442 | /* Tweak pen reports, if necessary */ | |
443 | if ((report_id == params->pen.id) && (size >= 2)) { | |
444 | subreport_list_end = | |
445 | params->pen.subreport_list + | |
446 | ARRAY_SIZE(params->pen.subreport_list); | |
447 | /* Try to match a subreport */ | |
448 | for (subreport = params->pen.subreport_list; | |
e6be956f NK |
449 | subreport < subreport_list_end; subreport++) { |
450 | if (subreport->value != 0 && | |
451 | subreport->value == data[1]) { | |
452 | break; | |
453 | } | |
454 | } | |
8b013098 NK |
455 | /* If a subreport matched */ |
456 | if (subreport < subreport_list_end) { | |
457 | /* Change to subreport ID, and restart */ | |
458 | report_id = data[0] = subreport->id; | |
459 | continue; | |
460 | } else { | |
461 | return uclogic_raw_event_pen(drvdata, data, size); | |
462 | } | |
9614219e | 463 | } |
ff0c13d6 | 464 | |
8b013098 | 465 | /* Tweak frame control reports, if necessary */ |
337fa051 NK |
466 | for (i = 0; i < ARRAY_SIZE(params->frame_list); i++) { |
467 | if (report_id == params->frame_list[i].id) { | |
468 | return uclogic_raw_event_frame( | |
469 | drvdata, ¶ms->frame_list[i], | |
470 | data, size); | |
471 | } | |
472 | } | |
8b013098 NK |
473 | |
474 | break; | |
475 | } | |
fde44ac5 | 476 | |
ff0c13d6 NK |
477 | return 0; |
478 | } | |
479 | ||
9614219e NK |
480 | static void uclogic_remove(struct hid_device *hdev) |
481 | { | |
482 | struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev); | |
483 | ||
01309e29 | 484 | del_timer_sync(&drvdata->inrange_timer); |
9614219e NK |
485 | hid_hw_stop(hdev); |
486 | kfree(drvdata->desc_ptr); | |
487 | uclogic_params_cleanup(&drvdata->params); | |
488 | } | |
489 | ||
ff0c13d6 NK |
490 | static const struct hid_device_id uclogic_devices[] = { |
491 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, | |
492 | USB_DEVICE_ID_UCLOGIC_TABLET_PF1209) }, | |
493 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, | |
494 | USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U) }, | |
495 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, | |
496 | USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U) }, | |
497 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, | |
498 | USB_DEVICE_ID_UCLOGIC_TABLET_WP8060U) }, | |
499 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, | |
500 | USB_DEVICE_ID_UCLOGIC_TABLET_WP1062) }, | |
501 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, | |
502 | USB_DEVICE_ID_UCLOGIC_WIRELESS_TABLET_TWHL850) }, | |
503 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, | |
504 | USB_DEVICE_ID_UCLOGIC_TABLET_TWHA60) }, | |
9614219e NK |
505 | { HID_USB_DEVICE(USB_VENDOR_ID_HUION, |
506 | USB_DEVICE_ID_HUION_TABLET) }, | |
315ffcc9 | 507 | { HID_USB_DEVICE(USB_VENDOR_ID_HUION, |
85e86071 | 508 | USB_DEVICE_ID_HUION_TABLET2) }, |
f7271b2a CK |
509 | { HID_USB_DEVICE(USB_VENDOR_ID_TRUST, |
510 | USB_DEVICE_ID_TRUST_PANORA_TABLET) }, | |
9614219e NK |
511 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, |
512 | USB_DEVICE_ID_HUION_TABLET) }, | |
513 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, | |
514 | USB_DEVICE_ID_YIYNOVA_TABLET) }, | |
515 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, | |
516 | USB_DEVICE_ID_UCLOGIC_UGEE_TABLET_81) }, | |
517 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, | |
518 | USB_DEVICE_ID_UCLOGIC_UGEE_TABLET_45) }, | |
0c15efe9 NK |
519 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, |
520 | USB_DEVICE_ID_UCLOGIC_UGEE_TABLET_47) }, | |
9614219e NK |
521 | { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, |
522 | USB_DEVICE_ID_UCLOGIC_DRAWIMAGE_G3) }, | |
523 | { HID_USB_DEVICE(USB_VENDOR_ID_UGTIZER, | |
524 | USB_DEVICE_ID_UGTIZER_TABLET_GP0610) }, | |
022fc531 MS |
525 | { HID_USB_DEVICE(USB_VENDOR_ID_UGTIZER, |
526 | USB_DEVICE_ID_UGTIZER_TABLET_GT5040) }, | |
7495fb7e JE |
527 | { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, |
528 | USB_DEVICE_ID_UGEE_PARBLO_A610_PRO) }, | |
e902ed93 NK |
529 | { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, |
530 | USB_DEVICE_ID_UGEE_TABLET_G5) }, | |
9614219e NK |
531 | { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, |
532 | USB_DEVICE_ID_UGEE_TABLET_EX07S) }, | |
88bb346d WX |
533 | { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, |
534 | USB_DEVICE_ID_UGEE_TABLET_RAINBOW_CV720) }, | |
c3e5a67c NK |
535 | { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, |
536 | USB_DEVICE_ID_UGEE_XPPEN_TABLET_G540) }, | |
492a9e9a NK |
537 | { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, |
538 | USB_DEVICE_ID_UGEE_XPPEN_TABLET_G640) }, | |
08367be1 NK |
539 | { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, |
540 | USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01) }, | |
febb2c0d JE |
541 | { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, |
542 | USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO01_V2) }, | |
0cb1fc09 JE |
543 | { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, |
544 | USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_L) }, | |
9266a881 JE |
545 | { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, |
546 | USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_PRO_MW), | |
547 | .driver_data = UCLOGIC_MOUSE_FRAME_QUIRK | UCLOGIC_BATTERY_QUIRK }, | |
93b40b3e JE |
548 | { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, |
549 | USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_PRO_S) }, | |
7744ca57 JE |
550 | { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, |
551 | USB_DEVICE_ID_UGEE_XPPEN_TABLET_DECO_PRO_SW), | |
552 | .driver_data = UCLOGIC_MOUSE_FRAME_QUIRK | UCLOGIC_BATTERY_QUIRK }, | |
61b1db5a RR |
553 | { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, |
554 | USB_DEVICE_ID_UGEE_XPPEN_TABLET_STAR06) }, | |
ff0c13d6 NK |
555 | { } |
556 | }; | |
557 | MODULE_DEVICE_TABLE(hid, uclogic_devices); | |
558 | ||
559 | static struct hid_driver uclogic_driver = { | |
560 | .name = "uclogic", | |
561 | .id_table = uclogic_devices, | |
562 | .probe = uclogic_probe, | |
9614219e | 563 | .remove = uclogic_remove, |
ff0c13d6 NK |
564 | .report_fixup = uclogic_report_fixup, |
565 | .raw_event = uclogic_raw_event, | |
f5927973 | 566 | .input_mapping = uclogic_input_mapping, |
ff0c13d6 | 567 | .input_configured = uclogic_input_configured, |
251b4275 NK |
568 | #ifdef CONFIG_PM |
569 | .resume = uclogic_resume, | |
570 | .reset_resume = uclogic_resume, | |
571 | #endif | |
ff0c13d6 NK |
572 | }; |
573 | module_hid_driver(uclogic_driver); | |
574 | ||
575 | MODULE_AUTHOR("Martin Rusko"); | |
576 | MODULE_AUTHOR("Nikolai Kondrashov"); | |
577 | MODULE_LICENSE("GPL"); | |
a251d657 JE |
578 | |
579 | #ifdef CONFIG_HID_KUNIT_TEST | |
580 | #include "hid-uclogic-core-test.c" | |
581 | #endif |