diff options
author | Ping Cheng <pingc@wacom.com> | 2006-09-26 16:34:47 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-10-17 17:46:30 -0400 |
commit | 8d32e3ae5972641ee9eb813e7a5c44a2b85d3694 (patch) | |
tree | 115d520ebc40873b268db11a88ab9a5c3a05c763 /drivers/usb/input/wacom_wac.c | |
parent | 64f89798da35f43c6ef6afda0541e25034513458 (diff) |
USB: Wacom driver updates
This fixes some issues with the current wacom driver due to the split of
the driver into different pieces and adds support for the Intuos3 4x6
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/input/wacom_wac.c')
-rw-r--r-- | drivers/usb/input/wacom_wac.c | 121 |
1 files changed, 66 insertions, 55 deletions
diff --git a/drivers/usb/input/wacom_wac.c b/drivers/usb/input/wacom_wac.c index aa31d22d4f05..92726fe89379 100644 --- a/drivers/usb/input/wacom_wac.c +++ b/drivers/usb/input/wacom_wac.c | |||
@@ -191,9 +191,9 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo) | |||
191 | wacom_report_key(wcombo, BTN_LEFT, data[1] & 0x01); | 191 | wacom_report_key(wcombo, BTN_LEFT, data[1] & 0x01); |
192 | wacom_report_key(wcombo, BTN_RIGHT, data[1] & 0x02); | 192 | wacom_report_key(wcombo, BTN_RIGHT, data[1] & 0x02); |
193 | if (wacom->features->type == WACOM_G4) | 193 | if (wacom->features->type == WACOM_G4) |
194 | wacom_report_abs(wcombo, ABS_DISTANCE, data[6]); | 194 | wacom_report_abs(wcombo, ABS_DISTANCE, data[6] & 0x3f); |
195 | else | 195 | else |
196 | wacom_report_abs(wcombo, ABS_DISTANCE, data[7]); | 196 | wacom_report_abs(wcombo, ABS_DISTANCE, data[7] & 0x3f); |
197 | break; | 197 | break; |
198 | } | 198 | } |
199 | } | 199 | } |
@@ -303,8 +303,9 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo) | |||
303 | wacom->tool[idx] = BTN_TOOL_PEN; | 303 | wacom->tool[idx] = BTN_TOOL_PEN; |
304 | } | 304 | } |
305 | /* only large I3 support Lens Cursor */ | 305 | /* only large I3 support Lens Cursor */ |
306 | if(!((wacom->tool[idx] == BTN_TOOL_LENS) && | 306 | if(!((wacom->tool[idx] == BTN_TOOL_LENS) |
307 | (wacom->features->type == INTUOS3))) { | 307 | && ((wacom->features->type == INTUOS3) |
308 | || (wacom->features->type == INTUOS3S)))) { | ||
308 | wacom_report_abs(wcombo, ABS_MISC, wacom->id[idx]); /* report tool id */ | 309 | wacom_report_abs(wcombo, ABS_MISC, wacom->id[idx]); /* report tool id */ |
309 | wacom_report_key(wcombo, wacom->tool[idx], 1); | 310 | wacom_report_key(wcombo, wacom->tool[idx], 1); |
310 | wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, wacom->serial[idx]); | 311 | wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, wacom->serial[idx]); |
@@ -315,10 +316,14 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo) | |||
315 | 316 | ||
316 | /* Exit report */ | 317 | /* Exit report */ |
317 | if ((data[1] & 0xfe) == 0x80) { | 318 | if ((data[1] & 0xfe) == 0x80) { |
318 | wacom_report_key(wcombo, wacom->tool[idx], 0); | 319 | if(!((wacom->tool[idx] == BTN_TOOL_LENS) |
319 | wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */ | 320 | && ((wacom->features->type == INTUOS3) |
320 | wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, wacom->serial[idx]); | 321 | || (wacom->features->type == INTUOS3S)))) { |
321 | return 2; | 322 | wacom_report_key(wcombo, wacom->tool[idx], 0); |
323 | wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */ | ||
324 | wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, wacom->serial[idx]); | ||
325 | return 2; | ||
326 | } | ||
322 | } | 327 | } |
323 | return 0; | 328 | return 0; |
324 | } | 329 | } |
@@ -382,7 +387,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo) | |||
382 | wacom_report_abs(wcombo, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]); | 387 | wacom_report_abs(wcombo, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]); |
383 | wacom_report_abs(wcombo, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]); | 388 | wacom_report_abs(wcombo, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]); |
384 | 389 | ||
385 | if((data[5] & 0x0f) | (data[6] & 0x0f) | (data[1] & 0x1f) | data[2]) | 390 | if((data[5] & 0x0f) | (data[6] & 0x0f) | (data[1] & 0x1f) | |
391 | data[2] | (data[3] & 0x1f) | data[4]) | ||
386 | wacom_report_key(wcombo, wacom->tool[1], 1); | 392 | wacom_report_key(wcombo, wacom->tool[1], 1); |
387 | else | 393 | else |
388 | wacom_report_key(wcombo, wacom->tool[1], 0); | 394 | wacom_report_key(wcombo, wacom->tool[1], 0); |
@@ -432,7 +438,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo) | |||
432 | ((t - 1) / 2) : -t / 2); | 438 | ((t - 1) / 2) : -t / 2); |
433 | } | 439 | } |
434 | 440 | ||
435 | } else if (!(data[1] & 0x10) && wacom->features->type < INTUOS3) { | 441 | } else if (!(data[1] & 0x10) && wacom->features->type < INTUOS3S) { |
436 | /* 4D mouse packet */ | 442 | /* 4D mouse packet */ |
437 | wacom_report_key(wcombo, BTN_LEFT, data[8] & 0x01); | 443 | wacom_report_key(wcombo, BTN_LEFT, data[8] & 0x01); |
438 | wacom_report_key(wcombo, BTN_MIDDLE, data[8] & 0x02); | 444 | wacom_report_key(wcombo, BTN_MIDDLE, data[8] & 0x02); |
@@ -452,12 +458,12 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo) | |||
452 | - ((data[8] & 0x02) >> 1)); | 458 | - ((data[8] & 0x02) >> 1)); |
453 | 459 | ||
454 | /* I3 2D mouse side buttons */ | 460 | /* I3 2D mouse side buttons */ |
455 | if (wacom->features->type == INTUOS3) { | 461 | if (wacom->features->type >= INTUOS3S && wacom->features->type <= INTUOS3L) { |
456 | wacom_report_key(wcombo, BTN_SIDE, data[8] & 0x40); | 462 | wacom_report_key(wcombo, BTN_SIDE, data[8] & 0x40); |
457 | wacom_report_key(wcombo, BTN_EXTRA, data[8] & 0x20); | 463 | wacom_report_key(wcombo, BTN_EXTRA, data[8] & 0x20); |
458 | } | 464 | } |
459 | 465 | ||
460 | } else if (wacom->features->type < INTUOS3) { | 466 | } else if (wacom->features->type < INTUOS3S || wacom->features->type == INTUOS3L) { |
461 | /* Lens cursor packets */ | 467 | /* Lens cursor packets */ |
462 | wacom_report_key(wcombo, BTN_LEFT, data[8] & 0x01); | 468 | wacom_report_key(wcombo, BTN_LEFT, data[8] & 0x01); |
463 | wacom_report_key(wcombo, BTN_MIDDLE, data[8] & 0x02); | 469 | wacom_report_key(wcombo, BTN_MIDDLE, data[8] & 0x02); |
@@ -490,6 +496,7 @@ int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo) | |||
490 | return (wacom_ptu_irq(wacom_wac, wcombo)); | 496 | return (wacom_ptu_irq(wacom_wac, wcombo)); |
491 | break; | 497 | break; |
492 | case INTUOS: | 498 | case INTUOS: |
499 | case INTUOS3S: | ||
493 | case INTUOS3: | 500 | case INTUOS3: |
494 | case INTUOS3L: | 501 | case INTUOS3L: |
495 | case CINTIQ: | 502 | case CINTIQ: |
@@ -515,6 +522,8 @@ void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_w | |||
515 | case CINTIQ: | 522 | case CINTIQ: |
516 | input_dev_i3(input_dev, wacom_wac); | 523 | input_dev_i3(input_dev, wacom_wac); |
517 | /* fall through */ | 524 | /* fall through */ |
525 | case INTUOS3S: | ||
526 | input_dev_i3s(input_dev, wacom_wac); | ||
518 | case INTUOS: | 527 | case INTUOS: |
519 | input_dev_i(input_dev, wacom_wac); | 528 | input_dev_i(input_dev, wacom_wac); |
520 | break; | 529 | break; |
@@ -530,49 +539,50 @@ void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_w | |||
530 | } | 539 | } |
531 | 540 | ||
532 | static struct wacom_features wacom_features[] = { | 541 | static struct wacom_features wacom_features[] = { |
533 | { "Wacom Penpartner", 7, 5040, 3780, 255, 32, PENPARTNER, wacom_sys_irq }, | 542 | { "Wacom Penpartner", 7, 5040, 3780, 255, 0, PENPARTNER }, |
534 | { "Wacom Graphire", 8, 10206, 7422, 511, 32, GRAPHIRE, wacom_sys_irq }, | 543 | { "Wacom Graphire", 8, 10206, 7422, 511, 63, GRAPHIRE }, |
535 | { "Wacom Graphire2 4x5", 8, 10206, 7422, 511, 32, GRAPHIRE, wacom_sys_irq }, | 544 | { "Wacom Graphire2 4x5", 8, 10206, 7422, 511, 63, GRAPHIRE }, |
536 | { "Wacom Graphire2 5x7", 8, 13918, 10206, 511, 32, GRAPHIRE, wacom_sys_irq }, | 545 | { "Wacom Graphire2 5x7", 8, 13918, 10206, 511, 63, GRAPHIRE }, |
537 | { "Wacom Graphire3", 8, 10208, 7424, 511, 32, GRAPHIRE, wacom_sys_irq }, | 546 | { "Wacom Graphire3", 8, 10208, 7424, 511, 63, GRAPHIRE }, |
538 | { "Wacom Graphire3 6x8", 8, 16704, 12064, 511, 32, GRAPHIRE, wacom_sys_irq }, | 547 | { "Wacom Graphire3 6x8", 8, 16704, 12064, 511, 63, GRAPHIRE }, |
539 | { "Wacom Graphire4 4x5", 8, 10208, 7424, 511, 32, WACOM_G4, wacom_sys_irq }, | 548 | { "Wacom Graphire4 4x5", 8, 10208, 7424, 511, 63, WACOM_G4 }, |
540 | { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 32, WACOM_G4, wacom_sys_irq }, | 549 | { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 63, WACOM_G4 }, |
541 | { "Wacom Volito", 8, 5104, 3712, 511, 32, GRAPHIRE, wacom_sys_irq }, | 550 | { "Wacom Volito", 8, 5104, 3712, 511, 0, GRAPHIRE }, |
542 | { "Wacom PenStation2", 8, 3250, 2320, 255, 32, GRAPHIRE, wacom_sys_irq }, | 551 | { "Wacom PenStation2", 8, 3250, 2320, 255, 0, GRAPHIRE }, |
543 | { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 32, GRAPHIRE, wacom_sys_irq }, | 552 | { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 0, GRAPHIRE }, |
544 | { "Wacom Volito2 2x3", 8, 3248, 2320, 511, 32, GRAPHIRE, wacom_sys_irq }, | 553 | { "Wacom Volito2 2x3", 8, 3248, 2320, 511, 0, GRAPHIRE }, |
545 | { "Wacom PenPartner2", 8, 3250, 2320, 255, 32, GRAPHIRE, wacom_sys_irq }, | 554 | { "Wacom PenPartner2", 8, 3250, 2320, 255, 0, GRAPHIRE }, |
546 | { "Wacom Intuos 4x5", 10, 12700, 10600, 1023, 15, INTUOS, wacom_sys_irq}, | 555 | { "Wacom Intuos 4x5", 10, 12700, 10600, 1023, 63, INTUOS }, |
547 | { "Wacom Intuos 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_sys_irq }, | 556 | { "Wacom Intuos 6x8", 10, 20320, 16240, 1023, 63, INTUOS }, |
548 | { "Wacom Intuos 9x12", 10, 30480, 24060, 1023, 15, INTUOS, wacom_sys_irq }, | 557 | { "Wacom Intuos 9x12", 10, 30480, 24060, 1023, 63, INTUOS }, |
549 | { "Wacom Intuos 12x12", 10, 30480, 31680, 1023, 15, INTUOS, wacom_sys_irq }, | 558 | { "Wacom Intuos 12x12", 10, 30480, 31680, 1023, 63, INTUOS }, |
550 | { "Wacom Intuos 12x18", 10, 45720, 31680, 1023, 15, INTUOS, wacom_sys_irq}, | 559 | { "Wacom Intuos 12x18", 10, 45720, 31680, 1023, 63, INTUOS }, |
551 | { "Wacom PL400", 8, 5408, 4056, 255, 32, PL, wacom_sys_irq }, | 560 | { "Wacom PL400", 8, 5408, 4056, 255, 0, PL }, |
552 | { "Wacom PL500", 8, 6144, 4608, 255, 32, PL, wacom_sys_irq }, | 561 | { "Wacom PL500", 8, 6144, 4608, 255, 0, PL }, |
553 | { "Wacom PL600", 8, 6126, 4604, 255, 32, PL, wacom_sys_irq }, | 562 | { "Wacom PL600", 8, 6126, 4604, 255, 0, PL }, |
554 | { "Wacom PL600SX", 8, 6260, 5016, 255, 32, PL, wacom_sys_irq }, | 563 | { "Wacom PL600SX", 8, 6260, 5016, 255, 0, PL }, |
555 | { "Wacom PL550", 8, 6144, 4608, 511, 32, PL, wacom_sys_irq }, | 564 | { "Wacom PL550", 8, 6144, 4608, 511, 0, PL }, |
556 | { "Wacom PL800", 8, 7220, 5780, 511, 32, PL, wacom_sys_irq }, | 565 | { "Wacom PL800", 8, 7220, 5780, 511, 0, PL }, |
557 | { "Wacom PL700", 8, 6758, 5406, 511, 32, PL, wacom_sys_irq }, | 566 | { "Wacom PL700", 8, 6758, 5406, 511, 0, PL }, |
558 | { "Wacom PL510", 8, 6282, 4762, 511, 32, PL, wacom_sys_irq }, | 567 | { "Wacom PL510", 8, 6282, 4762, 511, 0, PL }, |
559 | { "Wacom DTU710", 8, 34080, 27660, 511, 32, PL, wacom_sys_irq }, | 568 | { "Wacom DTU710", 8, 34080, 27660, 511, 0, PL }, |
560 | { "Wacom DTF521", 8, 6282, 4762, 511, 32, PL, wacom_sys_irq }, | 569 | { "Wacom DTF521", 8, 6282, 4762, 511, 0, PL }, |
561 | { "Wacom DTF720", 8, 6858, 5506, 511, 32, PL, wacom_sys_irq }, | 570 | { "Wacom DTF720", 8, 6858, 5506, 511, 0, PL }, |
562 | { "Wacom Cintiq Partner",8, 20480, 15360, 511, 32, PTU, wacom_sys_irq }, | 571 | { "Wacom Cintiq Partner",8, 20480, 15360, 511, 0, PTU }, |
563 | { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 15, INTUOS, wacom_sys_irq }, | 572 | { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 63, INTUOS }, |
564 | { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_sys_irq }, | 573 | { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 63, INTUOS }, |
565 | { "Wacom Intuos2 9x12", 10, 30480, 24060, 1023, 15, INTUOS, wacom_sys_irq }, | 574 | { "Wacom Intuos2 9x12", 10, 30480, 24060, 1023, 63, INTUOS }, |
566 | { "Wacom Intuos2 12x12", 10, 30480, 31680, 1023, 15, INTUOS, wacom_sys_irq }, | 575 | { "Wacom Intuos2 12x12", 10, 30480, 31680, 1023, 63, INTUOS }, |
567 | { "Wacom Intuos2 12x18", 10, 45720, 31680, 1023, 15, INTUOS, wacom_sys_irq }, | 576 | { "Wacom Intuos2 12x18", 10, 45720, 31680, 1023, 63, INTUOS }, |
568 | { "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 15, INTUOS3, wacom_sys_irq }, | 577 | { "Wacom Intuos3 4x5", 10, 25400, 20320, 1023, 63, INTUOS3S }, |
569 | { "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 15, INTUOS3, wacom_sys_irq }, | 578 | { "Wacom Intuos3 6x8", 10, 40640, 30480, 1023, 63, INTUOS3 }, |
570 | { "Wacom Intuos3 9x12", 10, 60960, 45720, 1023, 15, INTUOS3, wacom_sys_irq }, | 579 | { "Wacom Intuos3 9x12", 10, 60960, 45720, 1023, 63, INTUOS3 }, |
571 | { "Wacom Intuos3 12x12", 10, 60960, 60960, 1023, 15, INTUOS3L, wacom_sys_irq }, | 580 | { "Wacom Intuos3 12x12", 10, 60960, 60960, 1023, 63, INTUOS3L }, |
572 | { "Wacom Intuos3 12x19", 10, 97536, 60960, 1023, 15, INTUOS3L, wacom_sys_irq }, | 581 | { "Wacom Intuos3 12x19", 10, 97536, 60960, 1023, 63, INTUOS3L }, |
573 | { "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 15, INTUOS3, wacom_sys_irq }, | 582 | { "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 63, INTUOS3 }, |
574 | { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 15, CINTIQ, wacom_sys_irq }, | 583 | { "Wacom Intuos3 4x6", 10, 31496, 19685, 1023, 15, INTUOS3S }, |
575 | { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 15, INTUOS, wacom_sys_irq }, | 584 | { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 63, CINTIQ }, |
585 | { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 63, INTUOS }, | ||
576 | { } | 586 | { } |
577 | }; | 587 | }; |
578 | 588 | ||
@@ -618,6 +628,7 @@ static struct usb_device_id wacom_ids[] = { | |||
618 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB3) }, | 628 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB3) }, |
619 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB4) }, | 629 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB4) }, |
620 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) }, | 630 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) }, |
631 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB7) }, | ||
621 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) }, | 632 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) }, |
622 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, | 633 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, |
623 | { } | 634 | { } |