From: Ondrej Zary <linux@rainbow-software.org>
To: daniel.ritz@gmx.ch
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] [resend] IRTOUCHSYSTEMS support for usbtouchscreen
Date: Mon, 2 Jul 2007 23:19:56 +0200 [thread overview]
Message-ID: <200707022319.57322.linux@rainbow-software.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1271 bytes --]
Hello,
this patch adds support for IRTOUCHSYSTEMS (or UNITOP) infrared touchscreens.
The manufacturer (http://www.irtouch.com) provides only closed source drivers
for specific kernel versions (looks like GPL violation, btw.) which I haven't
even tried (as there's no chance that any of the modules could work with
2.6.22-rc kernel). They also don't provide any protocol specification.
So I made this code (attached) after observing the data stream with usbmon for
a while. If someone is interested in my observations, here are the results:
The touchscreen sends data in 8-byte packets.
BYTE 0 - unknown meaning, seen only one value: 0x54
BYTE 1 - unknown meaning, 3 lowest bits indicate touch state
values seen: 0x81, 0x82 or 0x83
bit 0 = set if the screen is touched and was not touched before (touch
bit 1 = set if the screen is touched and was touched (dragging)
bit 2 = set if the touch was ended (release)
BYTES 2 and 3 - X position, high-order-byte first, range = 0 to 0x0FFF
BYTES 4 and 5 - Y position, high-order-byte first, range = 0 to 0x0FFF
BYTE 6 - unknown meaning, seen only one value: 0xFF
BYTE 7 - unknown meaning, seen only one value: 0x00
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
--
Ondrej Zary
[-- Attachment #2: usbtouchscreen-add-irtouch.patch --]
[-- Type: text/x-diff, Size: 2721 bytes --]
diff -ur linux-2.6.22-rc6-orig/drivers/input/touchscreen/Kconfig linux-2.6.22-rc6/drivers/input/touchscreen/Kconfig
--- linux-2.6.22-rc6-orig/drivers/input/touchscreen/Kconfig 2007-06-29 12:56:19.000000000 +0200
+++ linux-2.6.22-rc6/drivers/input/touchscreen/Kconfig 2007-06-29 13:01:38.000000000 +0200
@@ -177,6 +177,7 @@
- some other eTurboTouch
- Gunze AHL61
- DMC TSC-10/25
+ - IRTOUCHSYSTEMS/UNITOP
Have a look at <http://linux.chapter7.ch/touchkit/> for
a usage description and the required user-space stuff.
@@ -219,4 +220,9 @@
bool "DMC TSC-10/25 device support" if EMBEDDED
depends on TOUCHSCREEN_USB_COMPOSITE
+config TOUCHSCREEN_USB_IRTOUCH
+ default y
+ bool "IRTOUCHSYSTEMS/UNITOP device support" if EMBEDDED
+ depends on TOUCHSCREEN_USB_COMPOSITE
+
endif
Only in linux-2.6.22-rc6/drivers/input/touchscreen/: built-in.o
diff -ur linux-2.6.22-rc6-orig/drivers/input/touchscreen/usbtouchscreen.c linux-2.6.22-rc6/drivers/input/touchscreen/usbtouchscreen.c
--- linux-2.6.22-rc6-orig/drivers/input/touchscreen/usbtouchscreen.c 2007-06-29 12:56:19.000000000 +0200
+++ linux-2.6.22-rc6/drivers/input/touchscreen/usbtouchscreen.c 2007-06-29 13:01:48.000000000 +0200
@@ -9,6 +9,7 @@
* - eTurboTouch
* - Gunze AHL61
* - DMC TSC-10/25
+ * - IRTOUCHSYSTEMS/UNITOP
*
* Copyright (C) 2004-2006 by Daniel Ritz <daniel.ritz@gmx.ch>
* Copyright (C) by Todd E. Johnson (mtouchusb.c)
@@ -110,6 +111,7 @@
DEVTYPE_ETURBO,
DEVTYPE_GUNZE,
DEVTYPE_DMC_TSC10,
+ DEVTYPE_IRTOUCH,
};
static struct usb_device_id usbtouch_devices[] = {
@@ -150,6 +152,11 @@
{USB_DEVICE(0x0afa, 0x03e8), .driver_info = DEVTYPE_DMC_TSC10},
#endif
+#ifdef CONFIG_TOUCHSCREEN_USB_IRTOUCH
+ {USB_DEVICE(0x595a, 0x0001), .driver_info = DEVTYPE_IRTOUCH},
+ {USB_DEVICE(0x6615, 0x0001), .driver_info = DEVTYPE_IRTOUCH},
+#endif
+
{}
};
@@ -416,6 +423,21 @@
/*****************************************************************************
+ * IRTOUCH Part
+ */
+#ifdef CONFIG_TOUCHSCREEN_USB_IRTOUCH
+static int irtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
+{
+ dev->x = (pkt[3] << 8) | pkt[2];
+ dev->y = (pkt[5] << 8) | pkt[4];
+ dev->touch = (pkt[1] & 0x03) ? 1 : 0;
+
+ return 1;
+}
+#endif
+
+
+/*****************************************************************************
* the different device descriptors
*/
static struct usbtouch_device_info usbtouch_dev_info[] = {
@@ -504,6 +526,17 @@
.read_data = dmc_tsc10_read_data,
},
#endif
+
+#ifdef CONFIG_TOUCHSCREEN_USB_IRTOUCH
+ [DEVTYPE_IRTOUCH] = {
+ .min_xc = 0x0,
+ .max_xc = 0x0fff,
+ .min_yc = 0x0,
+ .max_yc = 0x0fff,
+ .rept_size = 8,
+ .read_data = irtouch_read_data,
+ },
+#endif
};
next reply other threads:[~2007-07-02 21:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-02 21:19 Ondrej Zary [this message]
2007-07-03 6:07 ` [PATCH] [resend] IRTOUCHSYSTEMS support for usbtouchscreen Oliver Neukum
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=200707022319.57322.linux@rainbow-software.org \
--to=linux@rainbow-software.org \
--cc=daniel.ritz@gmx.ch \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.