Skip to content

Commit 38771bb

Browse files
ynezzdtor
authored andcommitted
Input: usbtouchscreen - add support for ET&T TC4UM touchscreen controller
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>
1 parent 7804302 commit 38771bb

2 files changed

Lines changed: 14 additions & 11 deletions

File tree

‎drivers/input/touchscreen/Kconfig‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,9 @@ config TOUCHSCREEN_USB_ZYTRONIC
540540
bool "Zytronic controller" if EMBEDDED
541541
depends on TOUCHSCREEN_USB_COMPOSITE
542542

543-
config TOUCHSCREEN_USB_ETT_TC5UH
543+
config TOUCHSCREEN_USB_ETT_TC45USB
544544
default y
545-
bool "ET&T TC5UH touchscreen controler support" if EMBEDDED
545+
bool "ET&T USB series TC4UM/TC5UH touchscreen controler support" if EMBEDDED
546546
depends on TOUCHSCREEN_USB_COMPOSITE
547547

548548
config TOUCHSCREEN_USB_NEXIO

‎drivers/input/touchscreen/usbtouchscreen.c‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ enum {
135135
DEVTYPE_JASTEC,
136136
DEVTYPE_E2I,
137137
DEVTYPE_ZYTRONIC,
138-
DEVTYPE_TC5UH,
138+
DEVTYPE_TC45USB,
139139
DEVTYPE_NEXIO,
140140
};
141141

@@ -222,8 +222,11 @@ static const struct usb_device_id usbtouch_devices[] = {
222222
{USB_DEVICE(0x14c8, 0x0003), .driver_info = DEVTYPE_ZYTRONIC},
223223
#endif
224224

225-
#ifdef CONFIG_TOUCHSCREEN_USB_ETT_TC5UH
226-
{USB_DEVICE(0x0664, 0x0309), .driver_info = DEVTYPE_TC5UH},
225+
#ifdef CONFIG_TOUCHSCREEN_USB_ETT_TC45USB
226+
/* TC5UH */
227+
{USB_DEVICE(0x0664, 0x0309), .driver_info = DEVTYPE_TC45USB},
228+
/* TC4UM */
229+
{USB_DEVICE(0x0664, 0x0306), .driver_info = DEVTYPE_TC45USB},
227230
#endif
228231

229232
#ifdef CONFIG_TOUCHSCREEN_USB_NEXIO
@@ -574,10 +577,10 @@ static int irtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
574577
#endif
575578

576579
/*****************************************************************************
577-
* ET&T TC5UH part
580+
* ET&T TC5UH/TC4UM part
578581
*/
579-
#ifdef CONFIG_TOUCHSCREEN_USB_ETT_TC5UH
580-
static int tc5uh_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
582+
#ifdef CONFIG_TOUCHSCREEN_USB_ETT_TC45USB
583+
static int tc45usb_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
581584
{
582585
dev->x = ((pkt[2] & 0x0F) << 8) | pkt[1];
583586
dev->y = ((pkt[4] & 0x0F) << 8) | pkt[3];
@@ -1106,14 +1109,14 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
11061109
},
11071110
#endif
11081111

1109-
#ifdef CONFIG_TOUCHSCREEN_USB_ETT_TC5UH
1110-
[DEVTYPE_TC5UH] = {
1112+
#ifdef CONFIG_TOUCHSCREEN_USB_ETT_TC45USB
1113+
[DEVTYPE_TC45USB] = {
11111114
.min_xc = 0x0,
11121115
.max_xc = 0x0fff,
11131116
.min_yc = 0x0,
11141117
.max_yc = 0x0fff,
11151118
.rept_size = 5,
1116-
.read_data = tc5uh_read_data,
1119+
.read_data = tc45usb_read_data,
11171120
},
11181121
#endif
11191122

0 commit comments

Comments
 (0)