linux/drivers/input/touchscreen
Douglas Anderson c3991107a2 Input: elants_i2c - delay longer with reset asserted
The elan touchscreen datasheet says that the reset GPIO only needs to
be asserted for 500us in order to reset the regulator. The problem is
that some boards need a level shifter between the signals on the GPIO
controller and the signals on the touchscreen. All of these extra
components on the line can slow the transition of the signals. On one
board, we measured the reset line and saw that it took almost 1.8ms to
go low. Even after we bumped up the "drive strength" of the signal
from the default 2mA to 8mA we still saw it take 421us for the signal
to go low.

In order to account for this let's lengthen the amount of time that we
keep the reset asserted. Let's bump it up from 500us to 5000us.
That's still a relatively short amount of time and is much safer.

It should be noted that this fixes real problems. Case in point:
1. The touchscreen power rail may be shared with another device (like
   an eDP panel). That means that at probe time power might already be
   on.
2. In probe we grab the reset GPIO and assert it (make it low).
3. We turn on power (a noop since it was already on).
4. We wait 500us.
5. We deassert the reset GPIO.

With the above case and only a 500us delay we saw only a partial reset
asserted, which is bad. Giving it 5ms is overkill but feels safer in
case someone else has a different level shifter setup.

Note that bumping up the delay to 5000 means that some configs yell
about using udelay(). We'll change to using usleep_range(). We give a
small range here because:
- This isn't a delay that happens very often so we don't need to worry
  about giving a big range to allow for power efficiency.
