diff options
author | Ping Cheng <pingc@wacom.com> | 2006-03-29 19:33:49 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-04-14 14:12:22 -0400 |
commit | 7d3fe085f9cdd3d3eea0154ea02e2f6b4a8f3974 (patch) | |
tree | d5ccc9e457cd9abba9844f9e1562262ec74e5363 /drivers/usb/input | |
parent | aafe5bd6ec341edfaf3233d272febbb8862a7251 (diff) |
[PATCH] USB: wacom tablet driver update
This patch adds support for DTF 521, Intuos3 12x12, and 12x19;
fixes minor data report bugs.
Signed-off-by: Ping Cheng <pingc@wacom.com>
Acked-by: Vojtech Pavlik <vojtech@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/input')
-rw-r--r-- | drivers/usb/input/wacom.c | 136 |
1 files changed, 87 insertions, 49 deletions
diff --git a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c index d3e15df9e815..cf84c6096f29 100644 --- a/drivers/usb/input/wacom.c +++ b/drivers/usb/input/wacom.c | |||
@@ -9,7 +9,7 @@ | |||
9 | * Copyright (c) 2000 Daniel Egger <egger@suse.de> | 9 | * Copyright (c) 2000 Daniel Egger <egger@suse.de> |
10 | * Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com> | 10 | * Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com> |
11 | * Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be> | 11 | * Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be> |
12 | * Copyright (c) 2002-2005 Ping Cheng <pingc@wacom.com> | 12 | * Copyright (c) 2002-2006 Ping Cheng <pingc@wacom.com> |
13 | * | 13 | * |
14 | * ChangeLog: | 14 | * ChangeLog: |
15 | * v0.1 (vp) - Initial release | 15 | * v0.1 (vp) - Initial release |
@@ -56,6 +56,8 @@ | |||
56 | * - Merged wacom_intuos3_irq into wacom_intuos_irq | 56 | * - Merged wacom_intuos3_irq into wacom_intuos_irq |
57 | * v1.44 (pc) - Added support for Graphire4, Cintiq 710, Intuos3 6x11, etc. | 57 | * v1.44 (pc) - Added support for Graphire4, Cintiq 710, Intuos3 6x11, etc. |
58 | * - Report Device IDs | 58 | * - Report Device IDs |
59 | * v1.45 (pc) - Added support for DTF 521, Intuos3 12x12 and 12x19 | ||
60 | * - Minor data report fix | ||
59 | */ | 61 | */ |
60 | 62 | ||
61 | /* | 63 | /* |
@@ -78,7 +80,7 @@ | |||
78 | /* | 80 | /* |
79 | * Version Information | 81 | * Version Information |
80 | */ | 82 | */ |
81 | #define DRIVER_VERSION "v1.44" | 83 | #define DRIVER_VERSION "v1.45" |
82 | #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" | 84 | #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" |
83 | #define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" | 85 | #define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" |
84 | #define DRIVER_LICENSE "GPL" | 86 | #define DRIVER_LICENSE "GPL" |
@@ -99,6 +101,8 @@ enum { | |||
99 | PL, | 101 | PL, |
100 | INTUOS, | 102 | INTUOS, |
101 | INTUOS3, | 103 | INTUOS3, |
104 | INTUOS312, | ||
105 | INTUOS319, | ||
102 | CINTIQ, | 106 | CINTIQ, |
103 | MAX_TYPE | 107 | MAX_TYPE |
104 | }; | 108 | }; |
@@ -127,7 +131,19 @@ struct wacom { | |||
127 | char phys[32]; | 131 | char phys[32]; |
128 | }; | 132 | }; |
129 | 133 | ||
134 | #define USB_REQ_GET_REPORT 0x01 | ||
130 | #define USB_REQ_SET_REPORT 0x09 | 135 | #define USB_REQ_SET_REPORT 0x09 |
136 | |||
137 | static int usb_get_report(struct usb_interface *intf, unsigned char type, | ||
138 | unsigned char id, void *buf, int size) | ||
139 | { | ||
140 | return usb_control_msg(interface_to_usbdev(intf), | ||
141 | usb_rcvctrlpipe(interface_to_usbdev(intf), 0), | ||
142 | USB_REQ_GET_REPORT, USB_TYPE_CLASS | USB_RECIP_INTERFACE, | ||
143 | (type << 8) + id, intf->altsetting[0].desc.bInterfaceNumber, | ||
144 | buf, size, 100); | ||
145 | } | ||
146 | |||
131 | static int usb_set_report(struct usb_interface *intf, unsigned char type, | 147 | static int usb_set_report(struct usb_interface *intf, unsigned char type, |
132 | unsigned char id, void *buf, int size) | 148 | unsigned char id, void *buf, int size) |
133 | { | 149 | { |
@@ -206,7 +222,8 @@ static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) | |||
206 | wacom->tool[1] = BTN_TOOL_PEN; | 222 | wacom->tool[1] = BTN_TOOL_PEN; |
207 | id = STYLUS_DEVICE_ID; | 223 | id = STYLUS_DEVICE_ID; |
208 | } | 224 | } |
209 | input_report_key(dev, wacom->tool[1], id); /* report in proximity for tool */ | 225 | input_report_key(dev, wacom->tool[1], prox); /* report in proximity for tool */ |
226 | input_report_abs(dev, ABS_MISC, id); /* report tool id */ | ||
210 | input_report_abs(dev, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14)); | 227 | input_report_abs(dev, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14)); |
211 | input_report_abs(dev, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14)); | 228 | input_report_abs(dev, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14)); |
212 | input_report_abs(dev, ABS_PRESSURE, pressure); | 229 | input_report_abs(dev, ABS_PRESSURE, pressure); |
@@ -239,7 +256,7 @@ static void wacom_ptu_irq(struct urb *urb, struct pt_regs *regs) | |||
239 | struct wacom *wacom = urb->context; | 256 | struct wacom *wacom = urb->context; |
240 | unsigned char *data = wacom->data; | 257 | unsigned char *data = wacom->data; |
241 | struct input_dev *dev = wacom->dev; | 258 | struct input_dev *dev = wacom->dev; |
242 | int retval; | 259 | int retval, id; |
243 | 260 | ||
244 | switch (urb->status) { | 261 | switch (urb->status) { |
245 | case 0: | 262 | case 0: |
@@ -263,12 +280,15 @@ static void wacom_ptu_irq(struct urb *urb, struct pt_regs *regs) | |||
263 | 280 | ||
264 | input_regs(dev, regs); | 281 | input_regs(dev, regs); |
265 | if (data[1] & 0x04) { | 282 | if (data[1] & 0x04) { |
266 | input_report_key(dev, BTN_TOOL_RUBBER, (data[1] & 0x20) ? ERASER_DEVICE_ID : 0); | 283 | input_report_key(dev, BTN_TOOL_RUBBER, data[1] & 0x20); |
267 | input_report_key(dev, BTN_TOUCH, data[1] & 0x08); | 284 | input_report_key(dev, BTN_TOUCH, data[1] & 0x08); |
285 | id = ERASER_DEVICE_ID; | ||
268 | } else { | 286 | } else { |
269 | input_report_key(dev, BTN_TOOL_PEN, (data[1] & 0x20) ? STYLUS_DEVICE_ID : 0); | 287 | input_report_key(dev, BTN_TOOL_PEN, data[1] & 0x20); |
270 | input_report_key(dev, BTN_TOUCH, data[1] & 0x01); | 288 | input_report_key(dev, BTN_TOUCH, data[1] & 0x01); |
289 | id = STYLUS_DEVICE_ID; | ||
271 | } | 290 | } |
291 | input_report_abs(dev, ABS_MISC, id); /* report tool id */ | ||
272 | input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[2])); | 292 | input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[2])); |
273 | input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[4])); | 293 | input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[4])); |
274 | input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); | 294 | input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); |
@@ -312,7 +332,8 @@ static void wacom_penpartner_irq(struct urb *urb, struct pt_regs *regs) | |||
312 | } | 332 | } |
313 | 333 | ||
314 | input_regs(dev, regs); | 334 | input_regs(dev, regs); |
315 | input_report_key(dev, BTN_TOOL_PEN, STYLUS_DEVICE_ID); | 335 | input_report_key(dev, BTN_TOOL_PEN, 1); |
336 | input_report_abs(dev, ABS_MISC, STYLUS_DEVICE_ID); /* report tool id */ | ||
316 | input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[1])); | 337 | input_report_abs(dev, ABS_X, le16_to_cpu(*(__le16 *) &data[1])); |
317 | input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[3])); | 338 | input_report_abs(dev, ABS_Y, le16_to_cpu(*(__le16 *) &data[3])); |
318 | input_report_abs(dev, ABS_PRESSURE, (signed char)data[6] + 127); | 339 | input_report_abs(dev, ABS_PRESSURE, (signed char)data[6] + 127); |
@@ -350,6 +371,8 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) | |||
350 | goto exit; | 371 | goto exit; |
351 | } | 372 | } |
352 | 373 | ||
374 | if (data[0] == 99) return; /* for Volito tablets */ | ||
375 | |||
353 | if (data[0] != 2) { | 376 | if (data[0] != 2) { |
354 | dbg("wacom_graphire_irq: received unknown report #%d", data[0]); | 377 | dbg("wacom_graphire_irq: received unknown report #%d", data[0]); |
355 | goto exit; | 378 | goto exit; |
@@ -374,10 +397,10 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) | |||
374 | case 2: /* Mouse with wheel */ | 397 | case 2: /* Mouse with wheel */ |
375 | input_report_key(dev, BTN_MIDDLE, data[1] & 0x04); | 398 | input_report_key(dev, BTN_MIDDLE, data[1] & 0x04); |
376 | if (wacom->features->type == WACOM_G4) { | 399 | if (wacom->features->type == WACOM_G4) { |
377 | rw = data[7] & 0x04 ? -(data[7] & 0x03) : (data[7] & 0x03); | 400 | rw = data[7] & 0x04 ? (data[7] & 0x03)-4 : (data[7] & 0x03); |
378 | input_report_rel(dev, REL_WHEEL, rw); | 401 | input_report_rel(dev, REL_WHEEL, -rw); |
379 | } else | 402 | } else |
380 | input_report_rel(dev, REL_WHEEL, (signed char) data[6]); | 403 | input_report_rel(dev, REL_WHEEL, -(signed char) data[6]); |
381 | /* fall through */ | 404 | /* fall through */ |
382 | 405 | ||
383 | case 3: /* Mouse without wheel */ | 406 | case 3: /* Mouse without wheel */ |
@@ -406,39 +429,27 @@ static void wacom_graphire_irq(struct urb *urb, struct pt_regs *regs) | |||
406 | } | 429 | } |
407 | } | 430 | } |
408 | 431 | ||
409 | input_report_key(dev, wacom->tool[0], (data[1] & 0x10) ? id : 0); | 432 | if (data[1] & 0x10) |
433 | input_report_abs(dev, ABS_MISC, id); /* report tool id */ | ||
434 | else | ||
435 | input_report_abs(dev, ABS_MISC, 0); /* reset tool id */ | ||
436 | input_report_key(dev, wacom->tool[0], data[1] & 0x10); | ||
410 | input_sync(dev); | 437 | input_sync(dev); |
411 | 438 | ||
412 | /* send pad data */ | 439 | /* send pad data */ |
413 | if (wacom->features->type == WACOM_G4) { | 440 | if (wacom->features->type == WACOM_G4) { |
414 | /* fist time sending pad data */ | 441 | if ((wacom->serial[1] & 0xc0) != (data[7] & 0xf8)) { |
415 | if (wacom->tool[1] != BTN_TOOL_FINGER) { | 442 | wacom->id[1] = 1; |
416 | wacom->id[1] = 0; | 443 | wacom->serial[1] = (data[7] & 0xf8); |
417 | wacom->serial[1] = (data[7] & 0x38) >> 2; | ||
418 | } | ||
419 | if (data[7] & 0xf8) { | ||
420 | input_report_key(dev, BTN_0, (data[7] & 0x40)); | 444 | input_report_key(dev, BTN_0, (data[7] & 0x40)); |
421 | input_report_key(dev, BTN_4, (data[7] & 0x80)); | 445 | input_report_key(dev, BTN_4, (data[7] & 0x80)); |
422 | if (((data[7] & 0x38) >> 2) == (wacom->serial[1] & 0x0e)) | 446 | rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); |
423 | /* alter REL_WHEEL value so X apps can get it */ | ||
424 | wacom->serial[1] += (wacom->serial[1] & 0x01) ? -1 : 1; | ||
425 | else | ||
426 | wacom->serial[1] = (data[7] & 0x38 ) >> 2; | ||
427 | |||
428 | /* don't alter the value when there is no wheel event */ | ||
429 | if (wacom->serial[1] == 1) | ||
430 | wacom->serial[1] = 0; | ||
431 | rw = wacom->serial[1]; | ||
432 | rw = (rw & 0x08) ? -(rw & 0x07) : (rw & 0x07); | ||
433 | input_report_rel(dev, REL_WHEEL, rw); | 447 | input_report_rel(dev, REL_WHEEL, rw); |
434 | wacom->tool[1] = BTN_TOOL_FINGER; | 448 | input_report_key(dev, BTN_TOOL_FINGER, 0xf0); |
435 | wacom->id[1] = data[7] & 0xf8; | ||
436 | input_report_key(dev, wacom->tool[1], 0xf0); | ||
437 | input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); | 449 | input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); |
438 | } else if (wacom->id[1]) { | 450 | } else if (wacom->id[1]) { |
439 | wacom->id[1] = 0; | 451 | wacom->id[1] = 0; |
440 | wacom->serial[1] = 0; | 452 | input_report_key(dev, BTN_TOOL_FINGER, 0); |
441 | input_report_key(dev, wacom->tool[1], 0); | ||
442 | input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); | 453 | input_event(dev, EV_MSC, MSC_SERIAL, 0xf0); |
443 | } | 454 | } |
444 | input_sync(dev); | 455 | input_sync(dev); |
@@ -516,21 +527,31 @@ static int wacom_intuos_inout(struct urb *urb) | |||
516 | default: /* Unknown tool */ | 527 | default: /* Unknown tool */ |
517 | wacom->tool[idx] = BTN_TOOL_PEN; | 528 | wacom->tool[idx] = BTN_TOOL_PEN; |
518 | } | 529 | } |
519 | input_report_key(dev, wacom->tool[idx], wacom->id[idx]); | 530 | if(!((wacom->tool[idx] == BTN_TOOL_LENS) && |
520 | input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); | 531 | ((wacom->features->type == INTUOS312) |
521 | input_sync(dev); | 532 | || (wacom->features->type == INTUOS319)))) { |
533 | input_report_abs(dev, ABS_MISC, wacom->id[idx]); /* report tool id */ | ||
534 | input_report_key(dev, wacom->tool[idx], 1); | ||
535 | input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); | ||
536 | input_sync(dev); | ||
537 | } | ||
522 | return 1; | 538 | return 1; |
523 | } | 539 | } |
524 | 540 | ||
525 | /* Exit report */ | 541 | /* Exit report */ |
526 | if ((data[1] & 0xfe) == 0x80) { | 542 | if ((data[1] & 0xfe) == 0x80) { |
527 | input_report_key(dev, wacom->tool[idx], 0); | 543 | input_report_key(dev, wacom->tool[idx], 0); |
544 | input_report_abs(dev, ABS_MISC, 0); /* reset tool id */ | ||
528 | input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); | 545 | input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); |
529 | input_sync(dev); | 546 | input_sync(dev); |
530 | return 1; | 547 | return 1; |
531 | } | 548 | } |
532 | 549 | ||
533 | return 0; | 550 | if((wacom->tool[idx] == BTN_TOOL_LENS) && ((wacom->features->type == INTUOS312) |
551 | || (wacom->features->type == INTUOS319))) | ||
552 | return 1; | ||
553 | else | ||
554 | return 0; | ||
534 | } | 555 | } |
535 | 556 | ||
536 | static void wacom_intuos_general(struct urb *urb) | 557 | static void wacom_intuos_general(struct urb *urb) |
@@ -600,10 +621,9 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs) | |||
600 | /* pad packets. Works as a second tool and is always in prox */ | 621 | /* pad packets. Works as a second tool and is always in prox */ |
601 | if (data[0] == 12) { | 622 | if (data[0] == 12) { |
602 | /* initiate the pad as a device */ | 623 | /* initiate the pad as a device */ |
603 | if (wacom->tool[1] != BTN_TOOL_FINGER) { | 624 | if (wacom->tool[1] != BTN_TOOL_FINGER) |
604 | wacom->tool[1] = BTN_TOOL_FINGER; | 625 | wacom->tool[1] = BTN_TOOL_FINGER; |
605 | input_report_key(dev, wacom->tool[1], 1); | 626 | |
606 | } | ||
607 | input_report_key(dev, BTN_0, (data[5] & 0x01)); | 627 | input_report_key(dev, BTN_0, (data[5] & 0x01)); |
608 | input_report_key(dev, BTN_1, (data[5] & 0x02)); | 628 | input_report_key(dev, BTN_1, (data[5] & 0x02)); |
609 | input_report_key(dev, BTN_2, (data[5] & 0x04)); | 629 | input_report_key(dev, BTN_2, (data[5] & 0x04)); |
@@ -614,6 +634,11 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs) | |||
614 | input_report_key(dev, BTN_7, (data[6] & 0x08)); | 634 | input_report_key(dev, BTN_7, (data[6] & 0x08)); |
615 | input_report_abs(dev, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]); | 635 | input_report_abs(dev, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]); |
616 | input_report_abs(dev, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]); | 636 | input_report_abs(dev, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]); |
637 | |||
638 | if((data[5] & 0x0f) | (data[6] & 0x0f) | (data[1] & 0x1f) | data[2]) | ||
639 | input_report_key(dev, wacom->tool[1], 1); | ||
640 | else | ||
641 | input_report_key(dev, wacom->tool[1], 0); | ||
617 | input_event(dev, EV_MSC, MSC_SERIAL, 0xffffffff); | 642 | input_event(dev, EV_MSC, MSC_SERIAL, 0xffffffff); |
618 | input_sync(dev); | 643 | input_sync(dev); |
619 | goto exit; | 644 | goto exit; |
@@ -676,8 +701,8 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs) | |||
676 | input_report_key(dev, BTN_LEFT, data[8] & 0x04); | 701 | input_report_key(dev, BTN_LEFT, data[8] & 0x04); |
677 | input_report_key(dev, BTN_MIDDLE, data[8] & 0x08); | 702 | input_report_key(dev, BTN_MIDDLE, data[8] & 0x08); |
678 | input_report_key(dev, BTN_RIGHT, data[8] & 0x10); | 703 | input_report_key(dev, BTN_RIGHT, data[8] & 0x10); |
679 | input_report_rel(dev, REL_WHEEL, ((data[8] & 0x02) >> 1) | 704 | input_report_rel(dev, REL_WHEEL, (data[8] & 0x01) |
680 | - (data[8] & 0x01)); | 705 | - ((data[8] & 0x02) >> 1)); |
681 | 706 | ||
682 | /* I3 2D mouse side buttons */ | 707 | /* I3 2D mouse side buttons */ |
683 | if (wacom->features->type == INTUOS3) { | 708 | if (wacom->features->type == INTUOS3) { |
@@ -695,7 +720,8 @@ static void wacom_intuos_irq(struct urb *urb, struct pt_regs *regs) | |||
695 | } | 720 | } |
696 | } | 721 | } |
697 | 722 | ||
698 | input_report_key(dev, wacom->tool[idx], wacom->id[idx]); | 723 | input_report_abs(dev, ABS_MISC, wacom->id[idx]); /* report tool id */ |
724 | input_report_key(dev, wacom->tool[idx], 1); | ||
699 | input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); | 725 | input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); |
700 | input_sync(dev); | 726 | input_sync(dev); |
701 | 727 | ||
@@ -733,7 +759,8 @@ static struct wacom_features wacom_features[] = { | |||
733 | { "Wacom PL800", 8, 7220, 5780, 511, 32, PL, wacom_pl_irq }, | 759 | { "Wacom PL800", 8, 7220, 5780, 511, 32, PL, wacom_pl_irq }, |
734 | { "Wacom PL700", 8, 6758, 5406, 511, 32, PL, wacom_pl_irq }, | 760 | { "Wacom PL700", 8, 6758, 5406, 511, 32, PL, wacom_pl_irq }, |
735 | { "Wacom PL510", 8, 6282, 4762, 511, 32, PL, wacom_pl_irq }, | 761 | { "Wacom PL510", 8, 6282, 4762, 511, 32, PL, wacom_pl_irq }, |
736 | { "Wacom PL710", 8, 34080, 27660, 511, 32, PL, wacom_pl_irq }, | 762 | { "Wacom DTU710", 8, 34080, 27660, 511, 32, PL, wacom_pl_irq }, |
763 | { "Wacom DTF521", 8, 6282, 4762, 511, 32, PL, wacom_pl_irq }, | ||
737 | { "Wacom DTF720", 8, 6858, 5506, 511, 32, PL, wacom_pl_irq }, | 764 | { "Wacom DTF720", 8, 6858, 5506, 511, 32, PL, wacom_pl_irq }, |
738 | { "Wacom Cintiq Partner",8, 20480, 15360, 511, 32, PL, wacom_ptu_irq }, | 765 | { "Wacom Cintiq Partner",8, 20480, 15360, 511, 32, PL, wacom_ptu_irq }, |
739 | { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 15, INTUOS, wacom_intuos_irq }, | 766 | { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 15, INTUOS, wacom_intuos_irq }, |
@@ -744,6 +771,8 @@ static struct wacom_features wacom_features[] = { | |||
744 | { "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 15, INTUOS3, wacom_intuos_irq }, | 771 | { "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 15, INTUOS3, wacom_intuos_irq }, |
745 | { "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 15, INTUOS3, wacom_intuos_irq }, | 772 | { "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 15, INTUOS3, wacom_intuos_irq }, |
746 | { "Wacom Intuos3 9x12", 10, 60960, 45720, 1023, 15, INTUOS3, wacom_intuos_irq }, | 773 | { "Wacom Intuos3 9x12", 10, 60960, 45720, 1023, 15, INTUOS3, wacom_intuos_irq }, |
774 | { "Wacom Intuos3 12x12", 10, 60960, 60960, 1023, 15, INTUOS312, wacom_intuos_irq }, | ||
775 | { "Wacom Intuos3 12x19", 10, 97536, 60960, 1023, 15, INTUOS319, wacom_intuos_irq }, | ||
747 | { "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 15, INTUOS3, wacom_intuos_irq }, | 776 | { "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 15, INTUOS3, wacom_intuos_irq }, |
748 | { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 15, CINTIQ, wacom_intuos_irq }, | 777 | { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 15, CINTIQ, wacom_intuos_irq }, |
749 | { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_intuos_irq }, | 778 | { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_intuos_irq }, |
@@ -779,6 +808,7 @@ static struct usb_device_id wacom_ids[] = { | |||
779 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x38) }, | 808 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x38) }, |
780 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x39) }, | 809 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x39) }, |
781 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC0) }, | 810 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC0) }, |
811 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC3) }, | ||
782 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) }, | 812 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) }, |
783 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x41) }, | 813 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x41) }, |
784 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x42) }, | 814 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x42) }, |
@@ -788,6 +818,8 @@ static struct usb_device_id wacom_ids[] = { | |||
788 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB0) }, | 818 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB0) }, |
789 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB1) }, | 819 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB1) }, |
790 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB2) }, | 820 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB2) }, |
821 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB3) }, | ||
822 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB4) }, | ||
791 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) }, | 823 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) }, |
792 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) }, | 824 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) }, |
793 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, | 825 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, |
@@ -820,7 +852,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
820 | struct usb_endpoint_descriptor *endpoint; | 852 | struct usb_endpoint_descriptor *endpoint; |
821 | struct wacom *wacom; | 853 | struct wacom *wacom; |
822 | struct input_dev *input_dev; | 854 | struct input_dev *input_dev; |
823 | char rep_data[2] = {0x02, 0x02}; | 855 | char rep_data[2], limit = 0; |
824 | 856 | ||
825 | wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); | 857 | wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); |
826 | input_dev = input_allocate_device(); | 858 | input_dev = input_allocate_device(); |
@@ -857,6 +889,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
857 | input_set_abs_params(input_dev, ABS_X, 0, wacom->features->x_max, 4, 0); | 889 | input_set_abs_params(input_dev, ABS_X, 0, wacom->features->x_max, 4, 0); |
858 | input_set_abs_params(input_dev, ABS_Y, 0, wacom->features->y_max, 4, 0); | 890 | input_set_abs_params(input_dev, ABS_Y, 0, wacom->features->y_max, 4, 0); |
859 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom->features->pressure_max, 0, 0); | 891 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom->features->pressure_max, 0, 0); |
892 | input_dev->absbit[LONG(ABS_MISC)] |= BIT(ABS_MISC); | ||
860 | 893 | ||
861 | switch (wacom->features->type) { | 894 | switch (wacom->features->type) { |
862 | case WACOM_G4: | 895 | case WACOM_G4: |
@@ -875,6 +908,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
875 | break; | 908 | break; |
876 | 909 | ||
877 | case INTUOS3: | 910 | case INTUOS3: |
911 | case INTUOS312: | ||
912 | case INTUOS319: | ||
878 | case CINTIQ: | 913 | case CINTIQ: |
879 | input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER); | 914 | input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER); |
880 | input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3) | BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7); | 915 | input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3) | BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7); |
@@ -916,10 +951,13 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
916 | 951 | ||
917 | input_register_device(wacom->dev); | 952 | input_register_device(wacom->dev); |
918 | 953 | ||
919 | /* ask the tablet to report tablet data */ | 954 | /* Ask the tablet to report tablet data. Repeat until it succeeds */ |
920 | usb_set_report(intf, 3, 2, rep_data, 2); | 955 | do { |
921 | /* repeat once (not sure why the first call often fails) */ | 956 | rep_data[0] = 2; |
922 | usb_set_report(intf, 3, 2, rep_data, 2); | 957 | rep_data[1] = 2; |
958 | usb_set_report(intf, 3, 2, rep_data, 2); | ||
959 | usb_get_report(intf, 3, 2, rep_data, 2); | ||
960 | } while (rep_data[1] != 2 && limit++ < 5); | ||
923 | 961 | ||
924 | usb_set_intfdata(intf, wacom); | 962 | usb_set_intfdata(intf, wacom); |
925 | return 0; | 963 | return 0; |