Skip to contentSkip to conversation

IdealTEK URTC1000 support for usbtouchscreen

PATCH In review Ondrej Zary 2 participants 3 messages Aug 23, 2007 – Aug 27, 2007 Input drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IdealTEK URTC1000 support for usbtouchscreen

Hello,
this patch adds support for IdealTEK URTC1000 touchscreen controllers.

Documentation can be downloaded at
http://projects.tbmn.org/cgi-bin/trac.cgi/wiki/urtc-1000

I'm not sure that the code is correct, especially because the .rept_size is set to 8 bytes. I've tried 5, 6, 7, 8, 12 and 16. Only 8 and 16 work. Other values resulted in -EOVERFLOW in usbtouch_irq() and infinite retries.

Signature · 1 line
Ondrej Zary
drivers/input/touchscreen/Kconfig +6 -0
diff -ur linux-2.6.23-rc3-orig/drivers/input/touchscreen/Kconfig linux-2.6.23-rc3/drivers/input/touchscreen/Kconfig
@@ -191,6 +191,7 @@
 	  - Gunze AHL61
 	  - DMC TSC-10/25
 	  - IRTOUCHSYSTEMS/UNITOP
+	  - IdealTEK URTC1000
 
 	  Have a look at <http://linux.chapter7.ch/touchkit/> for
 	  a usage description and the required user-space stuff.
@@ -238,4 +239,9 @@
 	bool "IRTOUCHSYSTEMS/UNITOP device support" if EMBEDDED
 	depends on TOUCHSCREEN_USB_COMPOSITE
 
+config TOUCHSCREEN_USB_IDEALTEK
+	default y
+	bool "IdealTEK URTC1000 device support" if EMBEDDED
+	depends on TOUCHSCREEN_USB_COMPOSITE
+
 endif
drivers/input/touchscreen/usbtouchscreen.c +61 -0

91 lines not on this page · raw message

#1 lore raw

