linux-stable/drivers/iio
Fabrice Gasnier 7243aa7150 iio: adc: stm32: fix a current leak by resetting pcsel before disabling vdda
commit f711f28e71 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 iio:chemical:ccs811: Fix timestamp alignment and prevent data leak. 2020-09-17 13:47:51 +02:00
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 iio:health:afe4404 Fix timestamp alignment and prevent data leak. 2020-07-22 09:33:00 +02:00
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 iio: magn: bmc150: Balance runtime pm + use pm_runtime_resume_and_get() 2021-07-20 16:10:41 +02:00
multiplexer
orientation
potentiometer
potentiostat iio: potentiostat: lmp91000: Fix alignment of buffer in iio_push_to_buffers_with_timestamp() 2021-07-14 16:53:39 +02:00
pressure iio:pressure:mpl3115: Force alignment of buffer 2020-12-30 11:51:44 +01:00
proximity iio: prox: isl29501: Fix buffer alignment in iio_push_to_buffers_with_timestamp() 2021-07-14 16:53:45 +02:00
resolver
temperature iio: hid-sensor-temperature: Fix issues of timestamp channel 2021-03-24 11:26:43 +01:00
trigger iio: trigger: stm32-timer: fix MODULE_ALIAS 2021-12-14 14:49:05 +01:00
iio_core.h
iio_core_trigger.h
industrialio-buffer.c iio: buffer: Fix demux update 2020-12-30 11:51:44 +01:00
industrialio-configfs.c
industrialio-core.c iio: core: add missing IIO_MOD_H2/ETHANOL string identifiers 2020-07-22 09:32:54 +02:00
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