linux-stable/drivers/input
Douglas Anderson 3afd738e77 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>
2023-01-14 10:15:30 +01:00
..
gameport
joystick Input: joystick - fix Kconfig warning for JOYSTICK_ADC 2023-01-14 10:15:28 +01:00
keyboard Input: snvs_pwrkey - fix SNVS_HPVIDR1 register address 2022-10-05 10:38:38 +02:00
misc Input: soc_button_array - add Acer Switch V 10 to dmi_use_low_level_irq[] 2022-12-02 17:40:05 +01:00
mouse Input: synaptics - switch touchpad on HP Laptop 15-da3001TU to RMI mode 2022-12-02 17:40:04 +01:00
rmi4
serio Input: i8042 - fix leaking of platform device on module removal 2022-11-25 17:45:55 +01:00
tablet Input: aiptek - properly check endpoint type 2022-03-23 09:13:29 +01:00
touchscreen Input: elants_i2c - properly handle the reset GPIO when power is off 2023-01-14 10:15:30 +01:00
apm-power.c
evbug.c
evdev.c
ff-core.c
ff-memless.c
input-compat.c
input-compat.h
input-leds.c
input-mt.c
input-polldev.c
input-poller.c
input-poller.h
input.c Input: add bounds checking to input_set_capability() 2022-05-25 09:17:52 +02:00
joydev.c
Kconfig
Makefile
matrix-keymap.c
mousedev.c
sparse-keymap.c