linux/drivers/input/touchscreen
Douglas Anderson 917e58a84e Input: elants_i2c - properly handle the reset GPIO when power is off
[ Upstream commit a85fbd6498 ]

As can be seen in elants_i2c_power_off(), we want the reset GPIO
asserted when power is off. The reset GPIO is active low so we need
the reset line logic low when power is off to avoid leakage.

We have a problem, though, at probe time. At probe time we haven't
powered the regulators on yet but we have:

  devm_gpiod_get(&client->dev, "reset", GPIOD_OUT_LOW);

While that _looks_ right, it turns out that it's not. The
GPIOD_OUT_LOW doesn't mean to init the GPIO to low. It means init the
GPIO to "not asserted". Since this is an active low GPIO that inits it
to be high.

Let's fix this to properly init the GPIO. Now after both probe and
power off the state of the GPIO is consistent (it's "asserted" or
level low).

Once we fix this, we can see that at power on time we no longer to
assert the reset GPIO as the first thing. The reset GPIO is _always_
asserted before powering on. Let's fix powering on to account for
this.

Fixes: afe10358e4 ("Input: elants_i2c - wire up regulator support")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20221117123805.1.I9959ac561dd6e1e8e1ce7085e4de6167b27c574f@changeid
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:32:12 +01:00
..
88pm860x-ts.c
ad7877.c
ad7879-i2c.c
ad7879-spi.c
ad7879.c
ad7879.h
ads7846.c
ar1021_i2c.c
atmel_mxt_ts.c Input: move from strlcpy with unused retval to strscpy 2022-08-18 15:44:08 -07:00
auo-pixcir-ts.c Input: auo-pixcir-ts - switch to using generic device properties 2022-09-16 06:38:51 -07:00
bcm_iproc_tsc.c
bu21013_ts.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
bu21029_ts.c
chipone_icn8318.c
chipone_icn8505.c Input: icn8505 - utilize acpi_get_subsystem_id() 2022-09-28 09:01:32 -07:00
colibri-vf50-ts.c
cy8ctma140.c
cy8ctmg110_ts.c
cyttsp_core.c
cyttsp_core.h
cyttsp_i2c_common.c
cyttsp_i2c.c
cyttsp_spi.c
cyttsp4_core.c
cyttsp4_core.h
cyttsp4_i2c.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
cyttsp4_spi.c
da9034-ts.c
da9052_tsi.c
dynapro.c
edt-ft5x06.c Input: move from strlcpy with unused retval to strscpy 2022-08-18 15:44:08 -07:00
eeti_ts.c
egalax_ts_serial.c
egalax_ts.c
ektf2127.c
elants_i2c.c Input: elants_i2c - properly handle the reset GPIO when power is off 2022-12-31 13:32:12 +01:00
elo.c
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
goodix.c Input: goodix - try resetting the controller when no config is set 2022-11-03 12:49:35 -07:00
goodix.h
gunze.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00
hampshire.c
hideep.c
hp680_ts_input.c
htcpen.c
hycon-hy46xx.c
ili210x.c
ilitek_ts_i2c.c
imagis.c
imx6ul_tsc.c
inexio.c
ipaq-micro-ts.c
iqs5xx.c
jornada720_ts.c
Kconfig Input: colibri-vf50-ts - don't depend on VF610_ADC 2022-08-31 10:38:04 -07:00
lpc32xx_ts.c
mainstone-wm97xx.c
Makefile
max11801_ts.c
mc13783_ts.c
mcs5000_ts.c
melfas_mip4.c Input: melfas_mip4 - fix return value check in mip4_probe() 2022-09-24 22:09:49 -07:00
migor_ts.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
mk712.c
mms114.c
msg2638.c
mtouch.c
mxs-lradc-ts.c
pcap_ts.c
penmount.c
pixcir_i2c_ts.c
raspberrypi-ts.c
raydium_i2c_ts.c Input: raydium_ts_i2c - fix memory leak in raydium_i2c_send() 2022-12-02 15:42:21 -08:00
resistive-adc-touch.c
rohm_bu21023.c
s3c2410_ts.c
s6sy761.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
silead.c
sis_i2c.c
st1232.c
stmfts.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
stmpe-ts.c
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
sx8654.c
ti_am335x_tsc.c
touchit213.c
touchright.c
touchwin.c
tps6507x-ts.c
ts4800-ts.c
tsc40.c
tsc200x-core.c
tsc200x-core.h
tsc2004.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
tsc2005.c
tsc2007_core.c
tsc2007_iio.c
tsc2007.h
ucb1400_ts.c
usbtouchscreen.c Input: move from strlcpy with unused retval to strscpy 2022-08-18 15:44:08 -07:00
wacom_i2c.c
wacom_w8001.c Input: move from strlcpy with unused retval to strscpy 2022-08-18 15:44:08 -07:00
wdt87xx_i2c.c
wm97xx-core.c Merge branch 'next' into for-linus 2022-08-02 10:06:12 -07:00
wm831x-ts.c
wm9705.c
wm9712.c
wm9713.c
zet6223.c
zforce_ts.c
zinitix.c
zylonite-wm97xx.c