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 ISDv4 sensors

This patch adds support for the 0x4004, 0x5000, and 0x5002 sensors found
on what should be the Motion R12, Fujitsu Q704, and Fujitsu T904. These
tablets use a new report ID (3) for their touch packets and a slightly
different HID descriptor format, but are otherwise largely identical in
protocol to the "MTTPC" tablets.

Note:
* The R12 uses its 0x4004 sensor for touch input only. A pen interface
is not present in its HID descriptor, though its possible a 0x4004
may be used for pen input by other tablet PCs in the future.

* The 0x5002 sensor appears to use a new report ID (8) for its pen
packets. The other sensors continue to use the traditional report
ID (2).

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

authored by

Jason Gerecke and committed by
Dmitry Torokhov
d51ddb2b edc8e20a

+41 -1
+19
drivers/input/tablet/wacom_sys.c
··· 349 349 break; 350 350 351 351 case MTTPC: 352 + case MTTPC_B: 352 353 features->pktlen = WACOM_PKGLEN_MTTPC; 353 354 break; 354 355 ··· 379 378 features->unit = report[i - 1]; 380 379 features->unitExpo = report[i - 3]; 381 380 i += 12; 381 + break; 382 + 383 + case MTTPC_B: 384 + features->x_max = 385 + get_unaligned_le16(&report[i + 3]); 386 + features->x_phy = 387 + get_unaligned_le16(&report[i + 6]); 388 + features->unit = report[i - 5]; 389 + features->unitExpo = report[i - 3]; 390 + i += 9; 382 391 break; 383 392 384 393 default: ··· 439 428 features->y_max = 440 429 get_unaligned_le16(&report[i + 6]); 441 430 i += 12; 431 + break; 432 + 433 + case MTTPC_B: 434 + features->y_max = 435 + get_unaligned_le16(&report[i + 3]); 436 + features->y_phy = 437 + get_unaligned_le16(&report[i + 6]); 438 + i += 9; 442 439 break; 443 440 444 441 default:
+19 -1
drivers/input/tablet/wacom_wac.c
··· 962 962 int x_offset = 0; 963 963 964 964 /* MTTPC does not support Height and Width */ 965 - if (wacom->features.type == MTTPC) 965 + if (wacom->features.type == MTTPC || wacom->features.type == MTTPC_B) 966 966 x_offset = -4; 967 967 968 968 /* ··· 1114 1114 case WACOM_PKGLEN_TPC2FG: 1115 1115 return wacom_tpc_mt_touch(wacom); 1116 1116 1117 + case WACOM_PKGLEN_PENABLED: 1118 + return wacom_tpc_pen(wacom); 1119 + 1117 1120 default: 1118 1121 switch (data[0]) { 1119 1122 case WACOM_REPORT_TPC1FG: ··· 1126 1123 return wacom_tpc_single_touch(wacom, len); 1127 1124 1128 1125 case WACOM_REPORT_TPCMT: 1126 + case WACOM_REPORT_TPCMT2: 1129 1127 return wacom_mt_touch(wacom); 1130 1128 1131 1129 case WACOM_REPORT_PENABLED: ··· 1469 1465 case TABLETPC2FG: 1470 1466 case MTSCREEN: 1471 1467 case MTTPC: 1468 + case MTTPC_B: 1472 1469 sync = wacom_tpc_irq(wacom_wac, len); 1473 1470 break; 1474 1471 ··· 1811 1806 1812 1807 case MTSCREEN: 1813 1808 case MTTPC: 1809 + case MTTPC_B: 1814 1810 case TABLETPC2FG: 1815 1811 if (features->device_type == BTN_TOOL_FINGER) { 1816 1812 unsigned int flags = INPUT_MT_DIRECT; ··· 2249 2243 static const struct wacom_features wacom_features_0x4001 = 2250 2244 { "Wacom ISDv4 4001", WACOM_PKGLEN_MTTPC, 26202, 16325, 255, 2251 2245 0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2246 + static const struct wacom_features wacom_features_0x4004 = 2247 + { "Wacom ISDv4 4004", WACOM_PKGLEN_MTTPC, 11060, 6220, 255, 2248 + 0, MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2249 + static const struct wacom_features wacom_features_0x5000 = 2250 + { "Wacom ISDv4 5000", WACOM_PKGLEN_MTTPC, 27848, 15752, 1023, 2251 + 0, MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2252 + static const struct wacom_features wacom_features_0x5002 = 2253 + { "Wacom ISDv4 5002", WACOM_PKGLEN_MTTPC, 29576, 16724, 1023, 2254 + 0, MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2252 2255 static const struct wacom_features wacom_features_0x47 = 2253 2256 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 2254 2257 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; ··· 2480 2465 { USB_DEVICE_DETAILED(0x315, USB_CLASS_HID, 0, 0) }, 2481 2466 { USB_DEVICE_DETAILED(0x317, USB_CLASS_HID, 0, 0) }, 2482 2467 { USB_DEVICE_WACOM(0x4001) }, 2468 + { USB_DEVICE_WACOM(0x4004) }, 2469 + { USB_DEVICE_WACOM(0x5000) }, 2470 + { USB_DEVICE_WACOM(0x5002) }, 2483 2471 { USB_DEVICE_WACOM(0x47) }, 2484 2472 { USB_DEVICE_WACOM(0xF4) }, 2485 2473 { USB_DEVICE_WACOM(0xF8) },
+3
drivers/input/tablet/wacom_wac.h
··· 31 31 #define WACOM_PKGLEN_MTOUCH 62 32 32 #define WACOM_PKGLEN_MTTPC 40 33 33 #define WACOM_PKGLEN_DTUS 68 34 + #define WACOM_PKGLEN_PENABLED 8 34 35 35 36 /* wacom data size per MT contact */ 36 37 #define WACOM_BYTES_PER_MT_PACKET 11 ··· 54 53 #define WACOM_REPORT_TPC1FG 6 55 54 #define WACOM_REPORT_TPC2FG 13 56 55 #define WACOM_REPORT_TPCMT 13 56 + #define WACOM_REPORT_TPCMT2 3 57 57 #define WACOM_REPORT_TPCHID 15 58 58 #define WACOM_REPORT_TPCST 16 59 59 #define WACOM_REPORT_DTUS 17 ··· 108 106 TABLETPC2FG, 109 107 MTSCREEN, 110 108 MTTPC, 109 + MTTPC_B, 111 110 MAX_TYPE 112 111 }; 113 112