2 * drivers/input/tablet/wacom_wac.c
4 * USB Wacom tablet support - Wacom specific code
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
15 #include "wacom_wac.h"
17 static int wacom_penpartner_irq(struct wacom_wac *wacom, void *wcombo)
19 unsigned char *data = wacom->data;
24 wacom->tool[0] = (data[5] & 0x20) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;
25 wacom->id[0] = (data[5] & 0x20) ? ERASER_DEVICE_ID : STYLUS_DEVICE_ID;
26 wacom_report_key(wcombo, wacom->tool[0], 1);
27 wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); /* report tool id */
28 wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[1]));
29 wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[3]));
30 wacom_report_abs(wcombo, ABS_PRESSURE, (signed char)data[6] + 127);
31 wacom_report_key(wcombo, BTN_TOUCH, ((signed char)data[6] > -127));
32 wacom_report_key(wcombo, BTN_STYLUS, (data[5] & 0x40));
34 wacom_report_key(wcombo, wacom->tool[0], 0);
35 wacom_report_abs(wcombo, ABS_MISC, 0); /* report tool id */
36 wacom_report_abs(wcombo, ABS_PRESSURE, -1);
37 wacom_report_key(wcombo, BTN_TOUCH, 0);
41 wacom_report_key(wcombo, BTN_TOOL_PEN, 1);
42 wacom_report_abs(wcombo, ABS_MISC, STYLUS_DEVICE_ID); /* report tool id */
43 wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[1]));
44 wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[3]));
45 wacom_report_abs(wcombo, ABS_PRESSURE, (signed char)data[6] + 127);
46 wacom_report_key(wcombo, BTN_TOUCH, ((signed char)data[6] > -80) && !(data[5] & 0x20));
47 wacom_report_key(wcombo, BTN_STYLUS, (data[5] & 0x40));
50 printk(KERN_INFO "wacom_penpartner_irq: received unknown report #%d\n", data[0]);
56 static int wacom_pl_irq(struct wacom_wac *wacom, void *wcombo)
58 unsigned char *data = wacom->data;
61 if (data[0] != WACOM_REPORT_PENABLED) {
62 dbg("wacom_pl_irq: received unknown report #%d", data[0]);
66 prox = data[1] & 0x40;
69 wacom->id[0] = ERASER_DEVICE_ID;
70 pressure = (signed char)((data[7] << 1) | ((data[4] >> 2) & 1));
71 if (wacom->features->pressure_max > 255)
72 pressure = (pressure << 1) | ((data[4] >> 6) & 1);
73 pressure += (wacom->features->pressure_max + 1) / 2;
76 * if going from out of proximity into proximity select between the eraser
77 * and the pen based on the state of the stylus2 button, choose eraser if
78 * pressed else choose pen. if not a proximity change from out to in, send
79 * an out of proximity for previous tool then a in for new tool.
81 if (!wacom->tool[0]) {
82 /* Eraser bit set for DTF */
84 wacom->tool[1] = BTN_TOOL_RUBBER;
86 /* Going into proximity select tool */
87 wacom->tool[1] = (data[4] & 0x20) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;
89 /* was entered with stylus2 pressed */
90 if (wacom->tool[1] == BTN_TOOL_RUBBER && !(data[4] & 0x20)) {
91 /* report out proximity for previous tool */
92 wacom_report_key(wcombo, wacom->tool[1], 0);
93 wacom_input_sync(wcombo);
94 wacom->tool[1] = BTN_TOOL_PEN;
98 if (wacom->tool[1] != BTN_TOOL_RUBBER) {
99 /* Unknown tool selected default to pen tool */
100 wacom->tool[1] = BTN_TOOL_PEN;
101 wacom->id[0] = STYLUS_DEVICE_ID;
103 wacom_report_key(wcombo, wacom->tool[1], prox); /* report in proximity for tool */
104 wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); /* report tool id */
105 wacom_report_abs(wcombo, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14));
106 wacom_report_abs(wcombo, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14));
107 wacom_report_abs(wcombo, ABS_PRESSURE, pressure);
109 wacom_report_key(wcombo, BTN_TOUCH, data[4] & 0x08);
110 wacom_report_key(wcombo, BTN_STYLUS, data[4] & 0x10);
111 /* Only allow the stylus2 button to be reported for the pen tool. */
112 wacom_report_key(wcombo, BTN_STYLUS2, (wacom->tool[1] == BTN_TOOL_PEN) && (data[4] & 0x20));
114 /* report proximity-out of a (valid) tool */
115 if (wacom->tool[1] != BTN_TOOL_RUBBER) {
116 /* Unknown tool selected default to pen tool */
117 wacom->tool[1] = BTN_TOOL_PEN;
119 wacom_report_key(wcombo, wacom->tool[1], prox);
122 wacom->tool[0] = prox; /* Save proximity state */
126 static int wacom_ptu_irq(struct wacom_wac *wacom, void *wcombo)
128 unsigned char *data = wacom->data;
130 if (data[0] != WACOM_REPORT_PENABLED) {
131 printk(KERN_INFO "wacom_ptu_irq: received unknown report #%d\n", data[0]);
135 if (data[1] & 0x04) {
136 wacom_report_key(wcombo, BTN_TOOL_RUBBER, data[1] & 0x20);
137 wacom_report_key(wcombo, BTN_TOUCH, data[1] & 0x08);
138 wacom->id[0] = ERASER_DEVICE_ID;
140 wacom_report_key(wcombo, BTN_TOOL_PEN, data[1] & 0x20);
141 wacom_report_key(wcombo, BTN_TOUCH, data[1] & 0x01);
142 wacom->id[0] = STYLUS_DEVICE_ID;
144 wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); /* report tool id */
145 wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[2]));
146 wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[4]));
147 wacom_report_abs(wcombo, ABS_PRESSURE, wacom_le16_to_cpu(&data[6]));
148 wacom_report_key(wcombo, BTN_STYLUS, data[1] & 0x02);
149 wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 0x10);
153 static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
155 unsigned char *data = wacom->data;
157 static int penData = 0;
159 if (data[0] != WACOM_REPORT_PENABLED) {
160 dbg("wacom_graphire_irq: received unknown report #%d", data[0]);
164 if (data[1] & 0x80) {
165 /* in prox and not a pad data */
168 switch ((data[1] >> 5) & 3) {
171 wacom->tool[0] = BTN_TOOL_PEN;
172 wacom->id[0] = STYLUS_DEVICE_ID;
176 wacom->tool[0] = BTN_TOOL_RUBBER;
177 wacom->id[0] = ERASER_DEVICE_ID;
180 case 2: /* Mouse with wheel */
181 wacom_report_key(wcombo, BTN_MIDDLE, data[1] & 0x04);
182 if (wacom->features->type == WACOM_G4 ||
183 wacom->features->type == WACOM_MO) {
184 rw = data[7] & 0x04 ? (data[7] & 0x03)-4 : (data[7] & 0x03);
185 wacom_report_rel(wcombo, REL_WHEEL, -rw);
187 wacom_report_rel(wcombo, REL_WHEEL, -(signed char) data[6]);
190 case 3: /* Mouse without wheel */
191 wacom->tool[0] = BTN_TOOL_MOUSE;
192 wacom->id[0] = CURSOR_DEVICE_ID;
193 wacom_report_key(wcombo, BTN_LEFT, data[1] & 0x01);
194 wacom_report_key(wcombo, BTN_RIGHT, data[1] & 0x02);
195 if (wacom->features->type == WACOM_G4 ||
196 wacom->features->type == WACOM_MO)
197 wacom_report_abs(wcombo, ABS_DISTANCE, data[6] & 0x3f);
199 wacom_report_abs(wcombo, ABS_DISTANCE, data[7] & 0x3f);
202 x = wacom_le16_to_cpu(&data[2]);
203 y = wacom_le16_to_cpu(&data[4]);
204 wacom_report_abs(wcombo, ABS_X, x);
205 wacom_report_abs(wcombo, ABS_Y, y);
206 if (wacom->tool[0] != BTN_TOOL_MOUSE) {
207 wacom_report_abs(wcombo, ABS_PRESSURE, data[6] | ((data[7] & 0x01) << 8));
208 wacom_report_key(wcombo, BTN_TOUCH, data[1] & 0x01);
209 wacom_report_key(wcombo, BTN_STYLUS, data[1] & 0x02);
210 wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 0x04);
212 wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); /* report tool id */
213 wacom_report_key(wcombo, wacom->tool[0], 1);
214 } else if (wacom->id[0]) {
215 wacom_report_abs(wcombo, ABS_X, 0);
216 wacom_report_abs(wcombo, ABS_Y, 0);
217 if (wacom->tool[0] == BTN_TOOL_MOUSE) {
218 wacom_report_key(wcombo, BTN_LEFT, 0);
219 wacom_report_key(wcombo, BTN_RIGHT, 0);
220 wacom_report_abs(wcombo, ABS_DISTANCE, 0);
222 wacom_report_abs(wcombo, ABS_PRESSURE, 0);
223 wacom_report_key(wcombo, BTN_TOUCH, 0);
224 wacom_report_key(wcombo, BTN_STYLUS, 0);
225 wacom_report_key(wcombo, BTN_STYLUS2, 0);
228 wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */
229 wacom_report_key(wcombo, wacom->tool[0], 0);
233 switch (wacom->features->type) {
235 if (data[7] & 0xf8) {
237 wacom_input_sync(wcombo); /* sync last event */
241 wacom->id[1] = PAD_DEVICE_ID;
242 wacom_report_key(wcombo, BTN_0, (data[7] & 0x40));
243 wacom_report_key(wcombo, BTN_4, (data[7] & 0x80));
244 rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3);
245 wacom_report_rel(wcombo, REL_WHEEL, rw);
246 wacom_report_key(wcombo, BTN_TOOL_FINGER, 0xf0);
247 wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]);
248 wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
249 } else if (wacom->id[1]) {
251 wacom_input_sync(wcombo); /* sync last event */
256 wacom_report_key(wcombo, BTN_0, (data[7] & 0x40));
257 wacom_report_key(wcombo, BTN_4, (data[7] & 0x80));
258 wacom_report_rel(wcombo, REL_WHEEL, 0);
259 wacom_report_key(wcombo, BTN_TOOL_FINGER, 0);
260 wacom_report_abs(wcombo, ABS_MISC, 0);
261 wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
265 if ((data[7] & 0xf8) || (data[8] & 0xff)) {
267 wacom_input_sync(wcombo); /* sync last event */
271 wacom->id[1] = PAD_DEVICE_ID;
272 wacom_report_key(wcombo, BTN_0, (data[7] & 0x08));
273 wacom_report_key(wcombo, BTN_1, (data[7] & 0x20));
274 wacom_report_key(wcombo, BTN_4, (data[7] & 0x10));
275 wacom_report_key(wcombo, BTN_5, (data[7] & 0x40));
276 wacom_report_abs(wcombo, ABS_WHEEL, (data[8] & 0x7f));
277 wacom_report_key(wcombo, BTN_TOOL_FINGER, 0xf0);
278 wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]);
279 wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
280 } else if (wacom->id[1]) {
282 wacom_input_sync(wcombo); /* sync last event */
287 wacom_report_key(wcombo, BTN_0, (data[7] & 0x08));
288 wacom_report_key(wcombo, BTN_1, (data[7] & 0x20));
289 wacom_report_key(wcombo, BTN_4, (data[7] & 0x10));
290 wacom_report_key(wcombo, BTN_5, (data[7] & 0x40));
291 wacom_report_abs(wcombo, ABS_WHEEL, (data[8] & 0x7f));
292 wacom_report_key(wcombo, BTN_TOOL_FINGER, 0);
293 wacom_report_abs(wcombo, ABS_MISC, 0);
294 wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
301 static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo)
303 unsigned char *data = wacom->data;
307 if (wacom->features->type == INTUOS)
308 idx = data[1] & 0x01;
311 if ((data[1] & 0xfc) == 0xc0) {
312 /* serial number of the tool */
313 wacom->serial[idx] = ((data[3] & 0x0f) << 28) +
314 (data[4] << 20) + (data[5] << 12) +
315 (data[6] << 4) + (data[7] >> 4);
317 wacom->id[idx] = (data[2] << 4) | (data[3] >> 4);
318 switch (wacom->id[idx]) {
319 case 0x812: /* Inking pen */
320 case 0x801: /* Intuos3 Inking pen */
321 case 0x20802: /* Intuos4 Classic Pen */
323 wacom->tool[idx] = BTN_TOOL_PENCIL;
325 case 0x822: /* Pen */
328 case 0x823: /* Intuos3 Grip Pen */
329 case 0x813: /* Intuos3 Classic Pen */
330 case 0x885: /* Intuos3 Marker Pen */
331 case 0x802: /* Intuos4 Grip Pen Eraser */
332 case 0x804: /* Intuos4 Marker Pen */
333 case 0x40802: /* Intuos4 Classic Pen */
335 wacom->tool[idx] = BTN_TOOL_PEN;
337 case 0x832: /* Stroke pen */
339 wacom->tool[idx] = BTN_TOOL_BRUSH;
341 case 0x007: /* Mouse 4D and 2D */
344 case 0x017: /* Intuos3 2D Mouse */
345 case 0x806: /* Intuos4 Mouse */
346 wacom->tool[idx] = BTN_TOOL_MOUSE;
348 case 0x096: /* Lens cursor */
349 case 0x097: /* Intuos3 Lens cursor */
350 case 0x006: /* Intuos4 Lens cursor */
351 wacom->tool[idx] = BTN_TOOL_LENS;
353 case 0x82a: /* Eraser */
358 case 0x82b: /* Intuos3 Grip Pen Eraser */
359 case 0x81b: /* Intuos3 Classic Pen Eraser */
360 case 0x91b: /* Intuos3 Airbrush Eraser */
361 case 0x80c: /* Intuos4 Marker Pen Eraser */
362 case 0x80a: /* Intuos4 Grip Pen Eraser */
363 case 0x4080a: /* Intuos4 Classic Pen Eraser */
364 case 0x90a: /* Intuos4 Airbrush Eraser */
365 wacom->tool[idx] = BTN_TOOL_RUBBER;
370 case 0x913: /* Intuos3 Airbrush */
371 case 0x902: /* Intuos4 Airbrush */
372 wacom->tool[idx] = BTN_TOOL_AIRBRUSH;
374 default: /* Unknown tool */
375 wacom->tool[idx] = BTN_TOOL_PEN;
381 if ((data[1] & 0xfe) == 0x80) {
383 * Reset all states otherwise we lose the initial states
384 * when in-prox next time
386 wacom_report_abs(wcombo, ABS_X, 0);
387 wacom_report_abs(wcombo, ABS_Y, 0);
388 wacom_report_abs(wcombo, ABS_DISTANCE, 0);
389 wacom_report_abs(wcombo, ABS_TILT_X, 0);
390 wacom_report_abs(wcombo, ABS_TILT_Y, 0);
391 if (wacom->tool[idx] >= BTN_TOOL_MOUSE) {
392 wacom_report_key(wcombo, BTN_LEFT, 0);
393 wacom_report_key(wcombo, BTN_MIDDLE, 0);
394 wacom_report_key(wcombo, BTN_RIGHT, 0);
395 wacom_report_key(wcombo, BTN_SIDE, 0);
396 wacom_report_key(wcombo, BTN_EXTRA, 0);
397 wacom_report_abs(wcombo, ABS_THROTTLE, 0);
398 wacom_report_abs(wcombo, ABS_RZ, 0);
400 wacom_report_abs(wcombo, ABS_PRESSURE, 0);
401 wacom_report_key(wcombo, BTN_STYLUS, 0);
402 wacom_report_key(wcombo, BTN_STYLUS2, 0);
403 wacom_report_key(wcombo, BTN_TOUCH, 0);
404 wacom_report_abs(wcombo, ABS_WHEEL, 0);
405 if (wacom->features->type >= INTUOS3S)
406 wacom_report_abs(wcombo, ABS_Z, 0);
408 wacom_report_key(wcombo, wacom->tool[idx], 0);
409 wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */
410 wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
417 static void wacom_intuos_general(struct wacom_wac *wacom, void *wcombo)
419 unsigned char *data = wacom->data;
422 /* general pen packet */
423 if ((data[1] & 0xb8) == 0xa0) {
424 t = (data[6] << 2) | ((data[7] >> 6) & 3);
425 if (wacom->features->type >= INTUOS4S && wacom->features->type <= INTUOS4L)
426 t = (t << 1) | (data[1] & 1);
427 wacom_report_abs(wcombo, ABS_PRESSURE, t);
428 wacom_report_abs(wcombo, ABS_TILT_X,
429 ((data[7] << 1) & 0x7e) | (data[8] >> 7));
430 wacom_report_abs(wcombo, ABS_TILT_Y, data[8] & 0x7f);
431 wacom_report_key(wcombo, BTN_STYLUS, data[1] & 2);
432 wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 4);
433 wacom_report_key(wcombo, BTN_TOUCH, t > 10);
436 /* airbrush second packet */
437 if ((data[1] & 0xbc) == 0xb4) {
438 wacom_report_abs(wcombo, ABS_WHEEL,
439 (data[6] << 2) | ((data[7] >> 6) & 3));
440 wacom_report_abs(wcombo, ABS_TILT_X,
441 ((data[7] << 1) & 0x7e) | (data[8] >> 7));
442 wacom_report_abs(wcombo, ABS_TILT_Y, data[8] & 0x7f);
447 static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
449 unsigned char *data = wacom->data;
453 if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_INTUOSREAD
454 && data[0] != WACOM_REPORT_INTUOSWRITE && data[0] != WACOM_REPORT_INTUOSPAD) {
455 dbg("wacom_intuos_irq: received unknown report #%d", data[0]);
460 if (wacom->features->type == INTUOS)
461 idx = data[1] & 0x01;
463 /* pad packets. Works as a second tool and is always in prox */
464 if (data[0] == WACOM_REPORT_INTUOSPAD) {
465 /* initiate the pad as a device */
466 if (wacom->tool[1] != BTN_TOOL_FINGER)
467 wacom->tool[1] = BTN_TOOL_FINGER;
469 if (wacom->features->type >= INTUOS4S && wacom->features->type <= INTUOS4L) {
470 wacom_report_key(wcombo, BTN_0, (data[2] & 0x01));
471 wacom_report_key(wcombo, BTN_1, (data[3] & 0x01));
472 wacom_report_key(wcombo, BTN_2, (data[3] & 0x02));
473 wacom_report_key(wcombo, BTN_3, (data[3] & 0x04));
474 wacom_report_key(wcombo, BTN_4, (data[3] & 0x08));
475 wacom_report_key(wcombo, BTN_5, (data[3] & 0x10));
476 wacom_report_key(wcombo, BTN_6, (data[3] & 0x20));
477 if (data[1] & 0x80) {
478 wacom_report_abs(wcombo, ABS_WHEEL, (data[1] & 0x7f));
480 /* Out of proximity, clear wheel value. */
481 wacom_report_abs(wcombo, ABS_WHEEL, 0);
483 if (wacom->features->type != INTUOS4S) {
484 wacom_report_key(wcombo, BTN_7, (data[3] & 0x40));
485 wacom_report_key(wcombo, BTN_8, (data[3] & 0x80));
487 if (data[1] | (data[2] & 0x01) | data[3]) {
488 wacom_report_key(wcombo, wacom->tool[1], 1);
489 wacom_report_abs(wcombo, ABS_MISC, PAD_DEVICE_ID);
491 wacom_report_key(wcombo, wacom->tool[1], 0);
492 wacom_report_abs(wcombo, ABS_MISC, 0);
495 wacom_report_key(wcombo, BTN_0, (data[5] & 0x01));
496 wacom_report_key(wcombo, BTN_1, (data[5] & 0x02));
497 wacom_report_key(wcombo, BTN_2, (data[5] & 0x04));
498 wacom_report_key(wcombo, BTN_3, (data[5] & 0x08));
499 wacom_report_key(wcombo, BTN_4, (data[6] & 0x01));
500 wacom_report_key(wcombo, BTN_5, (data[6] & 0x02));
501 wacom_report_key(wcombo, BTN_6, (data[6] & 0x04));
502 wacom_report_key(wcombo, BTN_7, (data[6] & 0x08));
503 wacom_report_key(wcombo, BTN_8, (data[5] & 0x10));
504 wacom_report_key(wcombo, BTN_9, (data[6] & 0x10));
505 wacom_report_abs(wcombo, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);
506 wacom_report_abs(wcombo, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);
508 if ((data[5] & 0x1f) | (data[6] & 0x1f) | (data[1] & 0x1f) |
509 data[2] | (data[3] & 0x1f) | data[4]) {
510 wacom_report_key(wcombo, wacom->tool[1], 1);
511 wacom_report_abs(wcombo, ABS_MISC, PAD_DEVICE_ID);
513 wacom_report_key(wcombo, wacom->tool[1], 0);
514 wacom_report_abs(wcombo, ABS_MISC, 0);
517 wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xffffffff);
521 /* process in/out prox events */
522 result = wacom_intuos_inout(wacom, wcombo);
526 /* don't proceed if we don't know the ID */
530 /* Only large Intuos support Lense Cursor */
531 if ((wacom->tool[idx] == BTN_TOOL_LENS)
532 && ((wacom->features->type == INTUOS3)
533 || (wacom->features->type == INTUOS3S)
534 || (wacom->features->type == INTUOS4)
535 || (wacom->features->type == INTUOS4S)))
538 /* Cintiq doesn't send data when RDY bit isn't set */
539 if ((wacom->features->type == CINTIQ) && !(data[1] & 0x40))
542 if (wacom->features->type >= INTUOS3S) {
543 wacom_report_abs(wcombo, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1));
544 wacom_report_abs(wcombo, ABS_Y, (data[4] << 9) | (data[5] << 1) | (data[9] & 1));
545 wacom_report_abs(wcombo, ABS_DISTANCE, ((data[9] >> 2) & 0x3f));
547 wacom_report_abs(wcombo, ABS_X, wacom_be16_to_cpu(&data[2]));
548 wacom_report_abs(wcombo, ABS_Y, wacom_be16_to_cpu(&data[4]));
549 wacom_report_abs(wcombo, ABS_DISTANCE, ((data[9] >> 3) & 0x1f));
552 /* process general packets */
553 wacom_intuos_general(wacom, wcombo);
555 /* 4D mouse, 2D mouse, marker pen rotation, tilt mouse, or Lens cursor packets */
556 if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0 || (data[1] & 0xbc) == 0xac) {
558 if (data[1] & 0x02) {
559 /* Rotation packet */
560 if (wacom->features->type >= INTUOS3S) {
561 /* I3 marker pen rotation */
562 t = (data[6] << 3) | ((data[7] >> 5) & 7);
563 t = (data[7] & 0x20) ? ((t > 900) ? ((t-1) / 2 - 1350) :
564 ((t-1) / 2 + 450)) : (450 - t / 2) ;
565 wacom_report_abs(wcombo, ABS_Z, t);
567 /* 4D mouse rotation packet */
568 t = (data[6] << 3) | ((data[7] >> 5) & 7);
569 wacom_report_abs(wcombo, ABS_RZ, (data[7] & 0x20) ?
570 ((t - 1) / 2) : -t / 2);
573 } else if (!(data[1] & 0x10) && wacom->features->type < INTUOS3S) {
574 /* 4D mouse packet */
575 wacom_report_key(wcombo, BTN_LEFT, data[8] & 0x01);
576 wacom_report_key(wcombo, BTN_MIDDLE, data[8] & 0x02);
577 wacom_report_key(wcombo, BTN_RIGHT, data[8] & 0x04);
579 wacom_report_key(wcombo, BTN_SIDE, data[8] & 0x20);
580 wacom_report_key(wcombo, BTN_EXTRA, data[8] & 0x10);
581 t = (data[6] << 2) | ((data[7] >> 6) & 3);
582 wacom_report_abs(wcombo, ABS_THROTTLE, (data[8] & 0x08) ? -t : t);
584 } else if (wacom->tool[idx] == BTN_TOOL_MOUSE) {
586 if (wacom->features->type >= INTUOS4S && wacom->features->type <= INTUOS4L) {
587 wacom_report_key(wcombo, BTN_LEFT, data[6] & 0x01);
588 wacom_report_key(wcombo, BTN_MIDDLE, data[6] & 0x02);
589 wacom_report_key(wcombo, BTN_RIGHT, data[6] & 0x04);
590 wacom_report_rel(wcombo, REL_WHEEL, ((data[7] & 0x80) >> 7)
591 - ((data[7] & 0x40) >> 6));
592 wacom_report_key(wcombo, BTN_SIDE, data[6] & 0x08);
593 wacom_report_key(wcombo, BTN_EXTRA, data[6] & 0x10);
595 wacom_report_abs(wcombo, ABS_TILT_X,
596 ((data[7] << 1) & 0x7e) | (data[8] >> 7));
597 wacom_report_abs(wcombo, ABS_TILT_Y, data[8] & 0x7f);
599 /* 2D mouse packet */
600 wacom_report_key(wcombo, BTN_LEFT, data[8] & 0x04);
601 wacom_report_key(wcombo, BTN_MIDDLE, data[8] & 0x08);
602 wacom_report_key(wcombo, BTN_RIGHT, data[8] & 0x10);
603 wacom_report_rel(wcombo, REL_WHEEL, (data[8] & 0x01)
604 - ((data[8] & 0x02) >> 1));
606 /* I3 2D mouse side buttons */
607 if (wacom->features->type >= INTUOS3S && wacom->features->type <= INTUOS3L) {
608 wacom_report_key(wcombo, BTN_SIDE, data[8] & 0x40);
609 wacom_report_key(wcombo, BTN_EXTRA, data[8] & 0x20);
612 } else if ((wacom->features->type < INTUOS3S || wacom->features->type == INTUOS3L ||
613 wacom->features->type == INTUOS4L) &&
614 wacom->tool[idx] == BTN_TOOL_LENS) {
615 /* Lens cursor packets */
616 wacom_report_key(wcombo, BTN_LEFT, data[8] & 0x01);
617 wacom_report_key(wcombo, BTN_MIDDLE, data[8] & 0x02);
618 wacom_report_key(wcombo, BTN_RIGHT, data[8] & 0x04);
619 wacom_report_key(wcombo, BTN_SIDE, data[8] & 0x10);
620 wacom_report_key(wcombo, BTN_EXTRA, data[8] & 0x08);
624 wacom_report_abs(wcombo, ABS_MISC, wacom->id[idx]); /* report tool id */
625 wacom_report_key(wcombo, wacom->tool[idx], 1);
626 wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
631 static void wacom_tpc_finger_in(struct wacom_wac *wacom, void *wcombo, char *data, int idx)
633 wacom_report_abs(wcombo, ABS_X,
634 (data[2 + idx * 2] & 0xff) | ((data[3 + idx * 2] & 0x7f) << 8));
635 wacom_report_abs(wcombo, ABS_Y,
636 (data[6 + idx * 2] & 0xff) | ((data[7 + idx * 2] & 0x7f) << 8));
637 wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]);
638 wacom_report_key(wcombo, wacom->tool[idx], 1);
640 wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
642 wacom_report_key(wcombo, BTN_TOUCH, 1);
645 static void wacom_tpc_touch_out(struct wacom_wac *wacom, void *wcombo, int idx)
647 wacom_report_abs(wcombo, ABS_X, 0);
648 wacom_report_abs(wcombo, ABS_Y, 0);
649 wacom_report_abs(wcombo, ABS_MISC, 0);
650 wacom_report_key(wcombo, wacom->tool[idx], 0);
652 wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0);
654 wacom_report_key(wcombo, BTN_TOUCH, 0);
658 static void wacom_tpc_touch_in(struct wacom_wac *wacom, void *wcombo)
660 char *data = wacom->data;
661 struct urb *urb = ((struct wacom_combo *)wcombo)->urb;
662 static int firstFinger = 0;
663 static int secondFinger = 0;
665 wacom->tool[0] = BTN_TOOL_DOUBLETAP;
666 wacom->id[0] = TOUCH_DEVICE_ID;
667 wacom->tool[1] = BTN_TOOL_TRIPLETAP;
669 if (urb->actual_length != WACOM_PKGLEN_TPC1FG) {
671 case WACOM_REPORT_TPC1FG:
672 wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[2]));
673 wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[4]));
674 wacom_report_abs(wcombo, ABS_PRESSURE, wacom_le16_to_cpu(&data[6]));
675 wacom_report_key(wcombo, BTN_TOUCH, wacom_le16_to_cpu(&data[6]));
676 wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]);
677 wacom_report_key(wcombo, wacom->tool[0], 1);
679 case WACOM_REPORT_TPC2FG:
680 /* keep this byte to send proper out-prox event */
681 wacom->id[1] = data[1] & 0x03;
683 if (data[1] & 0x01) {
684 wacom_tpc_finger_in(wacom, wcombo, data, 0);
686 } else if (firstFinger) {
687 wacom_tpc_touch_out(wacom, wcombo, 0);
690 if (data[1] & 0x02) {
691 /* sync first finger data */
693 wacom_input_sync(wcombo);
695 wacom_tpc_finger_in(wacom, wcombo, data, 1);
697 } else if (secondFinger) {
698 /* sync first finger data */
700 wacom_input_sync(wcombo);
702 wacom_tpc_touch_out(wacom, wcombo, 1);
705 if (!(data[1] & 0x01))
710 wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[1]));
711 wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[3]));
712 wacom_report_key(wcombo, BTN_TOUCH, 1);
713 wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]);
714 wacom_report_key(wcombo, wacom->tool[0], 1);
719 static int wacom_tpc_irq(struct wacom_wac *wacom, void *wcombo)
721 char *data = wacom->data;
722 int prox = 0, pressure, idx = -1;
723 static int stylusInProx, touchInProx = 1, touchOut;
724 struct urb *urb = ((struct wacom_combo *)wcombo)->urb;
726 dbg("wacom_tpc_irq: received report #%d", data[0]);
728 if (urb->actual_length == WACOM_PKGLEN_TPC1FG || /* single touch */
729 data[0] == WACOM_REPORT_TPC1FG || /* single touch */
730 data[0] == WACOM_REPORT_TPC2FG) { /* 2FG touch */
731 if (urb->actual_length == WACOM_PKGLEN_TPC1FG) { /* with touch */
732 prox = data[0] & 0x01;
733 } else { /* with capacity */
734 if (data[0] == WACOM_REPORT_TPC1FG)
736 prox = data[1] & 0x01;
739 prox = data[1] & 0x03;
742 if (!stylusInProx) { /* stylus not in prox */
745 wacom_tpc_touch_in(wacom, wcombo);
751 if (data[0] == WACOM_REPORT_TPC2FG) {
752 idx = (wacom->id[1] & 0x01) - 1;
754 wacom_tpc_touch_out(wacom, wcombo, idx);
755 /* sync first finger event */
756 if (wacom->id[1] & 0x02)
757 wacom_input_sync(wcombo);
759 idx = (wacom->id[1] & 0x02) - 1;
761 wacom_tpc_touch_out(wacom, wcombo, idx);
762 } else /* one finger touch */
763 wacom_tpc_touch_out(wacom, wcombo, 0);
768 } else if (touchOut || !prox) { /* force touch out-prox */
769 wacom_tpc_touch_out(wacom, wcombo, 0);
774 } else if (data[0] == WACOM_REPORT_PENABLED) { /* Penabled */
775 prox = data[1] & 0x20;
779 if (prox) { /* in prox */
781 /* Going into proximity select tool */
782 wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;
783 if (wacom->tool[0] == BTN_TOOL_PEN)
784 wacom->id[0] = STYLUS_DEVICE_ID;
786 wacom->id[0] = ERASER_DEVICE_ID;
788 wacom_report_key(wcombo, BTN_STYLUS, data[1] & 0x02);
789 wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 0x10);
790 wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[2]));
791 wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[4]));
792 pressure = ((data[7] & 0x01) << 8) | data[6];
794 pressure = wacom->features->pressure_max + pressure + 1;
795 wacom_report_abs(wcombo, ABS_PRESSURE, pressure);
796 wacom_report_key(wcombo, BTN_TOUCH, data[1] & 0x05);
798 wacom_report_abs(wcombo, ABS_X, 0);
799 wacom_report_abs(wcombo, ABS_Y, 0);
800 wacom_report_abs(wcombo, ABS_PRESSURE, 0);
801 wacom_report_key(wcombo, BTN_STYLUS, 0);
802 wacom_report_key(wcombo, BTN_STYLUS2, 0);
803 wacom_report_key(wcombo, BTN_TOUCH, 0);
805 /* pen is out so touch can be enabled now */
808 wacom_report_key(wcombo, wacom->tool[0], prox);
809 wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]);
816 int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo)
818 switch (wacom_wac->features->type) {
820 return wacom_penpartner_irq(wacom_wac, wcombo);
823 return wacom_pl_irq(wacom_wac, wcombo);
828 return wacom_graphire_irq(wacom_wac, wcombo);
831 return wacom_ptu_irq(wacom_wac, wcombo);
842 return wacom_intuos_irq(wacom_wac, wcombo);
846 return wacom_tpc_irq(wacom_wac, wcombo);
854 void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
856 switch (wacom_wac->features->type) {
858 input_dev_mo(input_dev, wacom_wac);
860 input_dev_g4(input_dev, wacom_wac);
863 input_dev_g(input_dev, wacom_wac);
866 input_dev_bee(input_dev, wacom_wac);
870 input_dev_i3(input_dev, wacom_wac);
873 input_dev_i3s(input_dev, wacom_wac);
876 input_dev_i(input_dev, wacom_wac);
880 input_dev_i4(input_dev, wacom_wac);
883 input_dev_i4s(input_dev, wacom_wac);
884 input_dev_i(input_dev, wacom_wac);
887 input_dev_tpc2fg(input_dev, wacom_wac);
890 input_dev_tpc(input_dev, wacom_wac);
891 if (wacom_wac->features->device_type != BTN_TOOL_PEN)
892 break; /* no need to process stylus stuff */
897 input_dev_pl(input_dev, wacom_wac);
900 input_dev_pt(input_dev, wacom_wac);
906 static struct wacom_features wacom_features[] = {
907 { "Wacom Penpartner", WACOM_PKGLEN_PENPRTN, 5040, 3780, 255, 0, PENPARTNER },
908 { "Wacom Graphire", WACOM_PKGLEN_GRAPHIRE, 10206, 7422, 511, 63, GRAPHIRE },
909 { "Wacom Graphire2 4x5", WACOM_PKGLEN_GRAPHIRE, 10206, 7422, 511, 63, GRAPHIRE },
910 { "Wacom Graphire2 5x7", WACOM_PKGLEN_GRAPHIRE, 13918, 10206, 511, 63, GRAPHIRE },
911 { "Wacom Graphire3", WACOM_PKGLEN_GRAPHIRE, 10208, 7424, 511, 63, GRAPHIRE },
912 { "Wacom Graphire3 6x8", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511, 63, GRAPHIRE },
913 { "Wacom Graphire4 4x5", WACOM_PKGLEN_GRAPHIRE, 10208, 7424, 511, 63, WACOM_G4 },
914 { "Wacom Graphire4 6x8", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511, 63, WACOM_G4 },
915 { "Wacom BambooFun 4x5", WACOM_PKGLEN_BBFUN, 14760, 9225, 511, 63, WACOM_MO },
916 { "Wacom BambooFun 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 511, 63, WACOM_MO },
917 { "Wacom Bamboo1 Medium", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511, 63, GRAPHIRE },
918 { "Wacom Volito", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511, 63, GRAPHIRE },
919 { "Wacom PenStation2", WACOM_PKGLEN_GRAPHIRE, 3250, 2320, 255, 63, GRAPHIRE },
920 { "Wacom Volito2 4x5", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511, 63, GRAPHIRE },
921 { "Wacom Volito2 2x3", WACOM_PKGLEN_GRAPHIRE, 3248, 2320, 511, 63, GRAPHIRE },
922 { "Wacom PenPartner2", WACOM_PKGLEN_GRAPHIRE, 3250, 2320, 511, 63, GRAPHIRE },
923 { "Wacom Bamboo", WACOM_PKGLEN_BBFUN, 14760, 9225, 511, 63, WACOM_MO },
924 { "Wacom Bamboo1", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511, 63, GRAPHIRE },
925 { "Wacom Intuos 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023, 31, INTUOS },
926 { "Wacom Intuos 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 31, INTUOS },
927 { "Wacom Intuos 9x12", WACOM_PKGLEN_INTUOS, 30480, 24060, 1023, 31, INTUOS },
928 { "Wacom Intuos 12x12", WACOM_PKGLEN_INTUOS, 30480, 31680, 1023, 31, INTUOS },
929 { "Wacom Intuos 12x18", WACOM_PKGLEN_INTUOS, 45720, 31680, 1023, 31, INTUOS },
930 { "Wacom PL400", WACOM_PKGLEN_GRAPHIRE, 5408, 4056, 255, 0, PL },
931 { "Wacom PL500", WACOM_PKGLEN_GRAPHIRE, 6144, 4608, 255, 0, PL },
932 { "Wacom PL600", WACOM_PKGLEN_GRAPHIRE, 6126, 4604, 255, 0, PL },
933 { "Wacom PL600SX", WACOM_PKGLEN_GRAPHIRE, 6260, 5016, 255, 0, PL },
934 { "Wacom PL550", WACOM_PKGLEN_GRAPHIRE, 6144, 4608, 511, 0, PL },
935 { "Wacom PL800", WACOM_PKGLEN_GRAPHIRE, 7220, 5780, 511, 0, PL },
936 { "Wacom PL700", WACOM_PKGLEN_GRAPHIRE, 6758, 5406, 511, 0, PL },
937 { "Wacom PL510", WACOM_PKGLEN_GRAPHIRE, 6282, 4762, 511, 0, PL },
938 { "Wacom DTU710", WACOM_PKGLEN_GRAPHIRE, 34080, 27660, 511, 0, PL },
939 { "Wacom DTF521", WACOM_PKGLEN_GRAPHIRE, 6282, 4762, 511, 0, PL },
940 { "Wacom DTF720", WACOM_PKGLEN_GRAPHIRE, 6858, 5506, 511, 0, PL },
941 { "Wacom DTF720a", WACOM_PKGLEN_GRAPHIRE, 6858, 5506, 511, 0, PL },
942 { "Wacom Cintiq Partner", WACOM_PKGLEN_GRAPHIRE, 20480, 15360, 511, 0, PTU },
943 { "Wacom Intuos2 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023, 31, INTUOS },
944 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 31, INTUOS },
945 { "Wacom Intuos2 9x12", WACOM_PKGLEN_INTUOS, 30480, 24060, 1023, 31, INTUOS },
946 { "Wacom Intuos2 12x12", WACOM_PKGLEN_INTUOS, 30480, 31680, 1023, 31, INTUOS },
947 { "Wacom Intuos2 12x18", WACOM_PKGLEN_INTUOS, 45720, 31680, 1023, 31, INTUOS },
948 { "Wacom Intuos3 4x5", WACOM_PKGLEN_INTUOS, 25400, 20320, 1023, 63, INTUOS3S },
949 { "Wacom Intuos3 6x8", WACOM_PKGLEN_INTUOS, 40640, 30480, 1023, 63, INTUOS3 },
950 { "Wacom Intuos3 9x12", WACOM_PKGLEN_INTUOS, 60960, 45720, 1023, 63, INTUOS3 },
951 { "Wacom Intuos3 12x12", WACOM_PKGLEN_INTUOS, 60960, 60960, 1023, 63, INTUOS3L },
952 { "Wacom Intuos3 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 1023, 63, INTUOS3L },
953 { "Wacom Intuos3 6x11", WACOM_PKGLEN_INTUOS, 54204, 31750, 1023, 63, INTUOS3 },
954 { "Wacom Intuos3 4x6", WACOM_PKGLEN_INTUOS, 31496, 19685, 1023, 63, INTUOS3S },
955 { "Wacom Intuos4 4x6", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, 63, INTUOS4S },
956 { "Wacom Intuos4 6x9", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, 63, INTUOS4 },
957 { "Wacom Intuos4 8x13", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047, 63, INTUOS4L },
958 { "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047, 63, INTUOS4L },
959 { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023, 63, CINTIQ },
960 { "Wacom Cintiq 20WSX", WACOM_PKGLEN_INTUOS, 86680, 54180, 1023, 63, WACOM_BEE },
961 { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023, 63, WACOM_BEE },
962 { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511, 0, PL },
963 { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC },
964 { "Wacom ISDv4 93", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC },
965 { "Wacom ISDv4 9A", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC },
966 { "Wacom ISDv4 9F", WACOM_PKGLEN_PENABLED, 26202, 16325, 255, 0, TABLETPC },
967 { "Wacom ISDv4 E2", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, 0, TABLETPC2FG },
968 { "Wacom ISDv4 E3", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, 0, TABLETPC2FG },
969 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 31, INTUOS },
973 static struct usb_device_id wacom_ids[] = {
974 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x00) },
975 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x10) },
976 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x11) },
977 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x12) },
978 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x13) },
979 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x14) },
980 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x15) },
981 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x16) },
982 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x17) },
983 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x18) },
984 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x19) },
985 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x60) },
986 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x61) },
987 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x62) },
988 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x63) },
989 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x64) },
990 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x65) },
991 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x69) },
992 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x20) },
993 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x21) },
994 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x22) },
995 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x23) },
996 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x24) },
997 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x30) },
998 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x31) },
999 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x32) },
1000 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x33) },
1001 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x34) },
1002 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x35) },
1003 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x37) },
1004 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x38) },
1005 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x39) },
1006 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC4) },
1007 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC0) },
1008 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC2) },
1009 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) },
1010 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x41) },
1011 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x42) },
1012 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x43) },
1013 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x44) },
1014 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x45) },
1015 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB0) },
1016 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB1) },
1017 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB2) },
1018 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB3) },
1019 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB4) },
1020 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) },
1021 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB7) },
1022 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB8) },
1023 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB9) },
1024 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xBA) },
1025 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xBB) },
1026 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) },
1027 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC5) },
1028 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC6) },
1029 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC7) },
1030 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x90) },
1031 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x93) },
1032 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x9A) },
1033 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x9F) },
1034 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xE2) },
1035 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xE3) },
1036 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) },
1040 const struct usb_device_id *get_device_table(void)
1042 const struct usb_device_id *id_table = wacom_ids;
1047 struct wacom_features * get_wacom_feature(const struct usb_device_id *id)
1049 int index = id - wacom_ids;
1050 struct wacom_features *wf = &wacom_features[index];
1055 MODULE_DEVICE_TABLE(usb, wacom_ids);