aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet/wacom_wac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/tablet/wacom_wac.c')
-rw-r--r--drivers/input/tablet/wacom_wac.c741
1 files changed, 510 insertions, 231 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 47fd7a041c52..08ba5ad9c9be 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -14,6 +14,15 @@
14 14
15#include "wacom_wac.h" 15#include "wacom_wac.h"
16#include "wacom.h" 16#include "wacom.h"
17#include <linux/input/mt.h>
18
19/* resolution for penabled devices */
20#define WACOM_PL_RES 20
21#define WACOM_PENPRTN_RES 40
22#define WACOM_VOLITO_RES 50
23#define WACOM_GRAPHIRE_RES 80
24#define WACOM_INTUOS_RES 100
25#define WACOM_INTUOS3_RES 200
17 26
18static int wacom_penpartner_irq(struct wacom_wac *wacom) 27static int wacom_penpartner_irq(struct wacom_wac *wacom)
19{ 28{
@@ -674,187 +683,234 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
674 return 1; 683 return 1;
675} 684}
676 685
677 686static int wacom_tpc_mt_touch(struct wacom_wac *wacom)
678static void wacom_tpc_finger_in(struct wacom_wac *wacom, char *data, int idx)
679{ 687{
680 struct input_dev *input = wacom->input; 688 struct input_dev *input = wacom->input;
681 int finger = idx + 1; 689 unsigned char *data = wacom->data;
682 int x = le16_to_cpup((__le16 *)&data[finger * 2]) & 0x7fff; 690 int contact_with_no_pen_down_count = 0;
683 int y = le16_to_cpup((__le16 *)&data[4 + finger * 2]) & 0x7fff; 691 int i;
684 692
685 /* 693 for (i = 0; i < 2; i++) {
686 * Work around input core suppressing "duplicate" events since 694 int p = data[1] & (1 << i);
687 * we are abusing ABS_X/ABS_Y to transmit multi-finger data. 695 bool touch = p && !wacom->shared->stylus_in_proximity;
688 * This should go away once we switch to true multitouch
689 * protocol.
690 */
691 if (wacom->last_finger != finger) {
692 if (x == input_abs_get_val(input, ABS_X))
693 x++;
694 696
695 if (y == input_abs_get_val(input, ABS_Y)) 697 input_mt_slot(input, i);
696 y++; 698 input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
699 if (touch) {
700 int x = le16_to_cpup((__le16 *)&data[i * 2 + 2]) & 0x7fff;
701 int y = le16_to_cpup((__le16 *)&data[i * 2 + 6]) & 0x7fff;
702
703 input_report_abs(input, ABS_MT_POSITION_X, x);
704 input_report_abs(input, ABS_MT_POSITION_Y, y);
705 contact_with_no_pen_down_count++;
706 }
697 } 707 }
698 708
699 input_report_abs(input, ABS_X, x); 709 /* keep touch state for pen event */
700 input_report_abs(input, ABS_Y, y); 710 wacom->shared->touch_down = (contact_with_no_pen_down_count > 0);
701 input_report_abs(input, ABS_MISC, wacom->id[0]);
702 input_report_key(input, wacom->tool[finger], 1);
703 if (!idx)
704 input_report_key(input, BTN_TOUCH, 1);
705 input_event(input, EV_MSC, MSC_SERIAL, finger);
706 input_sync(input);
707 711
708 wacom->last_finger = finger; 712 input_mt_report_pointer_emulation(input, true);
709}
710 713
711static void wacom_tpc_touch_out(struct wacom_wac *wacom, int idx) 714 return 1;
712{
713 struct input_dev *input = wacom->input;
714 int finger = idx + 1;
715
716 input_report_abs(input, ABS_X, 0);
717 input_report_abs(input, ABS_Y, 0);
718 input_report_abs(input, ABS_MISC, 0);
719 input_report_key(input, wacom->tool[finger], 0);
720 if (!idx)
721 input_report_key(input, BTN_TOUCH, 0);
722 input_event(input, EV_MSC, MSC_SERIAL, finger);
723 input_sync(input);
724} 715}
725 716
726static void wacom_tpc_touch_in(struct wacom_wac *wacom, size_t len) 717static int wacom_tpc_single_touch(struct wacom_wac *wacom, size_t len)
727{ 718{
728 char *data = wacom->data; 719 char *data = wacom->data;
729 struct input_dev *input = wacom->input; 720 struct input_dev *input = wacom->input;
721 bool prox;
722 int x = 0, y = 0;
730 723
731 wacom->tool[1] = BTN_TOOL_DOUBLETAP; 724 if (!wacom->shared->stylus_in_proximity) {
732 wacom->id[0] = TOUCH_DEVICE_ID; 725 if (len == WACOM_PKGLEN_TPC1FG) {
733 wacom->tool[2] = BTN_TOOL_TRIPLETAP; 726 prox = data[0] & 0x01;
727 x = get_unaligned_le16(&data[1]);
728 y = get_unaligned_le16(&data[3]);
729 } else { /* with capacity */
730 prox = data[1] & 0x01;
731 x = le16_to_cpup((__le16 *)&data[2]);
732 y = le16_to_cpup((__le16 *)&data[4]);
733 }
734 } else
735 /* force touch out when pen is in prox */
736 prox = 0;
734 737
735 if (len != WACOM_PKGLEN_TPC1FG) { 738 if (prox) {
739 input_report_abs(input, ABS_X, x);
740 input_report_abs(input, ABS_Y, y);
741 }
742 input_report_key(input, BTN_TOUCH, prox);
736 743
737 switch (data[0]) { 744 /* keep touch state for pen events */
745 wacom->shared->touch_down = prox;
738 746
739 case WACOM_REPORT_TPC1FG: 747 return 1;
740 input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2])); 748}
741 input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4]));
742 input_report_abs(input, ABS_PRESSURE, le16_to_cpup((__le16 *)&data[6]));
743 input_report_key(input, BTN_TOUCH, le16_to_cpup((__le16 *)&data[6]));
744 input_report_abs(input, ABS_MISC, wacom->id[0]);
745 input_report_key(input, wacom->tool[1], 1);
746 input_sync(input);
747 break;
748 749
749 case WACOM_REPORT_TPC2FG: 750static int wacom_tpc_pen(struct wacom_wac *wacom)
750 if (data[1] & 0x01) 751{
751 wacom_tpc_finger_in(wacom, data, 0); 752 struct wacom_features *features = &wacom->features;
752 else if (wacom->id[1] & 0x01) 753 char *data = wacom->data;
753 wacom_tpc_touch_out(wacom, 0); 754 struct input_dev *input = wacom->input;
755 int pressure;
756 bool prox = data[1] & 0x20;
754 757
755 if (data[1] & 0x02) 758 if (!wacom->shared->stylus_in_proximity) /* first in prox */
756 wacom_tpc_finger_in(wacom, data, 1); 759 /* Going into proximity select tool */
757 else if (wacom->id[1] & 0x02) 760 wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;
758 wacom_tpc_touch_out(wacom, 1); 761
759 break; 762 /* keep pen state for touch events */
760 } 763 wacom->shared->stylus_in_proximity = prox;
761 } else { 764
762 input_report_abs(input, ABS_X, get_unaligned_le16(&data[1])); 765 /* send pen events only when touch is up or forced out */
763 input_report_abs(input, ABS_Y, get_unaligned_le16(&data[3])); 766 if (!wacom->shared->touch_down) {
764 input_report_key(input, BTN_TOUCH, 1); 767 input_report_key(input, BTN_STYLUS, data[1] & 0x02);
765 input_report_abs(input, ABS_MISC, wacom->id[1]); 768 input_report_key(input, BTN_STYLUS2, data[1] & 0x10);
766 input_report_key(input, wacom->tool[1], 1); 769 input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2]));
767 input_sync(input); 770 input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4]));
771 pressure = ((data[7] & 0x01) << 8) | data[6];
772 if (pressure < 0)
773 pressure = features->pressure_max + pressure + 1;
774 input_report_abs(input, ABS_PRESSURE, pressure);
775 input_report_key(input, BTN_TOUCH, data[1] & 0x05);
776 input_report_key(input, wacom->tool[0], prox);
777 return 1;
768 } 778 }
779
780 return 0;
769} 781}
770 782
771static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len) 783static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
772{ 784{
773 struct wacom_features *features = &wacom->features;
774 char *data = wacom->data; 785 char *data = wacom->data;
775 struct input_dev *input = wacom->input;
776 int prox = 0, pressure;
777 int retval = 0;
778 786
779 dbg("wacom_tpc_irq: received report #%d", data[0]); 787 dbg("wacom_tpc_irq: received report #%d", data[0]);
780 788
781 if (len == WACOM_PKGLEN_TPC1FG || /* single touch */ 789 if (len == WACOM_PKGLEN_TPC1FG || data[0] == WACOM_REPORT_TPC1FG)
782 data[0] == WACOM_REPORT_TPC1FG || /* single touch */ 790 return wacom_tpc_single_touch(wacom, len);
783 data[0] == WACOM_REPORT_TPC2FG) { /* 2FG touch */ 791 else if (data[0] == WACOM_REPORT_TPC2FG)
792 return wacom_tpc_mt_touch(wacom);
793 else if (data[0] == WACOM_REPORT_PENABLED)
794 return wacom_tpc_pen(wacom);
784 795
785 if (wacom->shared->stylus_in_proximity) { 796 return 0;
786 if (wacom->id[1] & 0x01) 797}
787 wacom_tpc_touch_out(wacom, 0);
788 798
789 if (wacom->id[1] & 0x02) 799static int wacom_bpt_touch(struct wacom_wac *wacom)
790 wacom_tpc_touch_out(wacom, 1); 800{
801 struct wacom_features *features = &wacom->features;
802 struct input_dev *input = wacom->input;
803 unsigned char *data = wacom->data;
804 int i;
791 805
792 wacom->id[1] = 0; 806 for (i = 0; i < 2; i++) {
793 return 0; 807 int p = data[9 * i + 2];
794 } 808 bool touch = p && !wacom->shared->stylus_in_proximity;
795 809
796 if (len == WACOM_PKGLEN_TPC1FG) { /* with touch */ 810 input_mt_slot(input, i);
797 prox = data[0] & 0x01; 811 input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
798 } else { /* with capacity */ 812 /*
799 if (data[0] == WACOM_REPORT_TPC1FG) 813 * Touch events need to be disabled while stylus is
800 /* single touch */ 814 * in proximity because user's hand is resting on touchpad
801 prox = data[1] & 0x01; 815 * and sending unwanted events. User expects tablet buttons
802 else 816 * to continue working though.
803 /* 2FG touch data */ 817 */
804 prox = data[1] & 0x03; 818 if (touch) {
819 int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff;
820 int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff;
821 if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) {
822 x <<= 5;
823 y <<= 5;
824 }
825 input_report_abs(input, ABS_MT_PRESSURE, p);
826 input_report_abs(input, ABS_MT_POSITION_X, x);
827 input_report_abs(input, ABS_MT_POSITION_Y, y);
805 } 828 }
829 }
806 830
807 if (prox) { 831 input_mt_report_pointer_emulation(input, true);
808 if (!wacom->id[1])
809 wacom->last_finger = 1;
810 wacom_tpc_touch_in(wacom, len);
811 } else {
812 if (data[0] == WACOM_REPORT_TPC2FG) {
813 /* 2FGT out-prox */
814 if (wacom->id[1] & 0x01)
815 wacom_tpc_touch_out(wacom, 0);
816 832
817 if (wacom->id[1] & 0x02) 833 input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0);
818 wacom_tpc_touch_out(wacom, 1); 834 input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0);
819 } else 835 input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0);
820 /* one finger touch */ 836 input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0);
821 wacom_tpc_touch_out(wacom, 0);
822 837
823 wacom->id[0] = 0; 838 input_sync(input);
824 } 839
825 /* keep prox bit to send proper out-prox event */ 840 return 0;
826 wacom->id[1] = prox; 841}
827 } else if (data[0] == WACOM_REPORT_PENABLED) { /* Penabled */ 842
828 prox = data[1] & 0x20; 843static int wacom_bpt_pen(struct wacom_wac *wacom)
829 844{
830 if (!wacom->shared->stylus_in_proximity) { /* first in prox */ 845 struct input_dev *input = wacom->input;
831 /* Going into proximity select tool */ 846 unsigned char *data = wacom->data;
832 wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; 847 int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
833 if (wacom->tool[0] == BTN_TOOL_PEN)
834 wacom->id[0] = STYLUS_DEVICE_ID;
835 else
836 wacom->id[0] = ERASER_DEVICE_ID;
837 848
849 /*
850 * Similar to Graphire protocol, data[1] & 0x20 is proximity and
851 * data[1] & 0x18 is tool ID. 0x30 is safety check to ignore
852 * 2 unused tool ID's.
853 */
854 prox = (data[1] & 0x30) == 0x30;
855
856 /*
857 * All reports shared between PEN and RUBBER tool must be
858 * forced to a known starting value (zero) when transitioning to
859 * out-of-prox.
860 *
861 * If not reset then, to userspace, it will look like lost events
862 * if new tool comes in-prox with same values as previous tool sent.
863 *
864 * Hardware does report zero in most out-of-prox cases but not all.
865 */
866 if (prox) {
867 if (!wacom->shared->stylus_in_proximity) {
868 if (data[1] & 0x08) {
869 wacom->tool[0] = BTN_TOOL_RUBBER;
870 wacom->id[0] = ERASER_DEVICE_ID;
871 } else {
872 wacom->tool[0] = BTN_TOOL_PEN;
873 wacom->id[0] = STYLUS_DEVICE_ID;
874 }
838 wacom->shared->stylus_in_proximity = true; 875 wacom->shared->stylus_in_proximity = true;
839 } 876 }
840 input_report_key(input, BTN_STYLUS, data[1] & 0x02); 877 x = le16_to_cpup((__le16 *)&data[2]);
841 input_report_key(input, BTN_STYLUS2, data[1] & 0x10); 878 y = le16_to_cpup((__le16 *)&data[4]);
842 input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2])); 879 p = le16_to_cpup((__le16 *)&data[6]);
843 input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4])); 880 d = data[8];
844 pressure = ((data[7] & 0x01) << 8) | data[6]; 881 pen = data[1] & 0x01;
845 if (pressure < 0) 882 btn1 = data[1] & 0x02;
846 pressure = features->pressure_max + pressure + 1; 883 btn2 = data[1] & 0x04;
847 input_report_abs(input, ABS_PRESSURE, pressure);
848 input_report_key(input, BTN_TOUCH, data[1] & 0x05);
849 if (!prox) { /* out-prox */
850 wacom->id[0] = 0;
851 wacom->shared->stylus_in_proximity = false;
852 }
853 input_report_key(input, wacom->tool[0], prox);
854 input_report_abs(input, ABS_MISC, wacom->id[0]);
855 retval = 1;
856 } 884 }
857 return retval; 885
886 input_report_key(input, BTN_TOUCH, pen);
887 input_report_key(input, BTN_STYLUS, btn1);
888 input_report_key(input, BTN_STYLUS2, btn2);
889
890 input_report_abs(input, ABS_X, x);
891 input_report_abs(input, ABS_Y, y);
892 input_report_abs(input, ABS_PRESSURE, p);
893 input_report_abs(input, ABS_DISTANCE, d);
894
895 if (!prox) {
896 wacom->id[0] = 0;
897 wacom->shared->stylus_in_proximity = false;
898 }
899
900 input_report_key(input, wacom->tool[0], prox); /* PEN or RUBBER */
901 input_report_abs(input, ABS_MISC, wacom->id[0]); /* TOOL ID */
902
903 return 1;
904}
905
906static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len)
907{
908 if (len == WACOM_PKGLEN_BBTOUCH)
909 return wacom_bpt_touch(wacom);
910 else if (len == WACOM_PKGLEN_BBFUN)
911 return wacom_bpt_pen(wacom);
912
913 return 0;
858} 914}
859 915
860void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) 916void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
@@ -902,6 +958,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
902 sync = wacom_tpc_irq(wacom_wac, len); 958 sync = wacom_tpc_irq(wacom_wac, len);
903 break; 959 break;
904 960
961 case BAMBOO_PT:
962 sync = wacom_bpt_irq(wacom_wac, len);
963 break;
964
905 default: 965 default:
906 sync = false; 966 sync = false;
907 break; 967 break;
@@ -911,26 +971,17 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
911 input_sync(wacom_wac->input); 971 input_sync(wacom_wac->input);
912} 972}
913 973
914static void wacom_setup_intuos(struct wacom_wac *wacom_wac) 974static void wacom_setup_cintiq(struct wacom_wac *wacom_wac)
915{ 975{
916 struct input_dev *input_dev = wacom_wac->input; 976 struct input_dev *input_dev = wacom_wac->input;
917 977
918 input_set_capability(input_dev, EV_MSC, MSC_SERIAL); 978 input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
919 input_set_capability(input_dev, EV_REL, REL_WHEEL);
920
921 __set_bit(BTN_LEFT, input_dev->keybit);
922 __set_bit(BTN_RIGHT, input_dev->keybit);
923 __set_bit(BTN_MIDDLE, input_dev->keybit);
924 __set_bit(BTN_SIDE, input_dev->keybit);
925 __set_bit(BTN_EXTRA, input_dev->keybit);
926 979
927 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); 980 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
928 __set_bit(BTN_TOOL_PEN, input_dev->keybit); 981 __set_bit(BTN_TOOL_PEN, input_dev->keybit);
929 __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
930 __set_bit(BTN_TOOL_BRUSH, input_dev->keybit); 982 __set_bit(BTN_TOOL_BRUSH, input_dev->keybit);
931 __set_bit(BTN_TOOL_PENCIL, input_dev->keybit); 983 __set_bit(BTN_TOOL_PENCIL, input_dev->keybit);
932 __set_bit(BTN_TOOL_AIRBRUSH, input_dev->keybit); 984 __set_bit(BTN_TOOL_AIRBRUSH, input_dev->keybit);
933 __set_bit(BTN_TOOL_LENS, input_dev->keybit);
934 __set_bit(BTN_STYLUS, input_dev->keybit); 985 __set_bit(BTN_STYLUS, input_dev->keybit);
935 __set_bit(BTN_STYLUS2, input_dev->keybit); 986 __set_bit(BTN_STYLUS2, input_dev->keybit);
936 987
@@ -939,10 +990,62 @@ static void wacom_setup_intuos(struct wacom_wac *wacom_wac)
939 input_set_abs_params(input_dev, ABS_WHEEL, 0, 1023, 0, 0); 990 input_set_abs_params(input_dev, ABS_WHEEL, 0, 1023, 0, 0);
940 input_set_abs_params(input_dev, ABS_TILT_X, 0, 127, 0, 0); 991 input_set_abs_params(input_dev, ABS_TILT_X, 0, 127, 0, 0);
941 input_set_abs_params(input_dev, ABS_TILT_Y, 0, 127, 0, 0); 992 input_set_abs_params(input_dev, ABS_TILT_Y, 0, 127, 0, 0);
993}
994
995static void wacom_setup_intuos(struct wacom_wac *wacom_wac)
996{
997 struct input_dev *input_dev = wacom_wac->input;
998
999 input_set_capability(input_dev, EV_REL, REL_WHEEL);
1000
1001 wacom_setup_cintiq(wacom_wac);
1002
1003 __set_bit(BTN_LEFT, input_dev->keybit);
1004 __set_bit(BTN_RIGHT, input_dev->keybit);
1005 __set_bit(BTN_MIDDLE, input_dev->keybit);
1006 __set_bit(BTN_SIDE, input_dev->keybit);
1007 __set_bit(BTN_EXTRA, input_dev->keybit);
1008 __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
1009 __set_bit(BTN_TOOL_LENS, input_dev->keybit);
1010
942 input_set_abs_params(input_dev, ABS_RZ, -900, 899, 0, 0); 1011 input_set_abs_params(input_dev, ABS_RZ, -900, 899, 0, 0);
943 input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0, 0); 1012 input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0, 0);
944} 1013}
945 1014
1015void wacom_setup_device_quirks(struct wacom_features *features)
1016{
1017
1018 /* touch device found but size is not defined. use default */
1019 if (features->device_type == BTN_TOOL_FINGER && !features->x_max) {
1020 features->x_max = 1023;
1021 features->y_max = 1023;
1022 }
1023
1024 /* these device have multiple inputs */
1025 if (features->type == TABLETPC || features->type == TABLETPC2FG ||
1026 features->type == BAMBOO_PT)
1027 features->quirks |= WACOM_QUIRK_MULTI_INPUT;
1028
1029 /* quirks for bamboo touch */
1030 if (features->type == BAMBOO_PT &&
1031 features->device_type == BTN_TOOL_DOUBLETAP) {
1032 features->x_max <<= 5;
1033 features->y_max <<= 5;
1034 features->x_fuzz <<= 5;
1035 features->y_fuzz <<= 5;
1036 features->pressure_max = 256;
1037 features->pressure_fuzz = 16;
1038 features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES;
1039 }
1040}
1041
1042static unsigned int wacom_calculate_touch_res(unsigned int logical_max,
1043 unsigned int physical_max)
1044{
1045 /* Touch physical dimensions are in 100th of mm */
1046 return (logical_max * 100) / physical_max;
1047}
1048
946void wacom_setup_input_capabilities(struct input_dev *input_dev, 1049void wacom_setup_input_capabilities(struct input_dev *input_dev,
947 struct wacom_wac *wacom_wac) 1050 struct wacom_wac *wacom_wac)
948{ 1051{
@@ -953,9 +1056,25 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
953 1056
954 __set_bit(BTN_TOUCH, input_dev->keybit); 1057 __set_bit(BTN_TOUCH, input_dev->keybit);
955 1058
956 input_set_abs_params(input_dev, ABS_X, 0, features->x_max, 4, 0); 1059 input_set_abs_params(input_dev, ABS_X, 0, features->x_max,
957 input_set_abs_params(input_dev, ABS_Y, 0, features->y_max, 4, 0); 1060 features->x_fuzz, 0);
958 input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max, 0, 0); 1061 input_set_abs_params(input_dev, ABS_Y, 0, features->y_max,
1062 features->y_fuzz, 0);
1063 input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max,
1064 features->pressure_fuzz, 0);
1065
1066 if (features->device_type == BTN_TOOL_PEN) {
1067 /* penabled devices have fixed resolution for each model */
1068 input_abs_set_res(input_dev, ABS_X, features->x_resolution);
1069 input_abs_set_res(input_dev, ABS_Y, features->y_resolution);
1070 } else {
1071 input_abs_set_res(input_dev, ABS_X,
1072 wacom_calculate_touch_res(features->x_max,
1073 features->x_phy));
1074 input_abs_set_res(input_dev, ABS_Y,
1075 wacom_calculate_touch_res(features->y_max,
1076 features->y_phy));
1077 }
959 1078
960 __set_bit(ABS_MISC, input_dev->absbit); 1079 __set_bit(ABS_MISC, input_dev->absbit);
961 1080
@@ -1005,9 +1124,19 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1005 __set_bit(BTN_9, input_dev->keybit); 1124 __set_bit(BTN_9, input_dev->keybit);
1006 /* fall through */ 1125 /* fall through */
1007 1126
1127 case CINTIQ:
1128 for (i = 0; i < 8; i++)
1129 __set_bit(BTN_0 + i, input_dev->keybit);
1130 __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
1131
1132 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
1133 input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
1134 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1135 wacom_setup_cintiq(wacom_wac);
1136 break;
1137
1008 case INTUOS3: 1138 case INTUOS3:
1009 case INTUOS3L: 1139 case INTUOS3L:
1010 case CINTIQ:
1011 __set_bit(BTN_4, input_dev->keybit); 1140 __set_bit(BTN_4, input_dev->keybit);
1012 __set_bit(BTN_5, input_dev->keybit); 1141 __set_bit(BTN_5, input_dev->keybit);
1013 __set_bit(BTN_6, input_dev->keybit); 1142 __set_bit(BTN_6, input_dev->keybit);
@@ -1048,19 +1177,20 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1048 break; 1177 break;
1049 1178
1050 case TABLETPC2FG: 1179 case TABLETPC2FG:
1051 if (features->device_type == BTN_TOOL_TRIPLETAP) { 1180 if (features->device_type == BTN_TOOL_DOUBLETAP) {
1052 __set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit); 1181
1053 input_set_capability(input_dev, EV_MSC, MSC_SERIAL); 1182 input_mt_init_slots(input_dev, 2);
1183 input_set_abs_params(input_dev, ABS_MT_TOOL_TYPE,
1184 0, MT_TOOL_MAX, 0, 0);
1185 input_set_abs_params(input_dev, ABS_MT_POSITION_X,
1186 0, features->x_max, 0, 0);
1187 input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
1188 0, features->y_max, 0, 0);
1054 } 1189 }
1055 /* fall through */ 1190 /* fall through */
1056 1191
1057 case TABLETPC: 1192 case TABLETPC:
1058 if (features->device_type == BTN_TOOL_DOUBLETAP || 1193 __clear_bit(ABS_MISC, input_dev->absbit);
1059 features->device_type == BTN_TOOL_TRIPLETAP) {
1060 input_set_abs_params(input_dev, ABS_RX, 0, features->x_phy, 0, 0);
1061 input_set_abs_params(input_dev, ABS_RY, 0, features->y_phy, 0, 0);
1062 __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
1063 }
1064 1194
1065 if (features->device_type != BTN_TOOL_PEN) 1195 if (features->device_type != BTN_TOOL_PEN)
1066 break; /* no need to process stylus stuff */ 1196 break; /* no need to process stylus stuff */
@@ -1078,148 +1208,285 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1078 case PENPARTNER: 1208 case PENPARTNER:
1079 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); 1209 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
1080 break; 1210 break;
1211
1212 case BAMBOO_PT:
1213 __clear_bit(ABS_MISC, input_dev->absbit);
1214
1215 if (features->device_type == BTN_TOOL_DOUBLETAP) {
1216 __set_bit(BTN_LEFT, input_dev->keybit);
1217 __set_bit(BTN_FORWARD, input_dev->keybit);
1218 __set_bit(BTN_BACK, input_dev->keybit);
1219 __set_bit(BTN_RIGHT, input_dev->keybit);
1220
1221 __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
1222 __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
1223
1224 input_mt_init_slots(input_dev, 2);
1225 input_set_abs_params(input_dev, ABS_MT_POSITION_X,
1226 0, features->x_max,
1227 features->x_fuzz, 0);
1228 input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
1229 0, features->y_max,
1230 features->y_fuzz, 0);
1231 input_set_abs_params(input_dev, ABS_MT_PRESSURE,
1232 0, features->pressure_max,
1233 features->pressure_fuzz, 0);
1234 } else if (features->device_type == BTN_TOOL_PEN) {
1235 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
1236 __set_bit(BTN_TOOL_PEN, input_dev->keybit);
1237 __set_bit(BTN_STYLUS, input_dev->keybit);
1238 __set_bit(BTN_STYLUS2, input_dev->keybit);
1239 }
1240 break;
1081 } 1241 }
1082} 1242}
1083 1243
1084static const struct wacom_features wacom_features_0x00 = 1244static const struct wacom_features wacom_features_0x00 =
1085 { "Wacom Penpartner", WACOM_PKGLEN_PENPRTN, 5040, 3780, 255, 0, PENPARTNER }; 1245 { "Wacom Penpartner", WACOM_PKGLEN_PENPRTN, 5040, 3780, 255,
1246 0, PENPARTNER, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES };
1086static const struct wacom_features wacom_features_0x10 = 1247static const struct wacom_features wacom_features_0x10 =
1087 { "Wacom Graphire", WACOM_PKGLEN_GRAPHIRE, 10206, 7422, 511, 63, GRAPHIRE }; 1248 { "Wacom Graphire", WACOM_PKGLEN_GRAPHIRE, 10206, 7422, 511,
1249 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
1088static const struct wacom_features wacom_features_0x11 = 1250static const struct wacom_features wacom_features_0x11 =
1089 { "Wacom Graphire2 4x5", WACOM_PKGLEN_GRAPHIRE, 10206, 7422, 511, 63, GRAPHIRE }; 1251 { "Wacom Graphire2 4x5", WACOM_PKGLEN_GRAPHIRE, 10206, 7422, 511,
1252 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
1090static const struct wacom_features wacom_features_0x12 = 1253static const struct wacom_features wacom_features_0x12 =
1091 { "Wacom Graphire2 5x7", WACOM_PKGLEN_GRAPHIRE, 13918, 10206, 511, 63, GRAPHIRE }; 1254 { "Wacom Graphire2 5x7", WACOM_PKGLEN_GRAPHIRE, 13918, 10206, 511,
1255 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
1092static const struct wacom_features wacom_features_0x13 = 1256static const struct wacom_features wacom_features_0x13 =
1093 { "Wacom Graphire3", WACOM_PKGLEN_GRAPHIRE, 10208, 7424, 511, 63, GRAPHIRE }; 1257 { "Wacom Graphire3", WACOM_PKGLEN_GRAPHIRE, 10208, 7424, 511,
1258 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
1094static const struct wacom_features wacom_features_0x14 = 1259static const struct wacom_features wacom_features_0x14 =
1095 { "Wacom Graphire3 6x8", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511, 63, GRAPHIRE }; 1260 { "Wacom Graphire3 6x8", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511,
1261 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
1096static const struct wacom_features wacom_features_0x15 = 1262static const struct wacom_features wacom_features_0x15 =
1097 { "Wacom Graphire4 4x5", WACOM_PKGLEN_GRAPHIRE, 10208, 7424, 511, 63, WACOM_G4 }; 1263 { "Wacom Graphire4 4x5", WACOM_PKGLEN_GRAPHIRE, 10208, 7424, 511,
1264 63, WACOM_G4, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
1098static const struct wacom_features wacom_features_0x16 = 1265static const struct wacom_features wacom_features_0x16 =
1099 { "Wacom Graphire4 6x8", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511, 63, WACOM_G4 }; 1266 { "Wacom Graphire4 6x8", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511,
1267 63, WACOM_G4, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
1100static const struct wacom_features wacom_features_0x17 = 1268static const struct wacom_features wacom_features_0x17 =
1101 { "Wacom BambooFun 4x5", WACOM_PKGLEN_BBFUN, 14760, 9225, 511, 63, WACOM_MO }; 1269 { "Wacom BambooFun 4x5", WACOM_PKGLEN_BBFUN, 14760, 9225, 511,
1270 63, WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1102static const struct wacom_features wacom_features_0x18 = 1271static const struct wacom_features wacom_features_0x18 =
1103 { "Wacom BambooFun 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 511, 63, WACOM_MO }; 1272 { "Wacom BambooFun 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 511,
1273 63, WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1104static const struct wacom_features wacom_features_0x19 = 1274static const struct wacom_features wacom_features_0x19 =
1105 { "Wacom Bamboo1 Medium", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511, 63, GRAPHIRE }; 1275 { "Wacom Bamboo1 Medium", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511,
1276 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
1106static const struct wacom_features wacom_features_0x60 = 1277static const struct wacom_features wacom_features_0x60 =
1107 { "Wacom Volito", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511, 63, GRAPHIRE }; 1278 { "Wacom Volito", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511,
1279 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
1108static const struct wacom_features wacom_features_0x61 = 1280static const struct wacom_features wacom_features_0x61 =
1109 { "Wacom PenStation2", WACOM_PKGLEN_GRAPHIRE, 3250, 2320, 255, 63, GRAPHIRE }; 1281 { "Wacom PenStation2", WACOM_PKGLEN_GRAPHIRE, 3250, 2320, 255,
1282 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
1110static const struct wacom_features wacom_features_0x62 = 1283static const struct wacom_features wacom_features_0x62 =
1111 { "Wacom Volito2 4x5", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511, 63, GRAPHIRE }; 1284 { "Wacom Volito2 4x5", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511,
1285 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
1112static const struct wacom_features wacom_features_0x63 = 1286static const struct wacom_features wacom_features_0x63 =
1113 { "Wacom Volito2 2x3", WACOM_PKGLEN_GRAPHIRE, 3248, 2320, 511, 63, GRAPHIRE }; 1287 { "Wacom Volito2 2x3", WACOM_PKGLEN_GRAPHIRE, 3248, 2320, 511,
1288 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
1114static const struct wacom_features wacom_features_0x64 = 1289static const struct wacom_features wacom_features_0x64 =
1115 { "Wacom PenPartner2", WACOM_PKGLEN_GRAPHIRE, 3250, 2320, 511, 63, GRAPHIRE }; 1290 { "Wacom PenPartner2", WACOM_PKGLEN_GRAPHIRE, 3250, 2320, 511,
1291 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
1116static const struct wacom_features wacom_features_0x65 = 1292static const struct wacom_features wacom_features_0x65 =
1117 { "Wacom Bamboo", WACOM_PKGLEN_BBFUN, 14760, 9225, 511, 63, WACOM_MO }; 1293 { "Wacom Bamboo", WACOM_PKGLEN_BBFUN, 14760, 9225, 511,
1294 63, WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1118static const struct wacom_features wacom_features_0x69 = 1295static const struct wacom_features wacom_features_0x69 =
1119 { "Wacom Bamboo1", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511, 63, GRAPHIRE }; 1296 { "Wacom Bamboo1", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511,
1297 63, GRAPHIRE, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES };
1120static const struct wacom_features wacom_features_0x20 = 1298static const struct wacom_features wacom_features_0x20 =
1121 { "Wacom Intuos 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023, 31, INTUOS }; 1299 { "Wacom Intuos 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023,
1300 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1122static const struct wacom_features wacom_features_0x21 = 1301static const struct wacom_features wacom_features_0x21 =
1123 { "Wacom Intuos 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 31, INTUOS }; 1302 { "Wacom Intuos 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023,
1303 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1124static const struct wacom_features wacom_features_0x22 = 1304static const struct wacom_features wacom_features_0x22 =
1125 { "Wacom Intuos 9x12", WACOM_PKGLEN_INTUOS, 30480, 24060, 1023, 31, INTUOS }; 1305 { "Wacom Intuos 9x12", WACOM_PKGLEN_INTUOS, 30480, 24060, 1023,
1306 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1126static const struct wacom_features wacom_features_0x23 = 1307static const struct wacom_features wacom_features_0x23 =
1127 { "Wacom Intuos 12x12", WACOM_PKGLEN_INTUOS, 30480, 31680, 1023, 31, INTUOS }; 1308 { "Wacom Intuos 12x12", WACOM_PKGLEN_INTUOS, 30480, 31680, 1023,
1309 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1128static const struct wacom_features wacom_features_0x24 = 1310static const struct wacom_features wacom_features_0x24 =
1129 { "Wacom Intuos 12x18", WACOM_PKGLEN_INTUOS, 45720, 31680, 1023, 31, INTUOS }; 1311 { "Wacom Intuos 12x18", WACOM_PKGLEN_INTUOS, 45720, 31680, 1023,
1312 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1130static const struct wacom_features wacom_features_0x30 = 1313static const struct wacom_features wacom_features_0x30 =
1131 { "Wacom PL400", WACOM_PKGLEN_GRAPHIRE, 5408, 4056, 255, 0, PL }; 1314 { "Wacom PL400", WACOM_PKGLEN_GRAPHIRE, 5408, 4056, 255,
1315 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1132static const struct wacom_features wacom_features_0x31 = 1316static const struct wacom_features wacom_features_0x31 =
1133 { "Wacom PL500", WACOM_PKGLEN_GRAPHIRE, 6144, 4608, 255, 0, PL }; 1317 { "Wacom PL500", WACOM_PKGLEN_GRAPHIRE, 6144, 4608, 255,
1318 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1134static const struct wacom_features wacom_features_0x32 = 1319static const struct wacom_features wacom_features_0x32 =
1135 { "Wacom PL600", WACOM_PKGLEN_GRAPHIRE, 6126, 4604, 255, 0, PL }; 1320 { "Wacom PL600", WACOM_PKGLEN_GRAPHIRE, 6126, 4604, 255,
1321 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1136static const struct wacom_features wacom_features_0x33 = 1322static const struct wacom_features wacom_features_0x33 =
1137 { "Wacom PL600SX", WACOM_PKGLEN_GRAPHIRE, 6260, 5016, 255, 0, PL }; 1323 { "Wacom PL600SX", WACOM_PKGLEN_GRAPHIRE, 6260, 5016, 255,
1324 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1138static const struct wacom_features wacom_features_0x34 = 1325static const struct wacom_features wacom_features_0x34 =
1139 { "Wacom PL550", WACOM_PKGLEN_GRAPHIRE, 6144, 4608, 511, 0, PL }; 1326 { "Wacom PL550", WACOM_PKGLEN_GRAPHIRE, 6144, 4608, 511,
1327 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1140static const struct wacom_features wacom_features_0x35 = 1328static const struct wacom_features wacom_features_0x35 =
1141 { "Wacom PL800", WACOM_PKGLEN_GRAPHIRE, 7220, 5780, 511, 0, PL }; 1329 { "Wacom PL800", WACOM_PKGLEN_GRAPHIRE, 7220, 5780, 511,
1330 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1142static const struct wacom_features wacom_features_0x37 = 1331static const struct wacom_features wacom_features_0x37 =
1143 { "Wacom PL700", WACOM_PKGLEN_GRAPHIRE, 6758, 5406, 511, 0, PL }; 1332 { "Wacom PL700", WACOM_PKGLEN_GRAPHIRE, 6758, 5406, 511,
1333 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1144static const struct wacom_features wacom_features_0x38 = 1334static const struct wacom_features wacom_features_0x38 =
1145 { "Wacom PL510", WACOM_PKGLEN_GRAPHIRE, 6282, 4762, 511, 0, PL }; 1335 { "Wacom PL510", WACOM_PKGLEN_GRAPHIRE, 6282, 4762, 511,
1336 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1146static const struct wacom_features wacom_features_0x39 = 1337static const struct wacom_features wacom_features_0x39 =
1147 { "Wacom DTU710", WACOM_PKGLEN_GRAPHIRE, 34080, 27660, 511, 0, PL }; 1338 { "Wacom DTU710", WACOM_PKGLEN_GRAPHIRE, 34080, 27660, 511,
1339 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1148static const struct wacom_features wacom_features_0xC4 = 1340static const struct wacom_features wacom_features_0xC4 =
1149 { "Wacom DTF521", WACOM_PKGLEN_GRAPHIRE, 6282, 4762, 511, 0, PL }; 1341 { "Wacom DTF521", WACOM_PKGLEN_GRAPHIRE, 6282, 4762, 511,
1342 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1150static const struct wacom_features wacom_features_0xC0 = 1343static const struct wacom_features wacom_features_0xC0 =
1151 { "Wacom DTF720", WACOM_PKGLEN_GRAPHIRE, 6858, 5506, 511, 0, PL }; 1344 { "Wacom DTF720", WACOM_PKGLEN_GRAPHIRE, 6858, 5506, 511,
1345 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1152static const struct wacom_features wacom_features_0xC2 = 1346static const struct wacom_features wacom_features_0xC2 =
1153 { "Wacom DTF720a", WACOM_PKGLEN_GRAPHIRE, 6858, 5506, 511, 0, PL }; 1347 { "Wacom DTF720a", WACOM_PKGLEN_GRAPHIRE, 6858, 5506, 511,
1348 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1154static const struct wacom_features wacom_features_0x03 = 1349static const struct wacom_features wacom_features_0x03 =
1155 { "Wacom Cintiq Partner", WACOM_PKGLEN_GRAPHIRE, 20480, 15360, 511, 0, PTU }; 1350 { "Wacom Cintiq Partner", WACOM_PKGLEN_GRAPHIRE, 20480, 15360, 511,
1351 0, PTU, WACOM_PL_RES, WACOM_PL_RES };
1156static const struct wacom_features wacom_features_0x41 = 1352static const struct wacom_features wacom_features_0x41 =
1157 { "Wacom Intuos2 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023, 31, INTUOS }; 1353 { "Wacom Intuos2 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023,
1354 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1158static const struct wacom_features wacom_features_0x42 = 1355static const struct wacom_features wacom_features_0x42 =
1159 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 31, INTUOS }; 1356 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023,
1357 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1160static const struct wacom_features wacom_features_0x43 = 1358static const struct wacom_features wacom_features_0x43 =
1161 { "Wacom Intuos2 9x12", WACOM_PKGLEN_INTUOS, 30480, 24060, 1023, 31, INTUOS }; 1359 { "Wacom Intuos2 9x12", WACOM_PKGLEN_INTUOS, 30480, 24060, 1023,
1360 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1162static const struct wacom_features wacom_features_0x44 = 1361static const struct wacom_features wacom_features_0x44 =
1163 { "Wacom Intuos2 12x12", WACOM_PKGLEN_INTUOS, 30480, 31680, 1023, 31, INTUOS }; 1362 { "Wacom Intuos2 12x12", WACOM_PKGLEN_INTUOS, 30480, 31680, 1023,
1363 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1164static const struct wacom_features wacom_features_0x45 = 1364static const struct wacom_features wacom_features_0x45 =
1165 { "Wacom Intuos2 12x18", WACOM_PKGLEN_INTUOS, 45720, 31680, 1023, 31, INTUOS }; 1365 { "Wacom Intuos2 12x18", WACOM_PKGLEN_INTUOS, 45720, 31680, 1023,
1366 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1166static const struct wacom_features wacom_features_0xB0 = 1367static const struct wacom_features wacom_features_0xB0 =
1167 { "Wacom Intuos3 4x5", WACOM_PKGLEN_INTUOS, 25400, 20320, 1023, 63, INTUOS3S }; 1368 { "Wacom Intuos3 4x5", WACOM_PKGLEN_INTUOS, 25400, 20320, 1023,
1369 63, INTUOS3S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1168static const struct wacom_features wacom_features_0xB1 = 1370static const struct wacom_features wacom_features_0xB1 =
1169 { "Wacom Intuos3 6x8", WACOM_PKGLEN_INTUOS, 40640, 30480, 1023, 63, INTUOS3 }; 1371 { "Wacom Intuos3 6x8", WACOM_PKGLEN_INTUOS, 40640, 30480, 1023,
1372 63, INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1170static const struct wacom_features wacom_features_0xB2 = 1373static const struct wacom_features wacom_features_0xB2 =
1171 { "Wacom Intuos3 9x12", WACOM_PKGLEN_INTUOS, 60960, 45720, 1023, 63, INTUOS3 }; 1374 { "Wacom Intuos3 9x12", WACOM_PKGLEN_INTUOS, 60960, 45720, 1023,
1375 63, INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1172static const struct wacom_features wacom_features_0xB3 = 1376static const struct wacom_features wacom_features_0xB3 =
1173 { "Wacom Intuos3 12x12", WACOM_PKGLEN_INTUOS, 60960, 60960, 1023, 63, INTUOS3L }; 1377 { "Wacom Intuos3 12x12", WACOM_PKGLEN_INTUOS, 60960, 60960, 1023,
1378 63, INTUOS3L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1174static const struct wacom_features wacom_features_0xB4 = 1379static const struct wacom_features wacom_features_0xB4 =
1175 { "Wacom Intuos3 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 1023, 63, INTUOS3L }; 1380 { "Wacom Intuos3 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 1023,
1381 63, INTUOS3L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1176static const struct wacom_features wacom_features_0xB5 = 1382static const struct wacom_features wacom_features_0xB5 =
1177 { "Wacom Intuos3 6x11", WACOM_PKGLEN_INTUOS, 54204, 31750, 1023, 63, INTUOS3 }; 1383 { "Wacom Intuos3 6x11", WACOM_PKGLEN_INTUOS, 54204, 31750, 1023,
1384 63, INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1178static const struct wacom_features wacom_features_0xB7 = 1385static const struct wacom_features wacom_features_0xB7 =
1179 { "Wacom Intuos3 4x6", WACOM_PKGLEN_INTUOS, 31496, 19685, 1023, 63, INTUOS3S }; 1386 { "Wacom Intuos3 4x6", WACOM_PKGLEN_INTUOS, 31496, 19685, 1023,
1387 63, INTUOS3S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1180static const struct wacom_features wacom_features_0xB8 = 1388static const struct wacom_features wacom_features_0xB8 =
1181 { "Wacom Intuos4 4x6", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, 63, INTUOS4S }; 1389 { "Wacom Intuos4 4x6", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047,
1390 63, INTUOS4S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1182static const struct wacom_features wacom_features_0xB9 = 1391static const struct wacom_features wacom_features_0xB9 =
1183 { "Wacom Intuos4 6x9", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, 63, INTUOS4 }; 1392 { "Wacom Intuos4 6x9", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047,
1393 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1184static const struct wacom_features wacom_features_0xBA = 1394static const struct wacom_features wacom_features_0xBA =
1185 { "Wacom Intuos4 8x13", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047, 63, INTUOS4L }; 1395 { "Wacom Intuos4 8x13", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047,
1396 63, INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1186static const struct wacom_features wacom_features_0xBB = 1397static const struct wacom_features wacom_features_0xBB =
1187 { "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047, 63, INTUOS4L }; 1398 { "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047,
1399 63, INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1188static const struct wacom_features wacom_features_0xBC = 1400static const struct wacom_features wacom_features_0xBC =
1189 { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047, 63, INTUOS4 }; 1401 { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047,
1402 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1190static const struct wacom_features wacom_features_0x3F = 1403static const struct wacom_features wacom_features_0x3F =
1191 { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023, 63, CINTIQ }; 1404 { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023,
1405 63, CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1192static const struct wacom_features wacom_features_0xC5 = 1406static const struct wacom_features wacom_features_0xC5 =
1193 { "Wacom Cintiq 20WSX", WACOM_PKGLEN_INTUOS, 86680, 54180, 1023, 63, WACOM_BEE }; 1407 { "Wacom Cintiq 20WSX", WACOM_PKGLEN_INTUOS, 86680, 54180, 1023,
1408 63, WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1194static const struct wacom_features wacom_features_0xC6 = 1409static const struct wacom_features wacom_features_0xC6 =
1195 { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023, 63, WACOM_BEE }; 1410 { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023,
1411 63, WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1196static const struct wacom_features wacom_features_0xC7 = 1412static const struct wacom_features wacom_features_0xC7 =
1197 { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511, 0, PL }; 1413 { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511,
1414 0, PL, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1198static const struct wacom_features wacom_features_0xCE = 1415static const struct wacom_features wacom_features_0xCE =
1199 { "Wacom DTU2231", WACOM_PKGLEN_GRAPHIRE, 47864, 27011, 511, 0, DTU }; 1416 { "Wacom DTU2231", WACOM_PKGLEN_GRAPHIRE, 47864, 27011, 511,
1417 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1200static const struct wacom_features wacom_features_0xF0 = 1418static const struct wacom_features wacom_features_0xF0 =
1201 { "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511, 0, DTU }; 1419 { "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511,
1420 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1202static const struct wacom_features wacom_features_0xCC = 1421static const struct wacom_features wacom_features_0xCC =
1203 { "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87200, 65600, 2047, 63, WACOM_21UX2 }; 1422 { "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87200, 65600, 2047,
1423 63, WACOM_21UX2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1204static const struct wacom_features wacom_features_0x90 = 1424static const struct wacom_features wacom_features_0x90 =
1205 { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }; 1425 { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
1426 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1206static const struct wacom_features wacom_features_0x93 = 1427static const struct wacom_features wacom_features_0x93 =
1207 { "Wacom ISDv4 93", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }; 1428 { "Wacom ISDv4 93", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
1429 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1208static const struct wacom_features wacom_features_0x9A = 1430static const struct wacom_features wacom_features_0x9A =
1209 { "Wacom ISDv4 9A", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }; 1431 { "Wacom ISDv4 9A", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
1432 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1210static const struct wacom_features wacom_features_0x9F = 1433static const struct wacom_features wacom_features_0x9F =
1211 { "Wacom ISDv4 9F", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }; 1434 { "Wacom ISDv4 9F", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
1435 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1212static const struct wacom_features wacom_features_0xE2 = 1436static const struct wacom_features wacom_features_0xE2 =
1213 { "Wacom ISDv4 E2", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, 0, TABLETPC2FG }; 1437 { "Wacom ISDv4 E2", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255,
1438 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1214static const struct wacom_features wacom_features_0xE3 = 1439static const struct wacom_features wacom_features_0xE3 =
1215 { "Wacom ISDv4 E3", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, 0, TABLETPC2FG }; 1440 { "Wacom ISDv4 E3", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255,
1441 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1442static const struct wacom_features wacom_features_0xE6 =
1443 { "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255,
1444 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1216static const struct wacom_features wacom_features_0x47 = 1445static const struct wacom_features wacom_features_0x47 =
1217 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 31, INTUOS }; 1446 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023,
1447 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1448static const struct wacom_features wacom_features_0xD0 =
1449 { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1450 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1451static const struct wacom_features wacom_features_0xD1 =
1452 { "Wacom Bamboo 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1453 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1454static const struct wacom_features wacom_features_0xD2 =
1455 { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1456 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1457static const struct wacom_features wacom_features_0xD3 =
1458 { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023,
1459 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1460static const struct wacom_features wacom_features_0xD4 =
1461 { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 255,
1462 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1463static const struct wacom_features wacom_features_0xD6 =
1464 { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1465 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1466static const struct wacom_features wacom_features_0xD7 =
1467 { "Wacom BambooPT 2FG Small", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1468 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1469static const struct wacom_features wacom_features_0xD8 =
1470 { "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023,
1471 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1472static const struct wacom_features wacom_features_0xDA =
1473 { "Wacom Bamboo 2FG 4x5 SE", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1474 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1475static struct wacom_features wacom_features_0xDB =
1476 { "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023,
1477 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1478static const struct wacom_features wacom_features_0x6004 =
1479 { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,
1480 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1218 1481
1219#define USB_DEVICE_WACOM(prod) \ 1482#define USB_DEVICE_WACOM(prod) \
1220 USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ 1483 USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \
1221 .driver_info = (kernel_ulong_t)&wacom_features_##prod 1484 .driver_info = (kernel_ulong_t)&wacom_features_##prod
1222 1485
1486#define USB_DEVICE_LENOVO(prod) \
1487 USB_DEVICE(USB_VENDOR_ID_LENOVO, prod), \
1488 .driver_info = (kernel_ulong_t)&wacom_features_##prod
1489
1223const struct usb_device_id wacom_ids[] = { 1490const struct usb_device_id wacom_ids[] = {
1224 { USB_DEVICE_WACOM(0x00) }, 1491 { USB_DEVICE_WACOM(0x00) },
1225 { USB_DEVICE_WACOM(0x10) }, 1492 { USB_DEVICE_WACOM(0x10) },
@@ -1279,6 +1546,16 @@ const struct usb_device_id wacom_ids[] = {
1279 { USB_DEVICE_WACOM(0xC6) }, 1546 { USB_DEVICE_WACOM(0xC6) },
1280 { USB_DEVICE_WACOM(0xC7) }, 1547 { USB_DEVICE_WACOM(0xC7) },
1281 { USB_DEVICE_WACOM(0xCE) }, 1548 { USB_DEVICE_WACOM(0xCE) },
1549 { USB_DEVICE_WACOM(0xD0) },
1550 { USB_DEVICE_WACOM(0xD1) },
1551 { USB_DEVICE_WACOM(0xD2) },
1552 { USB_DEVICE_WACOM(0xD3) },
1553 { USB_DEVICE_WACOM(0xD4) },
1554 { USB_DEVICE_WACOM(0xD6) },
1555 { USB_DEVICE_WACOM(0xD7) },
1556 { USB_DEVICE_WACOM(0xD8) },
1557 { USB_DEVICE_WACOM(0xDA) },
1558 { USB_DEVICE_WACOM(0xDB) },
1282 { USB_DEVICE_WACOM(0xF0) }, 1559 { USB_DEVICE_WACOM(0xF0) },
1283 { USB_DEVICE_WACOM(0xCC) }, 1560 { USB_DEVICE_WACOM(0xCC) },
1284 { USB_DEVICE_WACOM(0x90) }, 1561 { USB_DEVICE_WACOM(0x90) },
@@ -1287,7 +1564,9 @@ const struct usb_device_id wacom_ids[] = {
1287 { USB_DEVICE_WACOM(0x9F) }, 1564 { USB_DEVICE_WACOM(0x9F) },
1288 { USB_DEVICE_WACOM(0xE2) }, 1565 { USB_DEVICE_WACOM(0xE2) },
1289 { USB_DEVICE_WACOM(0xE3) }, 1566 { USB_DEVICE_WACOM(0xE3) },
1567 { USB_DEVICE_WACOM(0xE6) },
1290 { USB_DEVICE_WACOM(0x47) }, 1568 { USB_DEVICE_WACOM(0x47) },
1569 { USB_DEVICE_LENOVO(0x6004) },
1291 { } 1570 { }
1292}; 1571};
1293MODULE_DEVICE_TABLE(usb, wacom_ids); 1572MODULE_DEVICE_TABLE(usb, wacom_ids);