aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/usbtouchscreen.c
diff options
context:
space:
mode:
authorIlya Frolov <zeylie@gmail.com>2007-10-12 14:19:40 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2007-10-12 14:19:40 -0400
commit9d5657db8c4a485b56b5c9174b52bab39b2fd16e (patch)
tree86cff19159a22c8a16c821eb43b2fcec9a3bf250 /drivers/input/touchscreen/usbtouchscreen.c
parent064450140f1eab959bd0eca0245f449993216074 (diff)
Input: usbtouchscreen - add support for GeneralTouch devices
Signed-off-by: Ilya Frolov <zeylie@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/touchscreen/usbtouchscreen.c')
-rw-r--r--drivers/input/touchscreen/usbtouchscreen.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 13fbda0895b5..9b3a26cd1a8d 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -114,6 +114,7 @@ enum {
114 DEVTYPE_DMC_TSC10, 114 DEVTYPE_DMC_TSC10,
115 DEVTYPE_IRTOUCH, 115 DEVTYPE_IRTOUCH,
116 DEVTYPE_IDEALTEK, 116 DEVTYPE_IDEALTEK,
117 DEVTYPE_GENERAL_TOUCH,
117}; 118};
118 119
119static struct usb_device_id usbtouch_devices[] = { 120static struct usb_device_id usbtouch_devices[] = {
@@ -163,6 +164,10 @@ static struct usb_device_id usbtouch_devices[] = {
163 {USB_DEVICE(0x1391, 0x1000), .driver_info = DEVTYPE_IDEALTEK}, 164 {USB_DEVICE(0x1391, 0x1000), .driver_info = DEVTYPE_IDEALTEK},
164#endif 165#endif
165 166
167#ifdef CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH
168 {USB_DEVICE(0x0dfc, 0x0001), .driver_info = DEVTYPE_GENERAL_TOUCH},
169#endif
170
166 {} 171 {}
167}; 172};
168 173
@@ -480,6 +485,20 @@ static int idealtek_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
480} 485}
481#endif 486#endif
482 487
488/*****************************************************************************
489 * General Touch Part
490 */
491#ifdef CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH
492static int general_touch_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
493{
494 dev->x = ((pkt[2] & 0x0F) << 8) | pkt[1] ;
495 dev->y = ((pkt[4] & 0x0F) << 8) | pkt[3] ;
496 dev->press = pkt[5] & 0xff;
497 dev->touch = pkt[0] & 0x01;
498
499 return 1;
500}
501#endif
483 502
484/***************************************************************************** 503/*****************************************************************************
485 * the different device descriptors 504 * the different device descriptors
@@ -595,6 +614,18 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
595 .read_data = idealtek_read_data, 614 .read_data = idealtek_read_data,
596 }, 615 },
597#endif 616#endif
617
618#ifdef CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH
619 [DEVTYPE_GENERAL_TOUCH] = {
620 .min_xc = 0x0,
621 .max_xc = 0x0500,
622 .min_yc = 0x0,
623 .max_yc = 0x0500,
624 .rept_size = 7,
625 .read_data = general_touch_read_data,
626 }
627#endif
628
598}; 629};
599 630
600 631