]> err.no Git - linux-2.6/commitdiff
Input: usbtouchscreen - add support for GeneralTouch devices
authorIlya Frolov <zeylie@gmail.com>
Fri, 12 Oct 2007 18:19:40 +0000 (14:19 -0400)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 12 Oct 2007 18:19:40 +0000 (14:19 -0400)
Signed-off-by: Ilya Frolov <zeylie@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/touchscreen/Kconfig
drivers/input/touchscreen/usbtouchscreen.c

index e73ce6ba3dc1ac1cffd652d83558fe716cd2958c..e3e0baa1a158b4e907a5cb5e2f3aedc4654722e3 100644 (file)
@@ -254,4 +254,9 @@ config TOUCHSCREEN_USB_IDEALTEK
        bool "IdealTEK URTC1000 device support" if EMBEDDED
        depends on TOUCHSCREEN_USB_COMPOSITE
 
+config TOUCHSCREEN_USB_GENERAL_TOUCH
+       default y
+       bool "GeneralTouch Touchscreen device support" if EMBEDDED
+       depends on TOUCHSCREEN_USB_COMPOSITE
+
 endif
index 13fbda0895b51a94904c89b707e01a896b820bdf..9b3a26cd1a8d2819e95905cec33021b49a260d2d 100644 (file)
@@ -114,6 +114,7 @@ enum {
        DEVTYPE_DMC_TSC10,
        DEVTYPE_IRTOUCH,
        DEVTYPE_IDEALTEK,
+       DEVTYPE_GENERAL_TOUCH,
 };
 
 static struct usb_device_id usbtouch_devices[] = {
@@ -163,6 +164,10 @@ static struct usb_device_id usbtouch_devices[] = {
        {USB_DEVICE(0x1391, 0x1000), .driver_info = DEVTYPE_IDEALTEK},
 #endif
 
+#ifdef CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH
+       {USB_DEVICE(0x0dfc, 0x0001), .driver_info = DEVTYPE_GENERAL_TOUCH},
+#endif
+
        {}
 };
 
@@ -480,6 +485,20 @@ static int idealtek_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
 }
 #endif
 
+/*****************************************************************************
+ * General Touch Part
+ */
+#ifdef CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH
+static int general_touch_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
+{
+       dev->x = ((pkt[2] & 0x0F) << 8) | pkt[1] ;
+       dev->y = ((pkt[4] & 0x0F) << 8) | pkt[3] ;
+       dev->press = pkt[5] & 0xff;
+       dev->touch = pkt[0] & 0x01;
+
+       return 1;
+}
+#endif
 
 /*****************************************************************************
  * the different device descriptors
@@ -595,6 +614,18 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
                .read_data      = idealtek_read_data,
        },
 #endif
+
+#ifdef CONFIG_TOUCHSCREEN_USB_GENERAL_TOUCH
+       [DEVTYPE_GENERAL_TOUCH] = {
+               .min_xc         = 0x0,
+               .max_xc         = 0x0500,
+               .min_yc         = 0x0,
+               .max_yc         = 0x0500,
+               .rept_size      = 7,
+               .read_data      = general_touch_read_data,
+       }
+#endif
+
 };