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.c81
1 files changed, 81 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index fb7cb9bdfbd5..68ece5801a58 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -13,6 +13,7 @@
13 * - IdealTEK URTC1000 13 * - IdealTEK URTC1000
14 * - General Touch 14 * - General Touch
15 * - GoTop Super_Q2/GogoPen/PenPower tablets 15 * - GoTop Super_Q2/GogoPen/PenPower tablets
16 * - JASTEC USB touch controller/DigiTech DTR-02U
16 * 17 *
17 * Copyright (C) 2004-2007 by Daniel Ritz <daniel.ritz@gmx.ch> 18 * Copyright (C) 2004-2007 by Daniel Ritz <daniel.ritz@gmx.ch>
18 * Copyright (C) by Todd E. Johnson (mtouchusb.c) 19 * Copyright (C) by Todd E. Johnson (mtouchusb.c)
@@ -118,6 +119,8 @@ enum {
118 DEVTYPE_IDEALTEK, 119 DEVTYPE_IDEALTEK,
119 DEVTYPE_GENERAL_TOUCH, 120 DEVTYPE_GENERAL_TOUCH,
120 DEVTYPE_GOTOP, 121 DEVTYPE_GOTOP,
122 DEVTYPE_JASTEC,
123 DEVTYPE_E2I,
121}; 124};
122 125
123#define USB_DEVICE_HID_CLASS(vend, prod) \ 126#define USB_DEVICE_HID_CLASS(vend, prod) \
@@ -191,11 +194,51 @@ static struct usb_device_id usbtouch_devices[] = {
191 {USB_DEVICE(0x08f2, 0x00f4), .driver_info = DEVTYPE_GOTOP}, 194 {USB_DEVICE(0x08f2, 0x00f4), .driver_info = DEVTYPE_GOTOP},
192#endif 195#endif
193 196
197#ifdef CONFIG_TOUCHSCREEN_USB_JASTEC
198 {USB_DEVICE(0x0f92, 0x0001), .driver_info = DEVTYPE_JASTEC},
199#endif
200
201#ifdef CONFIG_TOUCHSCREEN_USB_E2I
202 {USB_DEVICE(0x1ac7, 0x0001), .driver_info = DEVTYPE_E2I},
203#endif
194 {} 204 {}
195}; 205};
196 206
197 207
198/***************************************************************************** 208/*****************************************************************************
209 * e2i Part
210 */
211
212#ifdef CONFIG_TOUCHSCREEN_USB_E2I
213static int e2i_init(struct usbtouch_usb *usbtouch)
214{
215 int ret;
216
217 ret = usb_control_msg(usbtouch->udev, usb_rcvctrlpipe(usbtouch->udev, 0),
218 0x01, 0x02, 0x0000, 0x0081,
219 NULL, 0, USB_CTRL_SET_TIMEOUT);
220
221 dbg("%s - usb_control_msg - E2I_RESET - bytes|err: %d",
222 __func__, ret);
223 return ret;
224}
225
226static int e2i_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
227{
228 int tmp = (pkt[0] << 8) | pkt[1];
229 dev->x = (pkt[2] << 8) | pkt[3];
230 dev->y = (pkt[4] << 8) | pkt[5];
231
232 tmp = tmp - 0xA000;
233 dev->touch = (tmp > 0);
234 dev->press = (tmp > 0 ? tmp : 0);
235
236 return 1;
237}
238#endif
239
240
241/*****************************************************************************
199 * eGalax part 242 * eGalax part
200 */ 243 */
201 244
@@ -559,6 +602,21 @@ static int gotop_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
559 dev->x = ((pkt[1] & 0x38) << 4) | pkt[2]; 602 dev->x = ((pkt[1] & 0x38) << 4) | pkt[2];
560 dev->y = ((pkt[1] & 0x07) << 7) | pkt[3]; 603 dev->y = ((pkt[1] & 0x07) << 7) | pkt[3];
561 dev->touch = pkt[0] & 0x01; 604 dev->touch = pkt[0] & 0x01;
605
606 return 1;
607}
608#endif
609
610/*****************************************************************************
611 * JASTEC Part
612 */
613#ifdef CONFIG_TOUCHSCREEN_USB_JASTEC
614static int jastec_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
615{
616 dev->x = ((pkt[0] & 0x3f) << 6) | (pkt[2] & 0x3f);
617 dev->y = ((pkt[1] & 0x3f) << 6) | (pkt[3] & 0x3f);
618 dev->touch = (pkt[0] & 0x40) >> 6;
619
562 return 1; 620 return 1;
563} 621}
564#endif 622#endif
@@ -702,6 +760,29 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
702 .read_data = gotop_read_data, 760 .read_data = gotop_read_data,
703 }, 761 },
704#endif 762#endif
763
764#ifdef CONFIG_TOUCHSCREEN_USB_JASTEC
765 [DEVTYPE_JASTEC] = {
766 .min_xc = 0x0,
767 .max_xc = 0x0fff,
768 .min_yc = 0x0,
769 .max_yc = 0x0fff,
770 .rept_size = 4,
771 .read_data = jastec_read_data,
772 },
773#endif
774
775#ifdef CONFIG_TOUCHSCREEN_USB_E2I
776 [DEVTYPE_E2I] = {
777 .min_xc = 0x0,
778 .max_xc = 0x7fff,
779 .min_yc = 0x0,
780 .max_yc = 0x7fff,
781 .rept_size = 6,
782 .init = e2i_init,
783 .read_data = e2i_read_data,
784 },
785#endif
705}; 786};
706 787
707 788