android_kernel_xiaomi_sm8350/drivers/iio
Fabrice Gasnier 7243aa7150 iio: adc: stm32: fix a current leak by resetting pcsel before disabling vdda
commit f711f28e71e965c0d1141c830fa7131b41abbe75 upstream.

Some I/Os are connected to ADC input channels, when the corresponding bit
in PCSEL register are set on STM32H7 and STM32MP15. This is done in the
prepare routine of stm32-adc driver.
There are constraints here, as PCSEL shouldn't be set when VDDA supply
is disabled. Enabling/disabling of VDDA supply in done via stm32-adc-core
runtime PM routines (before/after ADC is enabled/disabled).

Currently, PCSEL remains set when disabling ADC. Later on, PM runtime
can disable the VDDA supply. This creates some conditions on I/Os that
can start to leak current.
So PCSEL needs to be cleared when disabling the ADC.

Fixes: 95e339b6e8 ("iio: adc: stm32: add support for STM32H7")
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Reviewed-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/1634905169-23762-1-git-send-email-fabrice.gasnier@foss.st.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-22 09:29:35 +01:00
..
accel iio: accel: kxcjk-1013: Fix possible memory leak in probe and remove 2021-12-14 14:49:06 +01:00
adc iio: adc: stm32: fix a current leak by resetting pcsel before disabling vdda 2021-12-22 09:29:35 +01:00
afe
amplifiers
buffer
chemical
common iio: ssp_sensors: fix error code in ssp_print_mcu_debug() 2021-10-20 11:40:15 +02:00
dac iio: dac: ad5446: Fix ad5622_write() return value 2021-11-17 09:48:26 +01:00
dummy
frequency
gyro iio: itg3200: Call iio_trigger_notify_done() on error 2021-12-14 14:49:05 +01:00
health
humidity iio: humidity: hdc100x: Add margin to the conversion time 2021-08-18 08:56:56 +02:00
imu iio: imu: st_lsm6dsx: Avoid potential array overflow in st_lsm6dsx_set_odr() 2021-11-26 10:47:16 +01:00
light iio: ltr501: Don't return error code in trigger handler 2021-12-14 14:49:05 +01:00
magnetometer
multiplexer
orientation
potentiometer
potentiostat
pressure
proximity
resolver
temperature
trigger iio: trigger: stm32-timer: fix MODULE_ALIAS 2021-12-14 14:49:05 +01:00
iio_core_trigger.h
iio_core.h
industrialio-buffer.c
industrialio-configfs.c
industrialio-core.c
industrialio-event.c
industrialio-sw-device.c
industrialio-sw-trigger.c
industrialio-trigger.c iio: trigger: Fix reference counting 2021-12-14 14:49:05 +01:00
industrialio-triggered-event.c
inkern.c
Kconfig
Makefile