aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/usbtouchscreen.c
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/touchscreen/usbtouchscreen.c
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/touchscreen/usbtouchscreen.c')
-rw-r--r--drivers/input/touchscreen/usbtouchscreen.c49
1 files changed, 49 insertions, 0 deletions
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