[ please don't send patches as attachment.. ]

Quoted 3 lines · On Thursday 23 August 2007 23:55:28 Ondrej Zary wrote:

Hello,
this patch adds support for IdealTEK URTC1000 touchscreen controllers.

looks good, just a few minor things...

Quoted 7 lines

Documentation can be downloaded at
http://projects.tbmn.org/cgi-bin/trac.cgi/wiki/urtc-1000

I'm not sure that the code is correct, especially because the .rept_size is set to 8 bytes. I've tried 5, 6, 7, 8, 12 and 16. Only 8 and 16 work. Other values resulted in -EOVERFLOW in usbtouch_irq() and infinite retries.

8 is fine.

Quoted 2 lines

+ if (pkt[0] == 1) {

+               /* response string - ignore it */
+               char *end = strchr(pkt, '\r');
+               end[0] = 0;
+               dbg("IdealTEK response: %s\n", &pkt[1]);
+               return 0;

just remove this block

+ } else if ((pkt[0] & 0x98) == 0x88) {

+               /* touch data in IdealTEK mode */
+               dev->x = (pkt[1] << 5) | (pkt[2] >> 2);
+               dev->y = (pkt[3] << 5) | (pkt[4] >> 2);
+               dev->touch = (pkt[0] & 0x40) ? 1 : 0;
+               return 1;
+       } else if ((pkt[0] & 0x98) == 0x98) {
+               /* touch data in MT emulation mode */
+               dev->x = (pkt[2] << 5) | (pkt[1] >> 2);
+               dev->y = (pkt[4] << 5) | (pkt[3] >> 2);
+               dev->touch = (pkt[0] & 0x40) ? 1 : 0;
+               return 1;

+ } else {
+ dbg("IdealTEK: invalid data\n");
+ return 0;
+ }

and this one as well...and do a 'return 0;' as last statement outside the 'if'

+ .process_pkt = usbtouch_process_multi,

so you're using the support for packets split across two URBs? is it required? if so, you have to ensure that the function is compiled in. ie. extend this statement in the driver with your config option:

#if defined(CONFIG_TOUCHSCREEN_USB_EGALAX) || defined(CONFIG_TOUCHSCREEN_USB_ETURBO) #define MULTI_PACKET
#endif

the rest looks fine.

rgds
-daniel

#2 lore raw
Quoted 46 lines · On Saturday 25 August 2007 18:48:13 Daniel Ritz wrote:

[ please don't send patches as attachment.. ]

Quoted 2 lines · On Thursday 23 August 2007 23:55:28 Ondrej Zary wrote:

Hello,
this patch adds support for IdealTEK URTC1000 touchscreen controllers.

looks good, just a few minor things...

Quoted 7 lines

Documentation can be downloaded at
http://projects.tbmn.org/cgi-bin/trac.cgi/wiki/urtc-1000

I'm not sure that the code is correct, especially because the .rept_size is set to 8 bytes. I've tried 5, 6, 7, 8, 12 and 16. Only 8 and 16 work. Other values resulted in -EOVERFLOW in usbtouch_irq() and infinite retries.

8 is fine.

Quoted 1 line
(quoted diff) +6 -0
+       if (pkt[0] == 1) {
+               /* response string - ignore it */
+               char *end = strchr(pkt, '\r');
+               end[0] = 0;
+               dbg("IdealTEK response: %s\n", &pkt[1]);
+               return 0;

just remove this block

(quoted diff) +16 -0
+       } else if ((pkt[0] & 0x98) == 0x88) {
+               /* touch data in IdealTEK mode */
+               dev->x = (pkt[1] << 5) | (pkt[2] >> 2);
+               dev->y = (pkt[3] << 5) | (pkt[4] >> 2);
+               dev->touch = (pkt[0] & 0x40) ? 1 : 0;
+               return 1;
+       } else if ((pkt[0] & 0x98) == 0x98) {
+               /* touch data in MT emulation mode */
+               dev->x = (pkt[2] << 5) | (pkt[1] >> 2);
+               dev->y = (pkt[4] << 5) | (pkt[3] >> 2);
+               dev->touch = (pkt[0] & 0x40) ? 1 : 0;
+               return 1;
+       } else {
+               dbg("IdealTEK: invalid data\n");
+               return 0;
+       }
Quoted 2 lines

and this one as well...and do a 'return 0;' as last statement outside the 'if'

done

Quoted 7 lines

+ .process_pkt = usbtouch_process_multi,

so you're using the support for packets split across two URBs? is it required? if so, you have to ensure that the function is compiled in. ie. extend this statement in the driver with your config option:

Yes, it didn't work properly without that. The device sends touch data in 5-byte packets but can also send replies of arbitrary length to commands. It also sends a "reply" (4-byte) after it's enabled. So the first packet is 4 bytes and all subsequent are 5-byte. Maybe that's why this is needed.

Quoted 9 lines

#if defined(CONFIG_TOUCHSCREEN_USB_EGALAX) || defined(CONFIG_TOUCHSCREEN_USB_ETURBO) #define MULTI_PACKET #endif

the rest looks fine.

rgds
-daniel

OK, so here's the new patch, inline this time:

This patch adds support for IdealTEK URTC1000 touchscreen controllers.

Documentation can be downloaded at
http://projects.tbmn.org/cgi-bin/trac.cgi/wiki/urtc-1000

drivers/input/touchscreen/Kconfig +6 -0
diff -ur linux-2.6.23-rc3-orig/drivers/input/touchscreen/Kconfig linux-2.6.23-rc3/drivers/input/touchscreen/Kconfig
@@ -191,6 +191,7 @@
 	  - Gunze AHL61
 	  - DMC TSC-10/25
 	  - IRTOUCHSYSTEMS/UNITOP
+	  - IdealTEK URTC1000
 
 	  Have a look at <http://linux.chapter7.ch/touchkit/> for
 	  a usage description and the required user-space stuff.
@@ -238,4 +239,9 @@
 	bool "IRTOUCHSYSTEMS/UNITOP device support" if EMBEDDED
 	depends on TOUCHSCREEN_USB_COMPOSITE
 
+config TOUCHSCREEN_USB_IDEALTEK
+	default y
+	bool "IdealTEK URTC1000 device support" if EMBEDDED
+	depends on TOUCHSCREEN_USB_COMPOSITE
+
 endif
drivers/input/touchscreen/usbtouchscreen.c +54 -1

91 lines not on this page · raw message

Signature · 1 line
Ondrej Zary