android_kernel_xiaomi_sm8350/drivers/input/touchscreen
Nuno Lucas 2ec6f246c3 Input: usbtouchscreen - fix TSC-10 DM USB controllers without EEPROM
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 driver worked with an earlier controller revision, but new
revisions of the controller 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[1] 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.

Note: This was previously submited as BUG #11961 [1] on the bugzilla
tracker, but rebased to version 2.6.27.4 and with unnecessary comments
and printk's removed.

[1] http://bugzilla.kernel.org/show_bug.cgi?id=11961

Signed-off-by: Nuno Lucas <ntlucas@gmail.com>
Acked-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-11-19 16:53:58 -05:00
..
ads7846.c Input: struct device - replace bus_id with dev_name(), dev_set_name() 2008-10-30 09:29:05 -04:00
atmel_tsadcc.c Input: atmel_tsadcc - improve accuracy 2008-09-10 12:12:24 -04:00
corgi_ts.c [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
elo.c
fujitsu_ts.c
gunze.c
h3600_ts_input.c [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
hp680_ts_input.c sh: Migrate common board headers to mach-common/. 2008-10-20 13:02:48 +09:00
htcpen.c
inexio.c
jornada720_ts.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2008-09-22 07:46:06 -07:00
Kconfig Merge branch 'for-rmk' of git://git.android.com/kernel into devel 2008-10-22 19:34:09 +01:00
mainstone-wm97xx.c Merge branch 'next' into for-linus 2008-10-15 23:29:12 -04:00
Makefile Input: add driver for Atmel integrated touchscreen controller 2008-07-23 22:03:09 -04:00
migor_ts.c input: migor_ts compile and detection fix 2008-08-11 20:17:54 +09:00
mk712.c
mtouch.c
penmount.c
touchit213.c
touchright.c
touchwin.c
ucb1400_ts.c [ARM] 5184/1: Split ucb1400_ts into core and touchscreen 2008-08-20 23:22:22 +01:00
usbtouchscreen.c Input: usbtouchscreen - fix TSC-10 DM USB controllers without EEPROM 2008-11-19 16:53:58 -05:00
wm97xx-core.c Merge branch 'next' into for-linus 2008-10-15 23:29:12 -04:00
wm9705.c Merge branch 'next' into for-linus 2008-10-15 23:29:12 -04:00
wm9712.c Merge branch 'next' into for-linus 2008-10-15 23:29:12 -04:00
wm9713.c Merge branch 'next' into for-linus 2008-10-15 23:29:12 -04:00