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

Input: usbtouchscreen - add support for Data Modul EasyTouch TP 72037

The Data Modul TP 72037 EasyTouch controller is derived from EGALAX
controller and is capable of detecting dual contacts. Packets can be 5
bytes or 10 bytes long, depending whether one or two contacts are
detected. Format is same as EGALAX touch controller, but with x and y
coordinates inverted.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

authored by

Armando Visconti and committed by
Dmitry Torokhov
aa87512f f0c5f65b

+72
+9
drivers/input/touchscreen/Kconfig
··· 619 619 - JASTEC USB Touch Controller/DigiTech DTR-02U 620 620 - Zytronic controllers 621 621 - Elo TouchSystems 2700 IntelliTouch 622 + - EasyTouch USB Touch Controller from Data Modul 622 623 623 624 Have a look at <http://linux.chapter7.ch/touchkit/> for 624 625 a usage description and the required user-space stuff. ··· 723 722 default y 724 723 bool "NEXIO/iNexio device support" if EXPERT 725 724 depends on TOUCHSCREEN_USB_COMPOSITE 725 + 726 + config TOUCHSCREEN_USB_EASYTOUCH 727 + default y 728 + bool "EasyTouch USB Touch controller device support" if EMBEDDED 729 + depends on TOUCHSCREEN_USB_COMPOSITE 730 + help 731 + Say Y here if you have a EasyTouch USB Touch controller device support. 732 + If unsure, say N. 726 733 727 734 config TOUCHSCREEN_TOUCHIT213 728 735 tristate "Sahara TouchIT-213 touchscreen"
+63
drivers/input/touchscreen/usbtouchscreen.c
··· 17 17 * - Zytronic capacitive touchscreen 18 18 * - NEXIO/iNexio 19 19 * - Elo TouchSystems 2700 IntelliTouch 20 + * - EasyTouch USB Dual/Multi touch controller from Data Modul 20 21 * 21 22 * Copyright (C) 2004-2007 by Daniel Ritz <daniel.ritz@gmx.ch> 22 23 * Copyright (C) by Todd E. Johnson (mtouchusb.c) ··· 141 140 DEVTYPE_TC45USB, 142 141 DEVTYPE_NEXIO, 143 142 DEVTYPE_ELO, 143 + DEVTYPE_ETOUCH, 144 144 }; 145 145 146 146 #define USB_DEVICE_HID_CLASS(vend, prod) \ ··· 247 245 {USB_DEVICE(0x04e7, 0x0020), .driver_info = DEVTYPE_ELO}, 248 246 #endif 249 247 248 + #ifdef CONFIG_TOUCHSCREEN_USB_EASYTOUCH 249 + {USB_DEVICE(0x7374, 0x0001), .driver_info = DEVTYPE_ETOUCH}, 250 + #endif 251 + 250 252 {} 251 253 }; 252 254 ··· 332 326 } 333 327 #endif 334 328 329 + /***************************************************************************** 330 + * EasyTouch part 331 + */ 332 + 333 + #ifdef CONFIG_TOUCHSCREEN_USB_EASYTOUCH 334 + 335 + #ifndef MULTI_PACKET 336 + #define MULTI_PACKET 337 + #endif 338 + 339 + #define ETOUCH_PKT_TYPE_MASK 0xFE 340 + #define ETOUCH_PKT_TYPE_REPT 0x80 341 + #define ETOUCH_PKT_TYPE_REPT2 0xB0 342 + #define ETOUCH_PKT_TYPE_DIAG 0x0A 343 + 344 + static int etouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) 345 + { 346 + if ((pkt[0] & ETOUCH_PKT_TYPE_MASK) != ETOUCH_PKT_TYPE_REPT && 347 + (pkt[0] & ETOUCH_PKT_TYPE_MASK) != ETOUCH_PKT_TYPE_REPT2) 348 + return 0; 349 + 350 + dev->x = ((pkt[1] & 0x1F) << 7) | (pkt[2] & 0x7F); 351 + dev->y = ((pkt[3] & 0x1F) << 7) | (pkt[4] & 0x7F); 352 + dev->touch = pkt[0] & 0x01; 353 + 354 + return 1; 355 + } 356 + 357 + static int etouch_get_pkt_len(unsigned char *buf, int len) 358 + { 359 + switch (buf[0] & ETOUCH_PKT_TYPE_MASK) { 360 + case ETOUCH_PKT_TYPE_REPT: 361 + case ETOUCH_PKT_TYPE_REPT2: 362 + return 5; 363 + 364 + case ETOUCH_PKT_TYPE_DIAG: 365 + if (len < 2) 366 + return -1; 367 + 368 + return buf[1] + 2; 369 + } 370 + 371 + return 0; 372 + } 373 + #endif 335 374 336 375 /***************************************************************************** 337 376 * PanJit Part ··· 1224 1173 .alloc = nexio_alloc, 1225 1174 .init = nexio_init, 1226 1175 .exit = nexio_exit, 1176 + }, 1177 + #endif 1178 + #ifdef CONFIG_TOUCHSCREEN_USB_EASYTOUCH 1179 + [DEVTYPE_ETOUCH] = { 1180 + .min_xc = 0x0, 1181 + .max_xc = 0x07ff, 1182 + .min_yc = 0x0, 1183 + .max_yc = 0x07ff, 1184 + .rept_size = 16, 1185 + .process_pkt = usbtouch_process_multi, 1186 + .get_pkt_len = etouch_get_pkt_len, 1187 + .read_data = etouch_read_data, 1227 1188 }, 1228 1189 #endif 1229 1190 };