aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/wacom_wac.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index c0d75aee91e5..df9d866b9b3f 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -588,6 +588,11 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
588 return 1; 588 return 1;
589} 589}
590 590
591static int wacom_intuos_id_mangle(int tool_id)
592{
593 return (tool_id & ~0xFFF) << 4 | (tool_id & 0xFFF);
594}
595
591static int wacom_intuos_get_tool_type(int tool_id) 596static int wacom_intuos_get_tool_type(int tool_id)
592{ 597{
593 int tool_type; 598 int tool_type;
@@ -595,7 +600,7 @@ static int wacom_intuos_get_tool_type(int tool_id)
595 switch (tool_id) { 600 switch (tool_id) {
596 case 0x812: /* Inking pen */ 601 case 0x812: /* Inking pen */
597 case 0x801: /* Intuos3 Inking pen */ 602 case 0x801: /* Intuos3 Inking pen */
598 case 0x120802: /* Intuos4/5 Inking Pen */ 603 case 0x12802: /* Intuos4/5 Inking Pen */
599 case 0x012: 604 case 0x012:
600 tool_type = BTN_TOOL_PENCIL; 605 tool_type = BTN_TOOL_PENCIL;
601 break; 606 break;
@@ -610,11 +615,11 @@ static int wacom_intuos_get_tool_type(int tool_id)
610 case 0x804: /* Intuos4/5 13HD/24HD Marker Pen */ 615 case 0x804: /* Intuos4/5 13HD/24HD Marker Pen */
611 case 0x8e2: /* IntuosHT2 pen */ 616 case 0x8e2: /* IntuosHT2 pen */
612 case 0x022: 617 case 0x022:
613 case 0x100804: /* Intuos4/5 13HD/24HD Art Pen */ 618 case 0x10804: /* Intuos4/5 13HD/24HD Art Pen */
614 case 0x140802: /* Intuos4/5 13HD/24HD Classic Pen */ 619 case 0x14802: /* Intuos4/5 13HD/24HD Classic Pen */
615 case 0x160802: /* Cintiq 13HD Pro Pen */ 620 case 0x16802: /* Cintiq 13HD Pro Pen */
616 case 0x180802: /* DTH2242 Pen */ 621 case 0x18802: /* DTH2242 Pen */
617 case 0x100802: /* Intuos4/5 13HD/24HD General Pen */ 622 case 0x10802: /* Intuos4/5 13HD/24HD General Pen */
618 tool_type = BTN_TOOL_PEN; 623 tool_type = BTN_TOOL_PEN;
619 break; 624 break;
620 625
@@ -648,12 +653,12 @@ static int wacom_intuos_get_tool_type(int tool_id)
648 case 0x80c: /* Intuos4/5 13HD/24HD Marker Pen Eraser */ 653 case 0x80c: /* Intuos4/5 13HD/24HD Marker Pen Eraser */
649 case 0x80a: /* Intuos4/5 13HD/24HD General Pen Eraser */ 654 case 0x80a: /* Intuos4/5 13HD/24HD General Pen Eraser */
650 case 0x90a: /* Intuos4/5 13HD/24HD Airbrush Eraser */ 655 case 0x90a: /* Intuos4/5 13HD/24HD Airbrush Eraser */
651 case 0x14080a: /* Intuos4/5 13HD/24HD Classic Pen Eraser */ 656 case 0x1480a: /* Intuos4/5 13HD/24HD Classic Pen Eraser */
652 case 0x10090a: /* Intuos4/5 13HD/24HD Airbrush Eraser */ 657 case 0x1090a: /* Intuos4/5 13HD/24HD Airbrush Eraser */
653 case 0x10080c: /* Intuos4/5 13HD/24HD Art Pen Eraser */ 658 case 0x1080c: /* Intuos4/5 13HD/24HD Art Pen Eraser */
654 case 0x16080a: /* Cintiq 13HD Pro Pen Eraser */ 659 case 0x1680a: /* Cintiq 13HD Pro Pen Eraser */
655 case 0x18080a: /* DTH2242 Eraser */ 660 case 0x1880a: /* DTH2242 Eraser */
656 case 0x10080a: /* Intuos4/5 13HD/24HD General Pen Eraser */ 661 case 0x1080a: /* Intuos4/5 13HD/24HD General Pen Eraser */
657 tool_type = BTN_TOOL_RUBBER; 662 tool_type = BTN_TOOL_RUBBER;
658 break; 663 break;
659 664
@@ -662,7 +667,7 @@ static int wacom_intuos_get_tool_type(int tool_id)
662 case 0x112: 667 case 0x112:
663 case 0x913: /* Intuos3 Airbrush */ 668 case 0x913: /* Intuos3 Airbrush */
664 case 0x902: /* Intuos4/5 13HD/24HD Airbrush */ 669 case 0x902: /* Intuos4/5 13HD/24HD Airbrush */
665 case 0x100902: /* Intuos4/5 13HD/24HD Airbrush */ 670 case 0x10902: /* Intuos4/5 13HD/24HD Airbrush */
666 tool_type = BTN_TOOL_AIRBRUSH; 671 tool_type = BTN_TOOL_AIRBRUSH;
667 break; 672 break;
668 673
@@ -693,7 +698,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
693 (data[6] << 4) + (data[7] >> 4); 698 (data[6] << 4) + (data[7] >> 4);
694 699
695 wacom->id[idx] = (data[2] << 4) | (data[3] >> 4) | 700 wacom->id[idx] = (data[2] << 4) | (data[3] >> 4) |
696 ((data[7] & 0x0f) << 20) | ((data[8] & 0xf0) << 12); 701 ((data[7] & 0x0f) << 16) | ((data[8] & 0xf0) << 8);
697 702
698 wacom->tool[idx] = wacom_intuos_get_tool_type(wacom->id[idx]); 703 wacom->tool[idx] = wacom_intuos_get_tool_type(wacom->id[idx]);
699 704
@@ -923,7 +928,7 @@ static int wacom_intuos_general(struct wacom_wac *wacom)
923 * don't report events for invalid data 928 * don't report events for invalid data
924 */ 929 */
925 /* older I4 styli don't work with new Cintiqs */ 930 /* older I4 styli don't work with new Cintiqs */
926 if ((!((wacom->id[idx] >> 20) & 0x01) && 931 if ((!((wacom->id[idx] >> 16) & 0x01) &&
927 (features->type == WACOM_21UX2)) || 932 (features->type == WACOM_21UX2)) ||
928 /* Only large Intuos support Lense Cursor */ 933 /* Only large Intuos support Lense Cursor */
929 (wacom->tool[idx] == BTN_TOOL_LENS && 934 (wacom->tool[idx] == BTN_TOOL_LENS &&
@@ -1059,7 +1064,8 @@ static int wacom_intuos_general(struct wacom_wac *wacom)
1059 break; 1064 break;
1060 } 1065 }
1061 1066
1062 input_report_abs(input, ABS_MISC, wacom->id[idx]); /* report tool id */ 1067 input_report_abs(input, ABS_MISC,
1068 wacom_intuos_id_mangle(wacom->id[idx])); /* report tool id */
1063 input_report_key(input, wacom->tool[idx], 1); 1069 input_report_key(input, wacom->tool[idx], 1);
1064 input_event(input, EV_MSC, MSC_SERIAL, wacom->serial[idx]); 1070 input_event(input, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
1065 wacom->reporting_data = true; 1071 wacom->reporting_data = true;