Lines 9-15
Link Here
|
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-2004 Ping Cheng <pingc@wacom.com> |
12 |
* Copyright (c) 2002-2005 Ping Cheng <pingc@wacom.com> |
13 |
* |
13 |
* |
14 |
* ChangeLog: |
14 |
* ChangeLog: |
15 |
* v0.1 (vp) - Initial release |
15 |
* v0.1 (vp) - Initial release |
Lines 51-56
Link Here
|
51 |
* - Cleanups here and there |
51 |
* - Cleanups here and there |
52 |
* v1.30.1 (pi) - Added Graphire3 support |
52 |
* v1.30.1 (pi) - Added Graphire3 support |
53 |
* v1.40 (pc) - Add support for several new devices, fix eraser reporting, ... |
53 |
* v1.40 (pc) - Add support for several new devices, fix eraser reporting, ... |
|
|
54 |
* |
55 |
* WARNING: THIS IS NOT PART OF THE OFFICIAL KERNEL TREE |
56 |
* THIS IS FOR TESTING PURPOSES |
57 |
* |
58 |
* v1.40-2.6.11.3-pc-0.1 - initial release based on 2.6.11 |
59 |
* - fixed a Graphire bug |
60 |
* - added Intuos3 |
61 |
* - added Cintiq 21UX |
62 |
* v1.40-2.6.11.3-pc-0.2 - fixed an I3 bug |
63 |
* |
54 |
*/ |
64 |
*/ |
55 |
|
65 |
|
56 |
/* |
66 |
/* |
Lines 72-78
Link Here
|
72 |
/* |
82 |
/* |
73 |
* Version Information |
83 |
* Version Information |
74 |
*/ |
84 |
*/ |
75 |
#define DRIVER_VERSION "v1.40" |
85 |
#define DRIVER_VERSION "v1.40 - 2.6.12-ky1" |
76 |
#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" |
86 |
#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" |
77 |
#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" |
87 |
#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" |
78 |
#define DRIVER_LICENSE "GPL" |
88 |
#define DRIVER_LICENSE "GPL" |
Lines 83-88
Link Here
|
83 |
|
93 |
|
84 |
#define USB_VENDOR_ID_WACOM 0x056a |
94 |
#define USB_VENDOR_ID_WACOM 0x056a |
85 |
|
95 |
|
|
|
96 |
enum { |
97 |
PENPARTNER = 0, |
98 |
GRAPHIRE, |
99 |
PL, |
100 |
INTUOS, |
101 |
INTUOS3, |
102 |
CINTIQ, |
103 |
MAX_TYPE |
104 |
}; |
105 |
|
86 |
struct wacom_features { |
106 |
struct wacom_features { |
87 |
char *name; |
107 |
char *name; |
88 |
int pktlen; |
108 |
int pktlen; |
Lines 115-121
Link Here
|
115 |
usb_sndctrlpipe(interface_to_usbdev(intf), 0), |
135 |
usb_sndctrlpipe(interface_to_usbdev(intf), 0), |
116 |
USB_REQ_SET_REPORT, USB_TYPE_CLASS | USB_RECIP_INTERFACE, |
136 |
USB_REQ_SET_REPORT, USB_TYPE_CLASS | USB_RECIP_INTERFACE, |
117 |
(type << 8) + id, intf->altsetting[0].desc.bInterfaceNumber, |
137 |
(type << 8) + id, intf->altsetting[0].desc.bInterfaceNumber, |
118 |
buf, size, 1000); |
138 |
buf, size, HZ); |
119 |
} |
139 |
} |
120 |
|
140 |
|
121 |
static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) |
141 |
static void wacom_pl_irq(struct urb *urb, struct pt_regs *regs) |
Lines 182-189
Link Here
|
182 |
wacom->tool[1] = BTN_TOOL_PEN; |
202 |
wacom->tool[1] = BTN_TOOL_PEN; |
183 |
} |
203 |
} |
184 |
input_report_key(dev, wacom->tool[1], prox); /* report in proximity for tool */ |
204 |
input_report_key(dev, wacom->tool[1], prox); /* report in proximity for tool */ |
185 |
input_report_abs(dev, ABS_X, data[3] | ((__u32)data[2] << 7) | ((__u32)(data[1] & 0x03) << 14)); |
205 |
input_report_abs(dev, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14)); |
186 |
input_report_abs(dev, ABS_Y, data[6] | ((__u32)data[5] << 7) | ((__u32)(data[4] & 0x03) << 14)); |
206 |
input_report_abs(dev, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14)); |
187 |
input_report_abs(dev, ABS_PRESSURE, pressure); |
207 |
input_report_abs(dev, ABS_PRESSURE, pressure); |
188 |
|
208 |
|
189 |
input_report_key(dev, BTN_TOUCH, data[4] & 0x08); |
209 |
input_report_key(dev, BTN_TOUCH, data[4] & 0x08); |
Lines 335-383
Link Here
|
335 |
goto exit; |
355 |
goto exit; |
336 |
} |
356 |
} |
337 |
|
357 |
|
338 |
x = le16_to_cpu(*(__le16 *) &data[2]); |
|
|
339 |
y = le16_to_cpu(*(__le16 *) &data[4]); |
340 |
|
341 |
input_regs(dev, regs); |
358 |
input_regs(dev, regs); |
342 |
|
359 |
|
343 |
switch ((data[1] >> 5) & 3) { |
360 |
if ( data[1] & 0x10 ) /* in prox */ |
344 |
|
361 |
{ |
345 |
case 0: /* Pen */ |
362 |
switch ((data[1] >> 5) & 3) { |
346 |
input_report_key(dev, BTN_TOOL_PEN, data[1] & 0x80); |
|
|
347 |
break; |
348 |
|
349 |
case 1: /* Rubber */ |
350 |
input_report_key(dev, BTN_TOOL_RUBBER, data[1] & 0x80); |
351 |
break; |
352 |
|
353 |
case 2: /* Mouse with wheel */ |
354 |
input_report_key(dev, BTN_MIDDLE, data[1] & 0x04); |
355 |
input_report_rel(dev, REL_WHEEL, (signed char) data[6]); |
356 |
/* fall through */ |
357 |
|
363 |
|
358 |
case 3: /* Mouse without wheel */ |
364 |
case 0: /* Pen */ |
359 |
input_report_key(dev, BTN_TOOL_MOUSE, data[7] > 24); |
365 |
wacom->tool[0] = BTN_TOOL_PEN; |
360 |
input_report_key(dev, BTN_LEFT, data[1] & 0x01); |
366 |
break; |
361 |
input_report_key(dev, BTN_RIGHT, data[1] & 0x02); |
|
|
362 |
input_report_abs(dev, ABS_DISTANCE, data[7]); |
363 |
|
367 |
|
364 |
input_report_abs(dev, ABS_X, x); |
368 |
case 1: /* Rubber */ |
365 |
input_report_abs(dev, ABS_Y, y); |
369 |
wacom->tool[0] = BTN_TOOL_RUBBER; |
|
|
370 |
break; |
366 |
|
371 |
|
367 |
input_sync(dev); |
372 |
case 2: /* Mouse with wheel */ |
368 |
goto exit; |
373 |
input_report_key(dev, BTN_MIDDLE, data[1] & 0x04); |
|
|
374 |
input_report_rel(dev, REL_WHEEL, (signed char) data[6]); |
375 |
/* fall through */ |
376 |
|
377 |
case 3: /* Mouse without wheel */ |
378 |
wacom->tool[0] = BTN_TOOL_MOUSE; |
379 |
input_report_key(dev, BTN_LEFT, data[1] & 0x01); |
380 |
input_report_key(dev, BTN_RIGHT, data[1] & 0x02); |
381 |
input_report_abs(dev, ABS_DISTANCE, data[7]); |
382 |
break; |
383 |
} |
369 |
} |
384 |
} |
370 |
|
385 |
|
371 |
if (data[1] & 0x80) { |
386 |
if (data[1] & 0x80) { |
|
|
387 |
x = le16_to_cpu(*(__le16 *) &data[2]); |
388 |
y = le16_to_cpu(*(__le16 *) &data[4]); |
372 |
input_report_abs(dev, ABS_X, x); |
389 |
input_report_abs(dev, ABS_X, x); |
373 |
input_report_abs(dev, ABS_Y, y); |
390 |
input_report_abs(dev, ABS_Y, y); |
374 |
} |
391 |
} |
375 |
|
392 |
if (wacom->tool[0] != BTN_TOOL_MOUSE) { |
376 |
input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); |
393 |
input_report_abs(dev, ABS_PRESSURE, le16_to_cpu(*(__le16 *) &data[6])); |
377 |
input_report_key(dev, BTN_TOUCH, data[1] & 0x01); |
394 |
input_report_key(dev, BTN_TOUCH, data[1] & 0x01); |
378 |
input_report_key(dev, BTN_STYLUS, data[1] & 0x02); |
395 |
input_report_key(dev, BTN_STYLUS, data[1] & 0x02); |
379 |
input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); |
396 |
input_report_key(dev, BTN_STYLUS2, data[1] & 0x04); |
380 |
|
397 |
} |
|
|
398 |
input_report_key(dev, wacom->tool[0], data[1] & 0x10); |
381 |
input_sync(dev); |
399 |
input_sync(dev); |
382 |
|
400 |
|
383 |
exit: |
401 |
exit: |
Lines 398-427
Link Here
|
398 |
idx = data[1] & 0x01; |
416 |
idx = data[1] & 0x01; |
399 |
|
417 |
|
400 |
/* Enter report */ |
418 |
/* Enter report */ |
401 |
if ((data[1] & 0xfc) == 0xc0) |
419 |
if ((data[1] & 0xfc) == 0xc0) |
402 |
{ |
420 |
{ |
403 |
/* serial number of the tool */ |
421 |
/* serial number of the tool */ |
404 |
wacom->serial[idx] = ((__u32)(data[3] & 0x0f) << 28) + |
422 |
wacom->serial[idx] = ((data[3] & 0x0f) << 28) + |
405 |
((__u32)data[4] << 20) + ((__u32)data[5] << 12) + |
423 |
(data[4] << 20) + (data[5] << 12) + |
406 |
((__u32)data[6] << 4) + (data[7] >> 4); |
424 |
(data[6] << 4) + (data[7] >> 4); |
407 |
|
425 |
|
408 |
switch (((__u32)data[2] << 4) | (data[3] >> 4)) { |
426 |
switch ((data[2] << 4) | (data[3] >> 4)) { |
409 |
case 0x812: /* Inking pen */ |
427 |
case 0x812: /* Inking pen */ |
410 |
case 0x801: /* Intuos3 Inking pen */ |
428 |
case 0x801: /* Intuos3 Inking pen */ |
411 |
case 0x012: |
429 |
case 0x012: |
412 |
wacom->tool[idx] = BTN_TOOL_PENCIL; |
430 |
wacom->tool[idx] = BTN_TOOL_PENCIL; |
413 |
break; |
431 |
break; |
414 |
case 0x822: /* Pen */ |
432 |
case 0x822: /* Pen */ |
415 |
case 0x842: |
433 |
case 0x842: |
416 |
case 0x852: |
434 |
case 0x852: |
417 |
case 0x823: /* Intuos3 Grip Pen */ |
435 |
case 0x823: /* Intuos3 Grip Pen */ |
418 |
case 0x813: /* Intuos3 Classic Pen */ |
436 |
case 0x813: /* Intuos3 Classic Pen */ |
419 |
case 0x885: /* Intuos3 Marker Pen */ |
437 |
case 0x885: /* Intuos3 Marker Pen */ |
420 |
case 0x022: |
438 |
case 0x022: |
421 |
wacom->tool[idx] = BTN_TOOL_PEN; |
439 |
wacom->tool[idx] = BTN_TOOL_PEN; |
422 |
break; |
440 |
break; |
423 |
case 0x832: /* Stroke pen */ |
441 |
case 0x832: /* Stroke pen */ |
424 |
case 0x032: |
442 |
case 0x032: |
425 |
wacom->tool[idx] = BTN_TOOL_BRUSH; |
443 |
wacom->tool[idx] = BTN_TOOL_BRUSH; |
426 |
break; |
444 |
break; |
427 |
case 0x007: /* Mouse 4D and 2D */ |
445 |
case 0x007: /* Mouse 4D and 2D */ |
Lines 438-455
Link Here
|
438 |
case 0x85a: |
456 |
case 0x85a: |
439 |
case 0x91a: |
457 |
case 0x91a: |
440 |
case 0xd1a: |
458 |
case 0xd1a: |
441 |
case 0x0fa: |
459 |
case 0x0fa: |
442 |
case 0x82b: /* Intuos3 Grip Pen Eraser */ |
460 |
case 0x82b: /* Intuos3 Grip Pen Eraser */ |
443 |
case 0x81b: /* Intuos3 Classic Pen Eraser */ |
461 |
case 0x81b: /* Intuos3 Classic Pen Eraser */ |
444 |
case 0x91b: /* Intuos3 Airbrush Eraser */ |
462 |
case 0x91b: /* Intuos3 Airbrush Eraser */ |
445 |
wacom->tool[idx] = BTN_TOOL_RUBBER; |
463 |
wacom->tool[idx] = BTN_TOOL_RUBBER; |
446 |
break; |
464 |
break; |
447 |
case 0xd12: |
465 |
case 0xd12: /* Airbrush */ |
448 |
case 0x912: |
466 |
case 0x912: |
449 |
case 0x112: |
467 |
case 0x112: |
450 |
case 0x913: /* Intuos3 Airbrush */ |
468 |
case 0x913: /* Intuos3 Airbrush */ |
451 |
wacom->tool[idx] = BTN_TOOL_AIRBRUSH; |
469 |
wacom->tool[idx] = BTN_TOOL_AIRBRUSH; |
452 |
break; /* Airbrush */ |
470 |
break; |
453 |
default: /* Unknown tool */ |
471 |
default: /* Unknown tool */ |
454 |
wacom->tool[idx] = BTN_TOOL_PEN; |
472 |
wacom->tool[idx] = BTN_TOOL_PEN; |
455 |
} |
473 |
} |
Lines 480-486
Link Here
|
480 |
/* general pen packet */ |
498 |
/* general pen packet */ |
481 |
if ((data[1] & 0xb8) == 0xa0) |
499 |
if ((data[1] & 0xb8) == 0xa0) |
482 |
{ |
500 |
{ |
483 |
t = ((__u32)data[6] << 2) | ((data[7] >> 6) & 3); |
501 |
t = (data[6] << 2) | ((data[7] >> 6) & 3); |
484 |
input_report_abs(dev, ABS_PRESSURE, t); |
502 |
input_report_abs(dev, ABS_PRESSURE, t); |
485 |
input_report_abs(dev, ABS_TILT_X, |
503 |
input_report_abs(dev, ABS_TILT_X, |
486 |
((data[7] << 1) & 0x7e) | (data[8] >> 7)); |
504 |
((data[7] << 1) & 0x7e) | (data[8] >> 7)); |
Lines 494-500
Link Here
|
494 |
if ((data[1] & 0xbc) == 0xb4) |
512 |
if ((data[1] & 0xbc) == 0xb4) |
495 |
{ |
513 |
{ |
496 |
input_report_abs(dev, ABS_WHEEL, |
514 |
input_report_abs(dev, ABS_WHEEL, |
497 |
((__u32)data[6] << 2) | ((data[7] >> 6) & 3)); |
515 |
(data[6] << 2) | ((data[7] >> 6) & 3)); |
498 |
input_report_abs(dev, ABS_TILT_X, |
516 |
input_report_abs(dev, ABS_TILT_X, |
499 |
((data[7] << 1) & 0x7e) | (data[8] >> 7)); |
517 |
((data[7] << 1) & 0x7e) | (data[8] >> 7)); |
500 |
input_report_abs(dev, ABS_TILT_Y, data[8] & 0x7f); |
518 |
input_report_abs(dev, ABS_TILT_Y, data[8] & 0x7f); |
Lines 526-532
Link Here
|
526 |
goto exit; |
544 |
goto exit; |
527 |
} |
545 |
} |
528 |
|
546 |
|
529 |
if (data[0] != 2 && data[0] != 5 && data[0] != 6) { |
547 |
if (data[0] != 2 && data[0] != 5 && data[0] != 6 && data[0] != 12) { |
530 |
dbg("wacom_intuos_irq: received unknown report #%d", data[0]); |
548 |
dbg("wacom_intuos_irq: received unknown report #%d", data[0]); |
531 |
goto exit; |
549 |
goto exit; |
532 |
} |
550 |
} |
Lines 536-636
Link Here
|
536 |
/* tool number */ |
554 |
/* tool number */ |
537 |
idx = data[1] & 0x01; |
555 |
idx = data[1] & 0x01; |
538 |
|
556 |
|
539 |
/* process in/out prox events */ |
|
|
540 |
if (wacom_intuos_inout(urb)) goto exit; |
541 |
|
542 |
input_report_abs(dev, ABS_X, be16_to_cpu(*(__be16 *) &data[2])); |
543 |
input_report_abs(dev, ABS_Y, be16_to_cpu(*(__be16 *) &data[4])); |
544 |
input_report_abs(dev, ABS_DISTANCE, data[9]); |
545 |
|
546 |
/* process general packets */ |
547 |
wacom_intuos_general(urb); |
548 |
|
549 |
if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0) { /* 4D mouse or Lens cursor packets */ |
550 |
|
551 |
if (data[1] & 0x02) { /* Rotation packet */ |
552 |
|
553 |
t = ((__u32)data[6] << 3) | ((data[7] >> 5) & 7); |
554 |
input_report_abs(dev, ABS_RZ, (data[7] & 0x20) ? ((t - 1) / 2) : -t / 2); |
555 |
|
556 |
} else { |
557 |
|
558 |
if ((data[1] & 0x10) == 0) { /* 4D mouse packets */ |
559 |
|
560 |
input_report_key(dev, BTN_LEFT, data[8] & 0x01); |
561 |
input_report_key(dev, BTN_MIDDLE, data[8] & 0x02); |
562 |
input_report_key(dev, BTN_RIGHT, data[8] & 0x04); |
563 |
|
564 |
input_report_key(dev, BTN_SIDE, data[8] & 0x20); |
565 |
input_report_key(dev, BTN_EXTRA, data[8] & 0x10); |
566 |
t = ((__u32)data[6] << 2) | ((data[7] >> 6) & 3); |
567 |
input_report_abs(dev, ABS_THROTTLE, (data[8] & 0x08) ? -t : t); |
568 |
|
569 |
} else { |
570 |
if (wacom->tool[idx] == BTN_TOOL_MOUSE) { /* 2D mouse packets */ |
571 |
input_report_key(dev, BTN_LEFT, data[8] & 0x04); |
572 |
input_report_key(dev, BTN_MIDDLE, data[8] & 0x08); |
573 |
input_report_key(dev, BTN_RIGHT, data[8] & 0x10); |
574 |
input_report_rel(dev, REL_WHEEL, |
575 |
(-(__u32)(data[8] & 0x01) + (__u32)((data[8] & 0x02) >> 1))); |
576 |
} |
577 |
else { /* Lens cursor packets */ |
578 |
input_report_key(dev, BTN_LEFT, data[8] & 0x01); |
579 |
input_report_key(dev, BTN_MIDDLE, data[8] & 0x02); |
580 |
input_report_key(dev, BTN_RIGHT, data[8] & 0x04); |
581 |
input_report_key(dev, BTN_SIDE, data[8] & 0x10); |
582 |
input_report_key(dev, BTN_EXTRA, data[8] & 0x08); |
583 |
} |
584 |
} |
585 |
} |
586 |
} |
587 |
|
588 |
input_report_key(dev, wacom->tool[idx], 1); |
589 |
input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); |
590 |
input_sync(dev); |
591 |
|
592 |
exit: |
593 |
retval = usb_submit_urb (urb, GFP_ATOMIC); |
594 |
if (retval) |
595 |
err ("%s - usb_submit_urb failed with result %d", |
596 |
__FUNCTION__, retval); |
597 |
} |
598 |
|
599 |
static void wacom_intuos3_irq(struct urb *urb, struct pt_regs *regs) |
600 |
{ |
601 |
struct wacom *wacom = urb->context; |
602 |
unsigned char *data = wacom->data; |
603 |
struct input_dev *dev = &wacom->dev; |
604 |
unsigned int t; |
605 |
int idx, retval; |
606 |
|
607 |
switch (urb->status) { |
608 |
case 0: |
609 |
/* success */ |
610 |
break; |
611 |
case -ECONNRESET: |
612 |
case -ENOENT: |
613 |
case -ESHUTDOWN: |
614 |
/* this urb is terminated, clean up */ |
615 |
dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status); |
616 |
return; |
617 |
default: |
618 |
dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status); |
619 |
goto exit; |
620 |
} |
621 |
|
622 |
/* check for valid report */ |
623 |
if (data[0] != 2 && data[0] != 5 && data[0] != 12) |
624 |
{ |
625 |
printk(KERN_INFO "wacom_intuos3_irq: received unknown report #%d\n", data[0]); |
626 |
goto exit; |
627 |
} |
628 |
|
629 |
input_regs(dev, regs); |
630 |
|
631 |
/* tool index is always 0 here since there is no dual input tool */ |
632 |
idx = data[1] & 0x01; |
633 |
|
634 |
/* pad packets. Works as a second tool and is always in prox */ |
557 |
/* pad packets. Works as a second tool and is always in prox */ |
635 |
if (data[0] == 12) |
558 |
if (data[0] == 12) |
636 |
{ |
559 |
{ |
Lines 658-695
Link Here
|
658 |
/* process in/out prox events */ |
581 |
/* process in/out prox events */ |
659 |
if (wacom_intuos_inout(urb)) goto exit; |
582 |
if (wacom_intuos_inout(urb)) goto exit; |
660 |
|
583 |
|
661 |
input_report_abs(dev, ABS_X, ((__u32)data[2] << 9) | ((__u32)data[3] << 1) | ((data[9] >> 1) & 1)); |
584 |
/* Cintiq doesn't send data when RDY bit isn't set */ |
662 |
input_report_abs(dev, ABS_Y, ((__u32)data[4] << 9) | ((__u32)data[5] << 1) | (data[9] & 1)); |
585 |
if ((wacom->features->type == CINTIQ) && !(data[1] & 0x40)) return; |
663 |
input_report_abs(dev, ABS_DISTANCE, ((data[9] >> 2) & 0x3f)); |
586 |
|
|
|
587 |
if(wacom->features->type >= INTUOS3) |
588 |
{ |
589 |
input_report_abs(dev, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1)); |
590 |
input_report_abs(dev, ABS_Y, (data[4] << 9) | (data[5] << 1) | (data[9] & 1)); |
591 |
input_report_abs(dev, ABS_DISTANCE, ((data[9] >> 2) & 0x3f)); |
592 |
} |
593 |
else |
594 |
{ |
595 |
input_report_abs(dev, ABS_X, be16_to_cpu(*(__be16 *) &data[2])); |
596 |
input_report_abs(dev, ABS_Y, be16_to_cpu(*(__be16 *) &data[4])); |
597 |
input_report_abs(dev, ABS_DISTANCE, ((data[9] >> 3) & 0x1f)); |
598 |
} |
664 |
|
599 |
|
665 |
/* process general packets */ |
600 |
/* process general packets */ |
666 |
wacom_intuos_general(urb); |
601 |
wacom_intuos_general(urb); |
667 |
|
602 |
|
668 |
if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0) |
603 |
/* 4D mouse, 2D mouse, marker pen rotation, or Lens cursor packets */ |
669 |
{ |
604 |
if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0) { |
670 |
/* Marker pen rotation packet. Reported as wheel due to valuator limitation */ |
605 |
/* Rotation packet */ |
671 |
if (data[1] & 0x02) |
606 |
if (data[1] & 0x02) |
672 |
{ |
607 |
{ |
673 |
t = ((__u32)data[6] << 3) | ((data[7] >> 5) & 7); |
608 |
if(wacom->features->type >= INTUOS3) |
674 |
t = (data[7] & 0x20) ? ((t > 900) ? ((t-1) / 2 - 1350) : |
609 |
{ |
675 |
((t-1) / 2 + 450)) : (450 - t / 2) ; |
610 |
/* I3 marker pen rotation reported as wheel |
676 |
input_report_abs(dev, ABS_WHEEL, t); |
611 |
* due to valuator limitation |
677 |
} |
612 |
*/ |
678 |
|
613 |
t = (data[6] << 3) | ((data[7] >> 5) & 7); |
679 |
/* 2D mouse packets */ |
614 |
t = (data[7] & 0x20) ? ((t > 900) ? ((t-1) / 2 - 1350) : |
680 |
if (wacom->tool[idx] == BTN_TOOL_MOUSE) |
615 |
((t-1) / 2 + 450)) : (450 - t / 2) ; |
|
|
616 |
input_report_abs(dev, ABS_WHEEL, t); |
617 |
} |
618 |
else |
619 |
{ |
620 |
/* 4D mouse rotation packet */ |
621 |
t = (data[6] << 3) | ((data[7] >> 5) & 7); |
622 |
input_report_abs(dev, ABS_RZ, (data[7] & 0x20) ? |
623 |
((t - 1) / 2) : -t / 2); |
624 |
} |
625 |
} |
626 |
/* 4D mouse packets */ |
627 |
else if ( !(data[1] & 0x10) && wacom->features->type < INTUOS3) |
628 |
{ |
629 |
input_report_key(dev, BTN_LEFT, data[8] & 0x01); |
630 |
input_report_key(dev, BTN_MIDDLE, data[8] & 0x02); |
631 |
input_report_key(dev, BTN_RIGHT, data[8] & 0x04); |
632 |
|
633 |
input_report_key(dev, BTN_SIDE, data[8] & 0x20); |
634 |
input_report_key(dev, BTN_EXTRA, data[8] & 0x10); |
635 |
t = (data[6] << 2) | ((data[7] >> 6) & 3); |
636 |
input_report_abs(dev, ABS_THROTTLE, (data[8] & 0x08) ? -t : t); |
637 |
} |
638 |
/* 2D mouse packets */ |
639 |
else if (wacom->tool[idx] == BTN_TOOL_MOUSE) |
681 |
{ |
640 |
{ |
682 |
input_report_key(dev, BTN_LEFT, data[8] & 0x04); |
641 |
input_report_key(dev, BTN_LEFT, data[8] & 0x04); |
683 |
input_report_key(dev, BTN_MIDDLE, data[8] & 0x08); |
642 |
input_report_key(dev, BTN_MIDDLE, data[8] & 0x08); |
684 |
input_report_key(dev, BTN_RIGHT, data[8] & 0x10); |
643 |
input_report_key(dev, BTN_RIGHT, data[8] & 0x10); |
685 |
input_report_key(dev, BTN_SIDE, data[8] & 0x40); |
644 |
input_report_rel(dev, REL_WHEEL, ((data[8] & 0x02) >> 1) |
686 |
input_report_key(dev, BTN_EXTRA, data[8] & 0x20); |
645 |
- (data[8] & 0x01)); |
687 |
/* mouse wheel is positive when rolled backwards */ |
646 |
|
688 |
input_report_rel(dev, REL_WHEEL, ((__u32)((data[8] & 0x02) >> 1) |
647 |
/* I3 2D mouse side buttons */ |
689 |
- (__u32)(data[8] & 0x01))); |
648 |
if (wacom->features->type == INTUOS3) |
|
|
649 |
{ |
650 |
input_report_key(dev, BTN_SIDE, data[8] & 0x40); |
651 |
input_report_key(dev, BTN_EXTRA, data[8] & 0x20); |
652 |
} |
653 |
} |
654 |
/* Lens cursor packets */ |
655 |
else if (wacom->features->type < INTUOS3) |
656 |
{ |
657 |
input_report_key(dev, BTN_LEFT, data[8] & 0x01); |
658 |
input_report_key(dev, BTN_MIDDLE, data[8] & 0x02); |
659 |
input_report_key(dev, BTN_RIGHT, data[8] & 0x04); |
660 |
input_report_key(dev, BTN_SIDE, data[8] & 0x10); |
661 |
input_report_key(dev, BTN_EXTRA, data[8] & 0x08); |
690 |
} |
662 |
} |
691 |
} |
663 |
} |
692 |
|
664 |
|
693 |
input_report_key(dev, wacom->tool[idx], 1); |
665 |
input_report_key(dev, wacom->tool[idx], 1); |
694 |
input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); |
666 |
input_event(dev, EV_MSC, MSC_SERIAL, wacom->serial[idx]); |
695 |
input_sync(dev); |
667 |
input_sync(dev); |
Lines 698-735
Link Here
|
698 |
retval = usb_submit_urb (urb, GFP_ATOMIC); |
670 |
retval = usb_submit_urb (urb, GFP_ATOMIC); |
699 |
if (retval) |
671 |
if (retval) |
700 |
err ("%s - usb_submit_urb failed with result %d", |
672 |
err ("%s - usb_submit_urb failed with result %d", |
701 |
__FUNCTION__, retval); |
673 |
__FUNCTION__, retval); |
702 |
} |
674 |
} |
703 |
|
675 |
|
704 |
static struct wacom_features wacom_features[] = { |
676 |
static struct wacom_features wacom_features[] = { |
705 |
{ "Wacom Penpartner", 7, 5040, 3780, 255, 32, 0, wacom_penpartner_irq }, |
677 |
{ "Wacom Penpartner", 7, 5040, 3780, 255, 32, PENPARTNER, wacom_penpartner_irq }, |
706 |
{ "Wacom Graphire", 8, 10206, 7422, 511, 32, 1, wacom_graphire_irq }, |
678 |
{ "Wacom Graphire", 8, 10206, 7422, 511, 32, GRAPHIRE, wacom_graphire_irq }, |
707 |
{ "Wacom Graphire2 4x5", 8, 10206, 7422, 511, 32, 1, wacom_graphire_irq }, |
679 |
{ "Wacom Graphire2 4x5", 8, 10206, 7422, 511, 32, GRAPHIRE, wacom_graphire_irq }, |
708 |
{ "Wacom Graphire2 5x7", 8, 13918, 10206, 511, 32, 1, wacom_graphire_irq }, |
680 |
{ "Wacom Graphire2 5x7", 8, 13918, 10206, 511, 32, GRAPHIRE, wacom_graphire_irq }, |
709 |
{ "Wacom Graphire3", 8, 10208, 7424, 511, 32, 1, wacom_graphire_irq }, |
681 |
{ "Wacom Graphire3", 8, 10208, 7424, 511, 32, GRAPHIRE, wacom_graphire_irq }, |
710 |
{ "Wacom Graphire3 6x8", 8, 16704, 12064, 511, 32, 1, wacom_graphire_irq }, |
682 |
{ "Wacom Graphire3 6x8", 8, 16704, 12064, 511, 32, GRAPHIRE, wacom_graphire_irq }, |
711 |
{ "Wacom Intuos 4x5", 10, 12700, 10600, 1023, 15, 2, wacom_intuos_irq }, |
683 |
{ "Wacom Intuos 4x5", 10, 12700, 10600, 1023, 15, INTUOS, wacom_intuos_irq }, |
712 |
{ "Wacom Intuos 6x8", 10, 20320, 16240, 1023, 15, 2, wacom_intuos_irq }, |
684 |
{ "Wacom Intuos 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_intuos_irq }, |
713 |
{ "Wacom Intuos 9x12", 10, 30480, 24060, 1023, 15, 2, wacom_intuos_irq }, |
685 |
{ "Wacom Intuos 9x12", 10, 30480, 24060, 1023, 15, INTUOS, wacom_intuos_irq }, |
714 |
{ "Wacom Intuos 12x12", 10, 30480, 31680, 1023, 15, 2, wacom_intuos_irq }, |
686 |
{ "Wacom Intuos 12x12", 10, 30480, 31680, 1023, 15, INTUOS, wacom_intuos_irq }, |
715 |
{ "Wacom Intuos 12x18", 10, 45720, 31680, 1023, 15, 2, wacom_intuos_irq }, |
687 |
{ "Wacom Intuos 12x18", 10, 45720, 31680, 1023, 15, INTUOS, wacom_intuos_irq }, |
716 |
{ "Wacom PL400", 8, 5408, 4056, 255, 32, 3, wacom_pl_irq }, |
688 |
{ "Wacom PL400", 8, 5408, 4056, 255, 32, PL, wacom_pl_irq }, |
717 |
{ "Wacom PL500", 8, 6144, 4608, 255, 32, 3, wacom_pl_irq }, |
689 |
{ "Wacom PL500", 8, 6144, 4608, 255, 32, PL, wacom_pl_irq }, |
718 |
{ "Wacom PL600", 8, 6126, 4604, 255, 32, 3, wacom_pl_irq }, |
690 |
{ "Wacom PL600", 8, 6126, 4604, 255, 32, PL, wacom_pl_irq }, |
719 |
{ "Wacom PL600SX", 8, 6260, 5016, 255, 32, 3, wacom_pl_irq }, |
691 |
{ "Wacom PL600SX", 8, 6260, 5016, 255, 32, PL, wacom_pl_irq }, |
720 |
{ "Wacom PL550", 8, 6144, 4608, 511, 32, 3, wacom_pl_irq }, |
692 |
{ "Wacom PL550", 8, 6144, 4608, 511, 32, PL, wacom_pl_irq }, |
721 |
{ "Wacom PL800", 8, 7220, 5780, 511, 32, 3, wacom_pl_irq }, |
693 |
{ "Wacom PL800", 8, 7220, 5780, 511, 32, PL, wacom_pl_irq }, |
722 |
{ "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 15, 2, wacom_intuos_irq }, |
694 |
{ "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 15, INTUOS, wacom_intuos_irq }, |
723 |
{ "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, 2, wacom_intuos_irq }, |
695 |
{ "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_intuos_irq }, |
724 |
{ "Wacom Intuos2 9x12", 10, 30480, 24060, 1023, 15, 2, wacom_intuos_irq }, |
696 |
{ "Wacom Intuos2 9x12", 10, 30480, 24060, 1023, 15, INTUOS, wacom_intuos_irq }, |
725 |
{ "Wacom Intuos2 12x12", 10, 30480, 31680, 1023, 15, 2, wacom_intuos_irq }, |
697 |
{ "Wacom Intuos2 12x12", 10, 30480, 31680, 1023, 15, INTUOS, wacom_intuos_irq }, |
726 |
{ "Wacom Intuos2 12x18", 10, 45720, 31680, 1023, 15, 2, wacom_intuos_irq }, |
698 |
{ "Wacom Intuos2 12x18", 10, 45720, 31680, 1023, 15, INTUOS, wacom_intuos_irq }, |
727 |
{ "Wacom Volito", 8, 5104, 3712, 511, 32, 1, wacom_graphire_irq }, |
699 |
{ "Wacom Volito", 8, 5104, 3712, 511, 32, GRAPHIRE, wacom_graphire_irq }, |
728 |
{ "Wacom Cintiq Partner",8, 20480, 15360, 511, 32, 3, wacom_ptu_irq }, |
700 |
{ "Wacom Volito2", 8, 5104, 3712, 511, 32, GRAPHIRE, wacom_graphire_irq }, |
729 |
{ "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 15, 4, wacom_intuos3_irq }, |
701 |
{ "Wacom Cintiq Partner",8, 20480, 15360, 511, 32, PL, wacom_ptu_irq }, |
730 |
{ "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 15, 4, wacom_intuos3_irq }, |
702 |
{ "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 15, INTUOS3, wacom_intuos_irq }, |
731 |
{ "Wacom Intuos3 9x12", 10, 60960, 45720, 1023, 15, 4, wacom_intuos3_irq }, |
703 |
{ "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 15, INTUOS3, wacom_intuos_irq }, |
732 |
{ "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, 2, wacom_intuos_irq }, |
704 |
{ "Wacom Intuos3 9x12", 10, 60960, 45720, 1023, 15, INTUOS3, wacom_intuos_irq }, |
|
|
705 |
{ "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 15, CINTIQ, wacom_intuos_irq }, |
706 |
{ "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_intuos_irq }, |
733 |
{ } |
707 |
{ } |
734 |
}; |
708 |
}; |
735 |
|
709 |
|
Lines 757-766
Link Here
|
757 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x44) }, |
731 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x44) }, |
758 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x45) }, |
732 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x45) }, |
759 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x60) }, |
733 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x60) }, |
760 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) }, |
734 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x62) }, |
|
|
735 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) }, |
761 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB0) }, |
736 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB0) }, |
762 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB1) }, |
737 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB1) }, |
763 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB2) }, |
738 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB2) }, |
|
|
739 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) }, |
764 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, |
740 |
{ USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, |
765 |
{ } |
741 |
{ } |
766 |
}; |
742 |
}; |
Lines 823-829
Link Here
|
823 |
wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH) | BIT(BTN_STYLUS); |
799 |
wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH) | BIT(BTN_STYLUS); |
824 |
|
800 |
|
825 |
switch (wacom->features->type) { |
801 |
switch (wacom->features->type) { |
826 |
case 1: |
802 |
case GRAPHIRE: |
827 |
wacom->dev.evbit[0] |= BIT(EV_REL); |
803 |
wacom->dev.evbit[0] |= BIT(EV_REL); |
828 |
wacom->dev.relbit[0] |= BIT(REL_WHEEL); |
804 |
wacom->dev.relbit[0] |= BIT(REL_WHEEL); |
829 |
wacom->dev.absbit[0] |= BIT(ABS_DISTANCE); |
805 |
wacom->dev.absbit[0] |= BIT(ABS_DISTANCE); |
Lines 831-853
Link Here
|
831 |
wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) | BIT(BTN_STYLUS2); |
807 |
wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) | BIT(BTN_STYLUS2); |
832 |
break; |
808 |
break; |
833 |
|
809 |
|
834 |
case 4: /* new functions for Intuos3 */ |
810 |
case INTUOS3: |
|
|
811 |
case CINTIQ: |
835 |
wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER); |
812 |
wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER); |
836 |
wacom->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); |
813 |
wacom->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); |
837 |
wacom->dev.absbit[0] |= BIT(ABS_RX) | BIT(ABS_RY); |
814 |
wacom->dev.absbit[0] |= BIT(ABS_RX) | BIT(ABS_RY); |
838 |
/* fall through */ |
815 |
/* fall through */ |
839 |
|
816 |
|
840 |
case 2: |
817 |
case INTUOS: |
841 |
wacom->dev.evbit[0] |= BIT(EV_MSC) | BIT(EV_REL); |
818 |
wacom->dev.evbit[0] |= BIT(EV_MSC) | BIT(EV_REL); |
842 |
wacom->dev.mscbit[0] |= BIT(MSC_SERIAL); |
819 |
wacom->dev.mscbit[0] |= BIT(MSC_SERIAL); |
843 |
wacom->dev.relbit[0] |= BIT(REL_WHEEL); |
820 |
wacom->dev.relbit[0] |= BIT(REL_WHEEL); |
844 |
wacom->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE) | BIT(BTN_SIDE) | BIT(BTN_EXTRA); |
821 |
wacom->dev.keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE) | BIT(BTN_SIDE) | BIT(BTN_EXTRA); |
845 |
wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) | BIT(BTN_TOOL_BRUSH) |
822 |
wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) | BIT(BTN_TOOL_BRUSH) |
846 |
| BIT(BTN_TOOL_PENCIL) | BIT(BTN_TOOL_AIRBRUSH) | BIT(BTN_TOOL_LENS) | BIT(BTN_STYLUS2); |
823 |
| BIT(BTN_TOOL_PENCIL) | BIT(BTN_TOOL_AIRBRUSH) | BIT(BTN_TOOL_LENS) | BIT(BTN_STYLUS2); |
847 |
wacom->dev.absbit[0] |= BIT(ABS_DISTANCE) | BIT(ABS_WHEEL) | BIT(ABS_TILT_X) | BIT(ABS_TILT_Y) | BIT(ABS_RZ) | BIT(ABS_THROTTLE); |
824 |
wacom->dev.absbit[0] |= BIT(ABS_DISTANCE) | BIT(ABS_WHEEL) | BIT(ABS_TILT_X) | BIT(ABS_TILT_Y) | BIT(ABS_RZ) | BIT(ABS_THROTTLE); |
848 |
break; |
825 |
break; |
849 |
|
826 |
|
850 |
case 3: |
827 |
case PL: |
851 |
wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_STYLUS2) | BIT(BTN_TOOL_RUBBER); |
828 |
wacom->dev.keybit[LONG(BTN_DIGI)] |= BIT(BTN_STYLUS2) | BIT(BTN_TOOL_RUBBER); |
852 |
break; |
829 |
break; |
853 |
} |
830 |
} |