- usleep_range() is known to almost always pick the upper bound and
  delay that long and we really don't want to slow down the power on
  of the touchscreen that much.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Link: https://lore.kernel.org/r/20221208180603.v2.5.I6edfb3f459662c041563a54e5b7df727c27caaba@changeid
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-12-08 18:19:48 -08:00
..
88pm860x-ts.c
ad7877.c Input: ad7877 - use new structure for SPI transfer delays 2020-12-10 23:39:15 -08:00
ad7879-i2c.c Input: ad7879-i2c - Convert to i2c's .probe_new() 2022-12-02 14:53:44 -08:00
ad7879-spi.c
ad7879.c Input: use input_device_enabled() 2020-12-02 22:10:33 -08:00
ad7879.h
ads7846.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
ar1021_i2c.c Input: ar1021_i2c - Convert to i2c's .probe_new() 2022-12-02 14:53:44 -08:00
atmel_mxt_ts.c Input: atmel_mxt_ts - Convert to i2c's .probe_new() 2022-12-02 14:53:44 -08:00
auo-pixcir-ts.c Input: auo-pixcir-ts - Convert to i2c's .probe_new() 2022-12-02 14:53:44 -08:00
bcm_iproc_tsc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_30.RULE (part 2) 2022-06-10 14:51:35 +02:00
bu21013_ts.c Input: bu21013_ts - Convert to i2c's .probe_new() 2022-12-02 14:53:44 -08:00
bu21029_ts.c Input: bu21029_ts - Convert to i2c's .probe_new() 2022-12-02 14:53:44 -08:00
chipone_icn8318.c Input: chipone_icn8318 - Convert to i2c's .probe_new() 2022-12-02 14:53:44 -08:00
chipone_icn8505.c Input: icn8505 - utilize acpi_get_subsystem_id() 2022-09-28 09:01:32 -07:00
colibri-vf50-ts.c
cy8ctma140.c Input: cy8ctma140 - Convert to i2c's .probe_new() 2022-12-02 14:53:44 -08:00
cy8ctmg110_ts.c Input: cy8ctmg110_ts - Convert to i2c's .probe_new() 2022-12-02 14:53:44 -08:00
cyttsp4_core.c Input: cyttsp4 - move 'cyttsp4_tch_abs_string' to the only file that references it 2020-11-08 22:35:48 -08:00
cyttsp4_core.h Input: cyttsp4 - move 'cyttsp4_tch_abs_string' to the only file that references it 2020-11-08 22:35:48 -08:00
cyttsp4_i2c.c Input: cyttsp4 - Convert to i2c's .probe_new() 2022-12-02 14:53:44 -08:00
cyttsp4_spi.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
cyttsp5.c Input: cyttsp5: Convert to i2c's .probe_new() 2022-12-02 14:53:44 -08:00
cyttsp_core.c Input: cyttsp - remove public header 2021-06-01 21:13:11 -07:00
cyttsp_core.h Input: cyttsp - remove public header 2021-06-01 21:13:11 -07:00
cyttsp_i2c_common.c
cyttsp_i2c.c Input: cyttsp_i2c - Convert to i2c's .probe_new() 2022-12-02 14:53:44 -08:00
cyttsp_spi.c Input: cyttsp - remove public header 2021-06-01 21:13:11 -07:00
da9034-ts.c
da9052_tsi.c
dynapro.c
edt-ft5x06.c Input: edt-ft5x06 - Convert to i2c's .probe_new() 2022-12-02 14:53:45 -08:00
eeti_ts.c Input: eeti_ts - Convert to i2c's .probe_new() 2022-12-02 14:53:45 -08:00
egalax_ts_serial.c
egalax_ts.c Input: egalax_ts - Convert to i2c's .probe_new() 2022-12-02 14:53:45 -08:00
ektf2127.c Input: ektf2127 - Convert to i2c's .probe_new() 2022-12-02 14:53:45 -08:00
elants_i2c.c Input: elants_i2c - delay longer with reset asserted 2022-12-08 18:19:48 -08:00
elo.c Input: elo - fix an error code in elo_connect() 2021-02-18 14:39:42 -08:00
exc3000.c Input: exc3000 - fix return value check of wait_for_completion_timeout 2022-06-28 22:45:43 -07:00
fsl-imx25-tcq.c
fujitsu_ts.c
goodix_fwupload.c Input: goodix - fix memory leak in goodix_firmware_upload 2021-12-09 21:20:29 -08:00
goodix.c Input: goodix - Convert to i2c's .probe_new() 2022-12-02 14:53:45 -08:00
goodix.h Input: goodix - fix race on driver unbind 2022-02-28 23:26:30 -08:00
gunze.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00
hampshire.c
hideep.c Input: hideep - Convert to i2c's .probe_new() 2022-12-02 14:53:45 -08:00
himax_hx83112b.c Input: hx83112b: Convert to i2c's .probe_new() 2022-12-02 14:53:45 -08:00
hp680_ts_input.c
htcpen.c isa: Make the remove callback for isa drivers return void 2021-01-26 07:42:27 +01:00
hycon-hy46xx.c Input: hycon-hy46xx - Convert to i2c's .probe_new() 2022-12-02 14:53:45 -08:00
hynitron_cstxxx.c Input: hynitron_cstxxx - initialize tmp to 0 to fix uninitialized variable issue 2022-11-17 22:14:43 -08:00
ili210x.c Input: ili210x - Convert to i2c's .probe_new() 2022-12-02 14:53:45 -08:00
ilitek_ts_i2c.c Input: ilitek_ts_i2c - Convert to i2c's .probe_new() 2022-12-02 14:53:45 -08:00
imagis.c Input: add Imagis touchscreen driver 2022-03-20 22:00:12 -07:00
imx6ul_tsc.c Input: use input_device_enabled() 2020-12-02 22:10:33 -08:00
inexio.c
ipaq-micro-ts.c Input: use input_device_enabled() 2020-12-02 22:10:33 -08:00
iqs5xx.c Input: iqs5xx - Convert to i2c's .probe_new() 2022-12-02 14:53:46 -08:00
jornada720_ts.c
Kconfig Input: stmpe-ts - drop obsolete dependency on COMPILE_TEST 2022-11-22 14:20:28 -08:00
lpc32xx_ts.c Input: lpc32xx_ts - convert to use BIT() 2021-03-20 19:48:37 -07:00
mainstone-wm97xx.c Input: wm97xx - get rid of irq_enable method in wm97xx_mach_ops 2022-05-07 22:55:48 +02:00
Makefile Input: add driver for Himax hx83112b touchscreen devices 2022-11-07 11:28:55 -08:00
max11801_ts.c Input: max11801_ts - Convert to i2c's .probe_new() 2022-12-02 14:53:46 -08:00
mc13783_ts.c
mcs5000_ts.c Input: mcs5000_ts - Convert to i2c's .probe_new() 2022-12-02 14:53:46 -08:00
melfas_mip4.c Input: melfas_mip4 - Convert to i2c's .probe_new() 2022-12-02 14:53:46 -08:00
migor_ts.c Input: migor_ts - Convert to i2c's .probe_new() 2022-12-02 14:53:46 -08:00
mk712.c
mms114.c Input: mms114 - Convert to i2c's .probe_new() 2022-12-02 14:53:46 -08:00
msg2638.c Input: msg2638 - only read linux,keycodes array if necessary 2022-11-30 15:16:25 -08:00
mtouch.c
mxs-lradc-ts.c
pcap_ts.c
penmount.c
pixcir_i2c_ts.c Input: pixcir_i2c_ts - Convert to i2c's .probe_new() 2022-12-02 14:53:46 -08:00
raspberrypi-ts.c input: raspberrypi-ts: Release firmware handle when not needed 2021-03-22 17:59:51 +01:00
raydium_i2c_ts.c Input: raydium_i2c_ts - Convert to i2c's .probe_new() 2022-12-02 14:53:46 -08:00
resistive-adc-touch.c Input: resistive-adc-touch - fix division by zero error on z1 == 0 2021-10-15 22:11:03 -07:00
rohm_bu21023.c Input: rohm_bu21023 - Convert to i2c's .probe_new() 2022-12-02 14:53:46 -08:00
s3c2410_ts.c ARM: s3c: adc: move header to linux/soc/samsung 2020-08-19 21:44:11 +02:00
s6sy761.c Input: s6sy761 - Convert to i2c's .probe_new() 2022-12-02 14:53:46 -08:00
silead.c Input: silead - Convert to i2c's .probe_new() 2022-12-02 14:53:46 -08:00
sis_i2c.c Input: sis_i2c - Convert to i2c's .probe_new() 2022-12-02 14:53:47 -08:00
st1232.c Input: st1232 - Convert to i2c's .probe_new() 2022-12-02 14:53:47 -08:00
stmfts.c Input: stmfts - Convert to i2c's .probe_new() 2022-12-02 14:53:47 -08:00
stmpe-ts.c Input: stmpe-ts - add description for 'prop' struct member 2021-01-19 19:03:18 -08:00
sun4i-ts.c Input: sun4i-ts - switch to new of thermal API 2022-08-17 14:09:39 +02:00
sur40.c Input: move from strlcpy with unused retval to strscpy 2022-08-18 15:44:08 -07:00
surface3_spi.c Input: surface3_spi - remove set but unused variable 'timestamp' 2021-01-19 19:03:16 -08:00
sx8654.c Input: sx8654 - Convert to i2c's .probe_new() 2022-12-02 14:53:47 -08:00
ti_am335x_tsc.c Input: ti_am335x_tsc - fix a typo in a comment 2022-01-10 12:46:54 -08:00
touchit213.c
touchright.c
touchwin.c
tps6507x-ts.c Input: tps6507x-ts - remove variable loops 2022-10-24 05:18:55 -07:00
ts4800-ts.c
tsc40.c
tsc200x-core.c Input: tsc200x - add axis inversion and swapping support 2022-02-15 21:25:20 -08:00
tsc200x-core.h Input: tsc200x - make tsc200x_remove() return void 2021-10-12 19:48:54 -07:00
tsc2004.c Input: tsc2004 - Convert to i2c's .probe_new() 2022-12-02 14:53:47 -08:00
tsc2005.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
tsc2007_core.c Input: tsc2007_core - Convert to i2c's .probe_new() 2022-12-02 14:53:47 -08:00
tsc2007_iio.c
tsc2007.h Input: tsc2007 - convert to GPIO descriptors 2021-03-15 17:12:02 -07:00
ucb1400_ts.c Input: ucb1400_ts - remove redundant variable penup 2021-12-19 23:55:25 -08:00
usbtouchscreen.c Input: move from strlcpy with unused retval to strscpy 2022-08-18 15:44:08 -07:00
wacom_i2c.c Input: wacom_i2c - Convert to i2c's .probe_new() 2022-12-02 14:53:47 -08:00
wacom_w8001.c Input: move from strlcpy with unused retval to strscpy 2022-08-18 15:44:08 -07:00
wdt87xx_i2c.c Input: wdt87xx_i2c - Convert to i2c's .probe_new() 2022-12-02 14:53:47 -08:00
wm97xx-core.c Merge branch 'next' into for-linus 2022-08-02 10:06:12 -07:00
wm831x-ts.c Input: move to use request_irq by IRQF_NO_AUTOEN flag 2021-03-25 15:27:56 -07:00
wm9705.c
wm9712.c
wm9713.c
zet6223.c Input: zet6223 - Convert to i2c's .probe_new() 2022-12-02 14:53:47 -08:00
zforce_ts.c Input: zforce_ts - Convert to i2c's .probe_new() 2022-12-02 14:53:47 -08:00
zinitix.c Input: zinitix - rename defines ZINITIX_* 2022-05-27 21:49:34 -07:00
zylonite-wm97xx.c Input: wm97xx - get rid of irq_enable method in wm97xx_mach_ops 2022-05-07 22:55:48 +02:00