aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorFlorian Echtler <floe@butterbrot.org>2009-07-27 20:35:39 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-07-28 00:16:44 -0400
commit9e3b25837a20f4d48fef57b0cb8bf750a8cfa8e2 (patch)
tree522a0e96256a15cc40ccb2d37498bb7c34084bf2 /drivers/input
parent703490ff7eaff03e412683da3d8367b5190a71ca (diff)
Input: usbtouchscreen - add support for e2i touchscreen controller
This patch adds support for the e2i touchscreen controller used in the Mimo 740 (and probably in other e2i touchscreen products). Tested on Mimo 740. Signed-off-by: Florian Echtler <floe@butterbrot.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/Kconfig5
-rw-r--r--drivers/input/touchscreen/usbtouchscreen.c49
2 files changed, 54 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 07703bcb64c2..87a1ae63bcc4 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -474,6 +474,11 @@ config TOUCHSCREEN_USB_JASTEC
474 bool "JASTEC/DigiTech DTR-02U USB touch controller device support" if EMBEDDED 474 bool "JASTEC/DigiTech DTR-02U USB touch controller device support" if EMBEDDED
475 depends on TOUCHSCREEN_USB_COMPOSITE 475 depends on TOUCHSCREEN_USB_COMPOSITE
476 476
477config TOUCHSCREEN_USB_E2I
478 default y
479 bool "e2i Touchscreen controller (e.g. from Mimo 740)"
480 depends on TOUCHSCREEN_USB_COMPOSITE
481
477config TOUCHSCREEN_TOUCHIT213 482config TOUCHSCREEN_TOUCHIT213
478 tristate "Sahara TouchIT-213 touchscreen" 483 tristate "Sahara TouchIT-213 touchscreen"
479 select SERIO 484 select SERIO
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index c07be07a69bb..68ece5801a58 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -120,6 +120,7 @@ enum {
120 DEVTYPE_GENERAL_TOUCH, 120 DEVTYPE_GENERAL_TOUCH,
121 DEVTYPE_GOTOP, 121 DEVTYPE_GOTOP,
122 DEVTYPE_JASTEC, 122 DEVTYPE_JASTEC,
123 DEVTYPE_E2I,
123}; 124};
124 125
125#define USB_DEVICE_HID_CLASS(vend, prod) \ 126#define USB_DEVICE_HID_CLASS(vend, prod) \
@@ -197,11 +198,47 @@ static struct usb_device_id usbtouch_devices[] = {
197 {USB_DEVICE(0x0f92, 0x0001), .driver_info = DEVTYPE_JASTEC}, 198 {USB_DEVICE(0x0f92, 0x0001), .driver_info = DEVTYPE_JASTEC},
198#endif 199#endif
199 200
201#ifdef CONFIG_TOUCHSCREEN_USB_E2I
202 {USB_DEVICE(0x1ac7, 0x0001), .driver_info = DEVTYPE_E2I},
203#endif
200 {} 204 {}
201}; 205};
202 206
203 207
204/***************************************************************************** 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/*****************************************************************************
205 * eGalax part 242 * eGalax part
206 */ 243 */
207 244
@@ -734,6 +771,18 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
734 .read_data = jastec_read_data, 771 .read_data = jastec_read_data,
735 }, 772 },
736#endif 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
737}; 786};
738 787
739 788