Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: wacom - add support for three new Intuos devices

Two tablets in this series support both pen and touch. One (Intuos S)
only supports pen. This patch also updates the driver to process wireless
devices that do not support touch interface.

Tested-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Ping Cheng and committed by
Dmitry Torokhov
b5fd2a3e 1d0d6df0

+51 -18
+3 -3
drivers/input/tablet/wacom_sys.c
··· 1198 1198 goto fail; 1199 1199 1200 1200 /* Touch interface */ 1201 - if (wacom_wac1->features.touch_max) { 1201 + if (wacom_wac1->features.touch_max || 1202 + wacom_wac1->features.type == INTUOSHT) { 1202 1203 wacom_wac2->features = 1203 1204 *((struct wacom_features *)id->driver_info); 1204 1205 wacom_wac2->features.pktlen = WACOM_PKGLEN_BBTOUCH3; ··· 1322 1321 * HID descriptor. If this is the touch interface (wMaxPacketSize 1323 1322 * of WACOM_PKGLEN_BBTOUCH3), override the table values. 1324 1323 */ 1325 - if (features->type >= INTUOS5S && features->type <= INTUOSPL) { 1324 + if (features->type >= INTUOS5S && features->type <= INTUOSHT) { 1326 1325 if (endpoint->wMaxPacketSize == WACOM_PKGLEN_BBTOUCH3) { 1327 1326 features->device_type = BTN_TOOL_FINGER; 1328 1327 features->pktlen = WACOM_PKGLEN_BBTOUCH3; ··· 1392 1391 goto fail5; 1393 1392 } 1394 1393 } 1395 - 1396 1394 return 0; 1397 1395 1398 1396 fail5: wacom_destroy_leds(wacom);
+46 -15
drivers/input/tablet/wacom_wac.c
··· 1176 1176 static void wacom_bpt3_button_msg(struct wacom_wac *wacom, unsigned char *data) 1177 1177 { 1178 1178 struct input_dev *input = wacom->input; 1179 + struct wacom_features *features = &wacom->features; 1179 1180 1180 - input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0); 1181 + if (features->type == INTUOSHT) { 1182 + input_report_key(input, BTN_LEFT, (data[1] & 0x02) != 0); 1183 + input_report_key(input, BTN_BACK, (data[1] & 0x08) != 0); 1184 + } else { 1185 + input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0); 1186 + input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0); 1187 + } 1181 1188 input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0); 1182 - input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0); 1183 1189 input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0); 1184 1190 } 1185 1191 ··· 1223 1217 unsigned char *data = wacom->data; 1224 1218 int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0; 1225 1219 1226 - if (data[0] != 0x02) 1220 + if (data[0] != WACOM_REPORT_PENABLED) 1227 1221 return 0; 1228 1222 1229 1223 prox = (data[1] & 0x20) == 0x20; ··· 1303 1297 unsigned char *data = wacom->data; 1304 1298 int connected; 1305 1299 1306 - if (len != WACOM_PKGLEN_WIRELESS || data[0] != 0x80) 1300 + if (len != WACOM_PKGLEN_WIRELESS || data[0] != WACOM_REPORT_WL) 1307 1301 return 0; 1308 1302 1309 1303 connected = data[1] & 0x01; ··· 1397 1391 break; 1398 1392 1399 1393 case BAMBOO_PT: 1394 + case INTUOSHT: 1400 1395 sync = wacom_bpt_irq(wacom_wac, len); 1401 1396 break; 1402 1397 ··· 1466 1459 1467 1460 /* these device have multiple inputs */ 1468 1461 if (features->type >= WIRELESS || 1469 - (features->type >= INTUOS5S && features->type <= INTUOSPL) || 1462 + (features->type >= INTUOS5S && features->type <= INTUOSHT) || 1470 1463 (features->oVid && features->oPid)) 1471 1464 features->quirks |= WACOM_QUIRK_MULTI_INPUT; 1472 1465 ··· 1778 1771 __set_bit(INPUT_PROP_POINTER, input_dev->propbit); 1779 1772 break; 1780 1773 1774 + case INTUOSHT: 1781 1775 case BAMBOO_PT: 1782 1776 __clear_bit(ABS_MISC, input_dev->absbit); 1783 1777 1784 - __set_bit(INPUT_PROP_POINTER, input_dev->propbit); 1785 - 1786 1778 if (features->device_type == BTN_TOOL_FINGER) { 1787 - unsigned int flags = INPUT_MT_POINTER; 1788 1779 1789 1780 __set_bit(BTN_LEFT, input_dev->keybit); 1790 1781 __set_bit(BTN_FORWARD, input_dev->keybit); 1791 1782 __set_bit(BTN_BACK, input_dev->keybit); 1792 1783 __set_bit(BTN_RIGHT, input_dev->keybit); 1793 1784 1794 - if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) { 1795 - input_set_abs_params(input_dev, 1785 + if (features->touch_max) { 1786 + /* touch interface */ 1787 + unsigned int flags = INPUT_MT_POINTER; 1788 + 1789 + __set_bit(INPUT_PROP_POINTER, input_dev->propbit); 1790 + if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) { 1791 + input_set_abs_params(input_dev, 1796 1792 ABS_MT_TOUCH_MAJOR, 1797 1793 0, features->x_max, 0, 0); 1798 - input_set_abs_params(input_dev, 1794 + input_set_abs_params(input_dev, 1799 1795 ABS_MT_TOUCH_MINOR, 1800 1796 0, features->y_max, 0, 0); 1797 + } else { 1798 + __set_bit(BTN_TOOL_FINGER, input_dev->keybit); 1799 + __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); 1800 + flags = 0; 1801 + } 1802 + input_mt_init_slots(input_dev, features->touch_max, flags); 1801 1803 } else { 1802 - __set_bit(BTN_TOOL_FINGER, input_dev->keybit); 1803 - __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); 1804 - flags = 0; 1804 + /* buttons/keys only interface */ 1805 + __clear_bit(ABS_X, input_dev->absbit); 1806 + __clear_bit(ABS_Y, input_dev->absbit); 1807 + __clear_bit(BTN_TOUCH, input_dev->keybit); 1805 1808 } 1806 - input_mt_init_slots(input_dev, features->touch_max, flags); 1807 1809 } else if (features->device_type == BTN_TOOL_PEN) { 1810 + __set_bit(INPUT_PROP_POINTER, input_dev->propbit); 1808 1811 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); 1809 1812 __set_bit(BTN_TOOL_PEN, input_dev->keybit); 1810 1813 __set_bit(BTN_STYLUS, input_dev->keybit); ··· 2211 2194 static const struct wacom_features wacom_features_0x301 = 2212 2195 { "Wacom Bamboo One M", WACOM_PKGLEN_BBPEN, 21648, 13530, 1023, 2213 2196 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2197 + static const struct wacom_features wacom_features_0x302 = 2198 + { "Wacom Intuos PT S", WACOM_PKGLEN_BBPEN, 15200, 9500, 1023, 2199 + 31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 2200 + .touch_max = 16 }; 2201 + static const struct wacom_features wacom_features_0x303 = 2202 + { "Wacom Intuos PT M", WACOM_PKGLEN_BBPEN, 21600, 13500, 1023, 2203 + 31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 2204 + .touch_max = 16 }; 2205 + static const struct wacom_features wacom_features_0x30E = 2206 + { "Wacom Intuos S", WACOM_PKGLEN_BBPEN, 15200, 9500, 1023, 2207 + 31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2214 2208 static const struct wacom_features wacom_features_0x6004 = 2215 2209 { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255, 2216 2210 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; ··· 2357 2329 { USB_DEVICE_WACOM(0x10D) }, 2358 2330 { USB_DEVICE_WACOM(0x300) }, 2359 2331 { USB_DEVICE_WACOM(0x301) }, 2332 + { USB_DEVICE_DETAILED(0x302, USB_CLASS_HID, 0, 0) }, 2333 + { USB_DEVICE_DETAILED(0x303, USB_CLASS_HID, 0, 0) }, 2334 + { USB_DEVICE_DETAILED(0x30E, USB_CLASS_HID, 0, 0) }, 2360 2335 { USB_DEVICE_WACOM(0x304) }, 2361 2336 { USB_DEVICE_DETAILED(0x314, USB_CLASS_HID, 0, 0) }, 2362 2337 { USB_DEVICE_DETAILED(0x315, USB_CLASS_HID, 0, 0) },
+2
drivers/input/tablet/wacom_wac.h
··· 54 54 #define WACOM_REPORT_TPCST 16 55 55 #define WACOM_REPORT_TPC1FGE 18 56 56 #define WACOM_REPORT_24HDT 1 57 + #define WACOM_REPORT_WL 128 57 58 58 59 /* device quirks */ 59 60 #define WACOM_QUIRK_MULTI_INPUT 0x0001 ··· 82 81 INTUOSPS, 83 82 INTUOSPM, 84 83 INTUOSPL, 84 + INTUOSHT, 85 85 WACOM_21UX2, 86 86 WACOM_22HD, 87 87 DTK,