kernel_samsung_a53x/drivers/iio
Robert Hancock 956adc7db7 iio: adc: xilinx-xadc: Don't clobber preset voltage/temperature thresholds
[ Upstream commit 8d6b3ea4d9eaca80982442b68a292ce50ce0a135 ]

In the probe function, the driver was reading out the thresholds already
set in the core, which can be configured by the user in the Vivado tools
when the FPGA image is built. However, it later clobbered those values
with zero or maximum values. In particular, the overtemperature shutdown
threshold register was overwritten with the max value, which effectively
prevents the FPGA from shutting down when the desired threshold was
eached, potentially risking hardware damage in that case.

Remove this code to leave the preconfigured default threshold values
intact.

The code was also disabling all alarms regardless of what enable state
they were left in by the FPGA image, including the overtemperature
shutdown feature. Leave these bits in their original state so they are
not unconditionally disabled.

Fixes: bdc8cda1d010 ("iio:adc: Add Xilinx XADC driver")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Acked-by: O'Griofa, Conall <conall.ogriofa@amd.com>
Tested-by: O'Griofa, Conall <conall.ogriofa@amd.com>
Link: https://lore.kernel.org/r/20230915001019.2862964-2-robert.hancock@calian.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 10:58:32 +01:00
..
accel Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
adc iio: adc: xilinx-xadc: Don't clobber preset voltage/temperature thresholds 2024-11-18 10:58:32 +01:00
addac Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
afe Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
amplifiers Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
buffer Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
chemical Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
common Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dac Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dummy Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
frequency Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
gyro Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
health Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
humidity Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
imu Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
light Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
magnetometer Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
multiplexer Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
orientation Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
position Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
potentiometer Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
potentiostat Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pressure iio: pressure: ms5611: ms5611_prom_is_valid false negative bug 2024-11-08 11:25:49 +01:00
proximity Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
resolver Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
temperature Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trigger Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
iio_core.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
iio_core_trigger.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
industrialio-buffer.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
industrialio-configfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
industrialio-core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
industrialio-event.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
industrialio-sw-device.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
industrialio-sw-trigger.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
industrialio-trigger.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
industrialio-triggered-event.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
inkern.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
TODO Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00