aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/usbtouchscreen.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/usbtouchscreen.c')
-rw-r--r--drivers/input/touchscreen/usbtouchscreen.c59
1 files changed, 58 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index b407028ffc59..796b837deeea 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -10,6 +10,7 @@
10 * - Gunze AHL61 10 * - Gunze AHL61
11 * - DMC TSC-10/25 11 * - DMC TSC-10/25
12 * - IRTOUCHSYSTEMS/UNITOP 12 * - IRTOUCHSYSTEMS/UNITOP
13 * - IdealTEK URTC1000
13 * 14 *
14 * Copyright (C) 2004-2006 by Daniel Ritz <daniel.ritz@gmx.ch> 15 * Copyright (C) 2004-2006 by Daniel Ritz <daniel.ritz@gmx.ch>
15 * Copyright (C) by Todd E. Johnson (mtouchusb.c) 16 * Copyright (C) by Todd E. Johnson (mtouchusb.c)
@@ -92,7 +93,7 @@ struct usbtouch_usb {
92}; 93};
93 94
94 95
95#if defined(CONFIG_TOUCHSCREEN_USB_EGALAX) || defined(CONFIG_TOUCHSCREEN_USB_ETURBO) 96#if defined(CONFIG_TOUCHSCREEN_USB_EGALAX) || defined(CONFIG_TOUCHSCREEN_USB_ETURBO) || defined(CONFIG_TOUCHSCREEN_USB_IDEALTEK)
96#define MULTI_PACKET 97#define MULTI_PACKET
97#endif 98#endif
98 99
@@ -112,6 +113,7 @@ enum {
112 DEVTYPE_GUNZE, 113 DEVTYPE_GUNZE,
113 DEVTYPE_DMC_TSC10, 114 DEVTYPE_DMC_TSC10,
114 DEVTYPE_IRTOUCH, 115 DEVTYPE_IRTOUCH,
116 DEVTYPE_IDEALTEK,
115}; 117};
116 118
117static struct usb_device_id usbtouch_devices[] = { 119static struct usb_device_id usbtouch_devices[] = {
@@ -157,6 +159,10 @@ static struct usb_device_id usbtouch_devices[] = {
157 {USB_DEVICE(0x6615, 0x0001), .driver_info = DEVTYPE_IRTOUCH}, 159 {USB_DEVICE(0x6615, 0x0001), .driver_info = DEVTYPE_IRTOUCH},
158#endif 160#endif
159 161
162#ifdef CONFIG_TOUCHSCREEN_USB_IDEALTEK
163 {USB_DEVICE(0x1391, 0x1000), .driver_info = DEVTYPE_IDEALTEK},
164#endif
165
160 {} 166 {}
161}; 167};
162 168
@@ -438,6 +444,43 @@ static int irtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
438 444
439 445
440/***************************************************************************** 446/*****************************************************************************
447 * IdealTEK URTC1000 Part
448 */
449#ifdef CONFIG_TOUCHSCREEN_USB_IDEALTEK
450static int idealtek_get_pkt_len(unsigned char *buf, int len)
451{
452 if (buf[0] & 0x80)
453 return 5;
454 if (buf[0] == 0x01)
455 return len;
456 return 0;
457}
458
459static int idealtek_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
460{
461 switch (pkt[0] & 0x98) {
462 case 0x88:
463 /* touch data in IdealTEK mode */
464 dev->x = (pkt[1] << 5) | (pkt[2] >> 2);
465 dev->y = (pkt[3] << 5) | (pkt[4] >> 2);
466 dev->touch = (pkt[0] & 0x40) ? 1 : 0;
467 return 1;
468
469 case 0x98:
470 /* touch data in MT emulation mode */
471 dev->x = (pkt[2] << 5) | (pkt[1] >> 2);
472 dev->y = (pkt[4] << 5) | (pkt[3] >> 2);
473 dev->touch = (pkt[0] & 0x40) ? 1 : 0;
474 return 1;
475
476 default:
477 return 0;
478 }
479}
480#endif
481
482
483/*****************************************************************************
441 * the different device descriptors 484 * the different device descriptors
442 */ 485 */
443static struct usbtouch_device_info usbtouch_dev_info[] = { 486static struct usbtouch_device_info usbtouch_dev_info[] = {
@@ -537,6 +580,20 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
537 .read_data = irtouch_read_data, 580 .read_data = irtouch_read_data,
538 }, 581 },
539#endif 582#endif
583
584#ifdef CONFIG_TOUCHSCREEN_USB_IDEALTEK
585 [DEVTYPE_IDEALTEK] = {
586 .min_xc = 0x0,
587 .max_xc = 0x0fff,
588 .min_yc = 0x0,
589 .max_yc = 0x0fff,
590 .rept_size = 8,
591 .flags = USBTOUCH_FLG_BUFFER,
592 .process_pkt = usbtouch_process_multi,
593 .get_pkt_len = idealtek_get_pkt_len,
594 .read_data = idealtek_read_data,
595 },
596#endif
540}; 597};
541 598
542 599