linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Petr Štetiar" <ynezz@true.cz>
To: linux-input@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Jiri Kosina <jikos@novell.com>,
	ynezz@true.cz
Subject: [PATCH 1/2] Input: usbtouchscreen - add support for ET&T TC4UM touchscreen controller
Date: Fri, 11 Jun 2010 09:40:53 +0200	[thread overview]
Message-ID: <1276242054-11127-1-git-send-email-ynezz@true.cz> (raw)
In-Reply-To: <20100603075720.GQ26052@ibawizard.net>

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>
---
 drivers/input/touchscreen/Kconfig          |    4 ++--
 drivers/input/touchscreen/usbtouchscreen.c |   21 ++++++++++++---------
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 3b9d5e2..e835f04 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -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
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 567d572..3244542 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -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];
@@ -1104,14 +1107,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
 
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-06-11  7:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTimmEtxuQ00jlLPMJkiS7htBV53wMpuWzW_RPs51@mail.gmail.com>
     [not found] ` <20100603072424.GP26052@ibawizard.net>
     [not found]   ` <20100603075720.GQ26052@ibawizard.net>
2010-06-10  9:33     ` [patch] TC4UM driver for linux-input Roger Pueyo
2010-06-11  7:40     ` Petr Štetiar [this message]
2010-06-11  7:40       ` [PATCH 2/2] HID: blacklist ET&T TC4UH touchscreen controller Petr Štetiar
2010-06-11  7:55         ` Jiri Kosina
2010-06-28  9:19       ` [PATCH 1/2] Input: usbtouchscreen - add support for ET&T TC4UM " Petr Štetiar
2010-06-28 16:46         ` Dmitry Torokhov
2010-06-30  7:16           ` usbtouchscreen - runtime PM patches testing [Was: [PATCH 1/2] Input: usbtouchscreen - add support for ET&T TC4UM touchscreen controller] Petr Štetiar
2010-06-30  7:48             ` Dmitry Torokhov
2010-06-30 13:04             ` Oliver Neukum
2010-07-14 10:43               ` Petr Štetiar
2010-07-14 12:23                 ` Oliver Neukum
2010-07-15  6:39                   ` Petr Štetiar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1276242054-11127-1-git-send-email-ynezz@true.cz \
    --to=ynezz@true.cz \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jikos@novell.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).