Latest working kernel version: never
Earliest failing kernel version:
Hardware Environment: x86
The usbtouchscreen module implements a driver for the TSC-10 DM USB touchscreen controllers, but assumes a 2-byte response for the CMD_RESET and CMD_RATE commands, when they can be only a single byte when no EEPROM is connected.
The following patch in the dmc_tsc10_init() function (which fixes the problem) should make it clear:
diff -urpN linux-220.127.116.11.orig/drivers/input/touchscreen/usbtouchscreen.c linux-18.104.22.168-patched/drivers/input/touchscreen/usbtouchscreen.c
--- linux-22.214.171.124.orig/drivers/input/touchscreen/usbtouchscreen.c 2008-10-22 22:19:25.000000000 +0100
+++ linux-126.96.36.199-patched/drivers/input/touchscreen/usbtouchscreen.c 2008-11-05 17:01:06.000000000 +0000
@@ -407,7 +407,8 @@ static int dmc_tsc10_init(struct usbtouc
0, 0, buf, 2, USB_CTRL_SET_TIMEOUT);
if (ret < 0)
- if (buf != 0x06 || buf != 0x00)
+ printk( "dmc_tsc10_init: RESET=>'%02X%02X\n'", buf, buf );
+ if (buf != 0x06 /*|| buf != 0x00*/)
/* set coordinate output rate */
@@ -418,7 +419,8 @@ static int dmc_tsc10_init(struct usbtouc
TSC10_RATE_150, 0, buf, 2, USB_CTRL_SET_TIMEOUT);
if (ret < 0)
- if ((buf != 0x06 || buf != 0x00) &&
+ printk( "dmc_tsc10_init: RATE=>'%02X%02X\n'", buf, buf );
+ if ((buf != 0x06 /*|| buf != 0x00*/) &&
(buf != 0x15 || buf != 0x01))
The driver worked with an earlier controller revision, but new revisions of the controller (now discontinued, but still on sale) fail.
It seems the problem is that the early controller had the SEL4/EEPROM-CS pin high, but the new controller has it down, making the response different.
Without the fix, the controller would answer the single byte 0x06 (ACK), making the init fail with -ENODEV because buf is 0xFF (as initialized before).
As the single byte is the only thing we need to check it was ok, there is no need to verify the second byte.
The [0x15 0x01] case is the NAK [0x15] response for when there is no data in the EEPROM [bit-0 of second byte set], so I let that be, as I don't have any controller with an EEPROM.
With this patch, both the earlier and latest controller work the same.
Please submit patches via email. Documentation/SubmittingPatches
describes the process. Suitable recipients for this patch are
Dmitry Torokhov <email@example.com>
Andrew Morton <firstname.lastname@example.org>
Patch sent via email:
I'm closing this as the patch was applied to 2.6.29.