Skip to content
Commit f763aa29 authored by Robert Hancock's avatar Robert Hancock Committed by Greg Kroah-Hartman
Browse files

iio: adc: xilinx-xadc: Don't clobber preset voltage/temperature thresholds

commit 8d6b3ea4 upstream.

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: bdc8cda1

 ("iio:adc: Add Xilinx XADC driver")
Signed-off-by: default avatarRobert Hancock <robert.hancock@calian.com>
Acked-by: default avatarO'Griofa, Conall <conall.ogriofa@amd.com>
Tested-by: default avatarO'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: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f2bd3c00
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment