kernel_samsung_a53x/drivers/iio/adc
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
..
ab8500-gpadc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad799x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7091r-base.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7091r-base.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7091r5.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7124.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7192.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7266.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7291.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7292.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7298.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7476.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7606.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7606.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7606_par.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7606_spi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7766.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7768-1.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7780.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7791.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7793.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7887.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7923.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad7949.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad9467.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ad_sigma_delta.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
adi-axi-adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
aspeed_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
at91-sama5d2_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
at91_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
axp20x_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
axp288_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bcm_iproc_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
berlin2-adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cc10001_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpcap-adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
da9150-gpadc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dln2-adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
envelope-detector.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ep93xx_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
exynos_adc.c iio: exynos-adc: request second interupt only when touchscreen mode is used 2024-11-18 10:58:30 +01:00
fsl-imx25-gcq.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hi8435.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hx711.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
imx7d_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ina2xx-adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ingenic-adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
intel_mrfld_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lp8788_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lpc18xx_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lpc32xx_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ltc2471.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ltc2485.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ltc2496.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ltc2497-core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ltc2497.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ltc2497.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
max1027.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
max1118.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
max1241.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
max1363.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
max9611.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
max11100.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mcp320x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mcp3422.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mcp3911.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
men_z188_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
meson_saradc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mp2629_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mt6577_auxadc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mxs-lradc-adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nau7802.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
npcm_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
palmas_gpadc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qcom-pm8xxx-xoadc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qcom-spmi-adc5.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qcom-spmi-iadc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qcom-spmi-vadc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qcom-vadc-common.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qcom-vadc-common.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rcar-gyroadc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rn5t618-adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rockchip_saradc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
s2mps23_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
s2mps25_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
s2mpu13_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sc27xx_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sd_adc_modulator.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
spear_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stm32-adc-core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stm32-adc-core.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stm32-adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stm32-dfsdm-adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stm32-dfsdm-core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stm32-dfsdm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stmpe-adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stx104.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sun4i-gpadc-iio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti-adc081c.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti-adc084s021.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti-adc108s102.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti-adc128s052.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti-adc161s626.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti-adc0832.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti-adc12138.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti-ads124s08.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti-ads1015.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti-ads7950.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti-ads8344.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti-ads8688.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti-tlc4541.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ti_am335x_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
twl4030-madc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
twl6030-gpadc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vf610_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
viperboard_adc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xilinx-xadc-core.c iio: adc: xilinx-xadc: Don't clobber preset voltage/temperature thresholds 2024-11-18 10:58:32 +01:00
xilinx-xadc-events.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xilinx-xadc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00