]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Input: usbtouchscreen - add support for ET&T TC4UM touchscreen controller
authorPetr Štetiar <ynezz@true.cz>
Mon, 28 Jun 2010 16:38:48 +0000 (09:38 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 28 Jun 2010 16:42:17 +0000 (09:42 -0700)
This patch adds support for the ET&T TC4UM 4-wire USB touchscreen
controller and tries to reuse the bits for TC5UH controller in kernel
already. Data interface is same.

Tested-by: Roger Pueyo Centelles <rogerpueyo@rogerpueyo.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/touchscreen/Kconfig
drivers/input/touchscreen/usbtouchscreen.c

index 3b9d5e2105d76d9fbfdd1a8d4cab9bf80f411b25..e835f04bc0d030987b18872313e69b15a5108db4 100644 (file)
@@ -540,9 +540,9 @@ config TOUCHSCREEN_USB_ZYTRONIC
        bool "Zytronic controller" if EMBEDDED
        depends on TOUCHSCREEN_USB_COMPOSITE
 
-config TOUCHSCREEN_USB_ETT_TC5UH
+config TOUCHSCREEN_USB_ETT_TC45USB
        default y
-       bool "ET&T TC5UH touchscreen controler support" if EMBEDDED
+       bool "ET&T USB series TC4UM/TC5UH touchscreen controler support" if EMBEDDED
        depends on TOUCHSCREEN_USB_COMPOSITE
 
 config TOUCHSCREEN_USB_NEXIO
index 5d6bf2a4bbad28e10ddb0cd463d1d3f4c36d4c1c..b9cee2738adba80d8d878a01b7727379dd15831a 100644 (file)
@@ -135,7 +135,7 @@ enum {
        DEVTYPE_JASTEC,
        DEVTYPE_E2I,
        DEVTYPE_ZYTRONIC,
-       DEVTYPE_TC5UH,
+       DEVTYPE_TC45USB,
        DEVTYPE_NEXIO,
 };
 
@@ -222,8 +222,11 @@ static const struct usb_device_id usbtouch_devices[] = {
        {USB_DEVICE(0x14c8, 0x0003), .driver_info = DEVTYPE_ZYTRONIC},
 #endif
 
-#ifdef CONFIG_TOUCHSCREEN_USB_ETT_TC5UH
-       {USB_DEVICE(0x0664, 0x0309), .driver_info = DEVTYPE_TC5UH},
+#ifdef CONFIG_TOUCHSCREEN_USB_ETT_TC45USB
+       /* TC5UH */
+       {USB_DEVICE(0x0664, 0x0309), .driver_info = DEVTYPE_TC45USB},
+       /* TC4UM */
+       {USB_DEVICE(0x0664, 0x0306), .driver_info = DEVTYPE_TC45USB},
 #endif
 
 #ifdef CONFIG_TOUCHSCREEN_USB_NEXIO
@@ -574,10 +577,10 @@ static int irtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
 #endif
 
 /*****************************************************************************
- * ET&T TC5UH part
+ * ET&T TC5UH/TC4UM part
  */
-#ifdef CONFIG_TOUCHSCREEN_USB_ETT_TC5UH
-static int tc5uh_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
+#ifdef CONFIG_TOUCHSCREEN_USB_ETT_TC45USB
+static int tc45usb_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];
@@ -1106,14 +1109,14 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
        },
 #endif
 
-#ifdef CONFIG_TOUCHSCREEN_USB_ETT_TC5UH
-       [DEVTYPE_TC5UH] = {
+#ifdef CONFIG_TOUCHSCREEN_USB_ETT_TC45USB
+       [DEVTYPE_TC45USB] = {
                .min_xc         = 0x0,
                .max_xc         = 0x0fff,
                .min_yc         = 0x0,
                .max_yc         = 0x0fff,
                .rept_size      = 5,
-               .read_data      = tc5uh_read_data,
+               .read_data      = tc45usb_read_data,
        },
 #endif