aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet
diff options
context:
space:
mode:
authorPing Cheng <pinglinux@gmail.com>2012-11-03 15:16:15 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-11-08 12:12:46 -0500
commit6afdc289c984451a6202a687fe6af727e051a784 (patch)
treeacd038cdd5cfe752c446315bd0215e9ba65461da /drivers/input/tablet
parent3699dd7e16a9f68586a44e1efeb9708359f9c2a6 (diff)
Input: wacom - add support for 2 new multi-touch tablets (0x100 and 0x101)
This adds support for the two new multi-touch tablets. Signed-off-by: Ping Cheng <pinglinux@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r--drivers/input/tablet/wacom_sys.c5
-rw-r--r--drivers/input/tablet/wacom_wac.c21
-rw-r--r--drivers/input/tablet/wacom_wac.h2
3 files changed, 25 insertions, 3 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 67442f409174..f92d34f45a1c 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -397,6 +397,10 @@ static int wacom_parse_hid(struct usb_interface *intf,
397 features->pktlen = WACOM_PKGLEN_MTOUCH; 397 features->pktlen = WACOM_PKGLEN_MTOUCH;
398 break; 398 break;
399 399
400 case MTTPC:
401 features->pktlen = WACOM_PKGLEN_MTTPC;
402 break;
403
400 case BAMBOO_PT: 404 case BAMBOO_PT:
401 features->pktlen = WACOM_PKGLEN_BBTOUCH; 405 features->pktlen = WACOM_PKGLEN_BBTOUCH;
402 break; 406 break;
@@ -453,6 +457,7 @@ static int wacom_parse_hid(struct usb_interface *intf,
453 switch (features->type) { 457 switch (features->type) {
454 case TABLETPC2FG: 458 case TABLETPC2FG:
455 case MTSCREEN: 459 case MTSCREEN:
460 case MTTPC:
456 features->y_max = 461 features->y_max =
457 get_unaligned_le16(&report[i + 3]); 462 get_unaligned_le16(&report[i + 3]);
458 features->y_phy = 463 features->y_phy =
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 0a67031ffc13..7554a043ee46 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -877,6 +877,11 @@ static int wacom_mt_touch(struct wacom_wac *wacom)
877 int i; 877 int i;
878 int current_num_contacts = data[2]; 878 int current_num_contacts = data[2];
879 int contacts_to_send = 0; 879 int contacts_to_send = 0;
880 int x_offset = 0;
881
882 /* MTTPC does not support Height and Width */
883 if (wacom->features.type == MTTPC)
884 x_offset = -4;
880 885
881 /* 886 /*
882 * First packet resets the counter since only the first 887 * First packet resets the counter since only the first
@@ -889,7 +894,7 @@ static int wacom_mt_touch(struct wacom_wac *wacom)
889 contacts_to_send = min(5, wacom->num_contacts_left); 894 contacts_to_send = min(5, wacom->num_contacts_left);
890 895
891 for (i = 0; i < contacts_to_send; i++) { 896 for (i = 0; i < contacts_to_send; i++) {
892 int offset = (WACOM_BYTES_PER_MT_PACKET * i) + 3; 897 int offset = (WACOM_BYTES_PER_MT_PACKET + x_offset) * i + 3;
893 bool touch = data[offset] & 0x1; 898 bool touch = data[offset] & 0x1;
894 int id = le16_to_cpup((__le16 *)&data[offset + 1]); 899 int id = le16_to_cpup((__le16 *)&data[offset + 1]);
895 int slot = find_slot_from_contactid(wacom, id); 900 int slot = find_slot_from_contactid(wacom, id);
@@ -900,8 +905,8 @@ static int wacom_mt_touch(struct wacom_wac *wacom)
900 input_mt_slot(input, slot); 905 input_mt_slot(input, slot);
901 input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); 906 input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
902 if (touch) { 907 if (touch) {
903 int x = le16_to_cpup((__le16 *)&data[offset + 7]); 908 int x = le16_to_cpup((__le16 *)&data[offset + x_offset + 7]);
904 int y = le16_to_cpup((__le16 *)&data[offset + 9]); 909 int y = le16_to_cpup((__le16 *)&data[offset + x_offset + 9]);
905 input_report_abs(input, ABS_MT_POSITION_X, x); 910 input_report_abs(input, ABS_MT_POSITION_X, x);
906 input_report_abs(input, ABS_MT_POSITION_Y, y); 911 input_report_abs(input, ABS_MT_POSITION_Y, y);
907 } 912 }
@@ -1336,6 +1341,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
1336 case TABLETPCE: 1341 case TABLETPCE:
1337 case TABLETPC2FG: 1342 case TABLETPC2FG:
1338 case MTSCREEN: 1343 case MTSCREEN:
1344 case MTTPC:
1339 sync = wacom_tpc_irq(wacom_wac, len); 1345 sync = wacom_tpc_irq(wacom_wac, len);
1340 break; 1346 break;
1341 1347
@@ -1657,6 +1663,7 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
1657 /* fall through */ 1663 /* fall through */
1658 1664
1659 case MTSCREEN: 1665 case MTSCREEN:
1666 case MTTPC:
1660 if (features->device_type == BTN_TOOL_FINGER) { 1667 if (features->device_type == BTN_TOOL_FINGER) {
1661 wacom_wac->slots = kmalloc(features->touch_max * 1668 wacom_wac->slots = kmalloc(features->touch_max *
1662 sizeof(int), 1669 sizeof(int),
@@ -2018,6 +2025,12 @@ static const struct wacom_features wacom_features_0xED =
2018static const struct wacom_features wacom_features_0xEF = 2025static const struct wacom_features wacom_features_0xEF =
2019 { "Wacom ISDv4 EF", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 2026 { "Wacom ISDv4 EF", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
2020 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2027 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
2028static const struct wacom_features wacom_features_0x100 =
2029 { "Wacom ISDv4 100", WACOM_PKGLEN_MTTPC, 26202, 16325, 255,
2030 0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
2031static const struct wacom_features wacom_features_0x101 =
2032 { "Wacom ISDv4 101", WACOM_PKGLEN_MTTPC, 26202, 16325, 255,
2033 0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
2021static const struct wacom_features wacom_features_0x47 = 2034static const struct wacom_features wacom_features_0x47 =
2022 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 2035 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023,
2023 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2036 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -2194,6 +2207,8 @@ const struct usb_device_id wacom_ids[] = {
2194 { USB_DEVICE_WACOM(0xEC) }, 2207 { USB_DEVICE_WACOM(0xEC) },
2195 { USB_DEVICE_WACOM(0xED) }, 2208 { USB_DEVICE_WACOM(0xED) },
2196 { USB_DEVICE_WACOM(0xEF) }, 2209 { USB_DEVICE_WACOM(0xEF) },
2210 { USB_DEVICE_WACOM(0x100) },
2211 { USB_DEVICE_WACOM(0x101) },
2197 { USB_DEVICE_WACOM(0x47) }, 2212 { USB_DEVICE_WACOM(0x47) },
2198 { USB_DEVICE_WACOM(0xF4) }, 2213 { USB_DEVICE_WACOM(0xF4) },
2199 { USB_DEVICE_WACOM(0xF8) }, 2214 { USB_DEVICE_WACOM(0xF8) },
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index 345f1e76975e..9396d7769f86 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -26,6 +26,7 @@
26#define WACOM_PKGLEN_BBPEN 10 26#define WACOM_PKGLEN_BBPEN 10
27#define WACOM_PKGLEN_WIRELESS 32 27#define WACOM_PKGLEN_WIRELESS 32
28#define WACOM_PKGLEN_MTOUCH 62 28#define WACOM_PKGLEN_MTOUCH 62
29#define WACOM_PKGLEN_MTTPC 40
29 30
30/* wacom data size per MT contact */ 31/* wacom data size per MT contact */
31#define WACOM_BYTES_PER_MT_PACKET 11 32#define WACOM_BYTES_PER_MT_PACKET 11
@@ -88,6 +89,7 @@ enum {
88 TABLETPCE, 89 TABLETPCE,
89 TABLETPC2FG, 90 TABLETPC2FG,
90 MTSCREEN, 91 MTSCREEN,
92 MTTPC,
91 MAX_TYPE 93 MAX_TYPE
92}; 94};
93 95