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.c21
1 files changed, 18 insertions, 3 deletions
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) },