]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: adc: xilinx-xadc: Correct temperature offset/scale for UltraScale
authorRobert Hancock <robert.hancock@calian.com>
Fri, 15 Sep 2023 00:10:19 +0000 (18:10 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Nov 2023 16:26:40 +0000 (17:26 +0100)
commiteace761f35a1db9a776a27af3928cd2b177d1f1c
tree889f141a3e9ae9f6da07948d2f37f381857d31f1
parent70322a446ef2cf518091f8b05eda34bc24597ca8
iio: adc: xilinx-xadc: Correct temperature offset/scale for UltraScale

commit e2bd8c28b9bd835077eb65715d416d667694a80d upstream.

The driver was previously using offset and scale values for the
temperature sensor readings which were only valid for 7-series devices.
Add per-device-type values for offset and scale and set them appropriately
for each device type.

Note that the values used for the UltraScale family are for UltraScale+
(i.e. the SYSMONE4 primitive) using the internal reference, as that seems
to be the most common configuration and the device tree values Xilinx's
device tree generator produces don't seem to give us anything to tell us
which configuration is used. However, the differences within the UltraScale
family seem fairly minor and it's closer than using the 7-series values
instead in any case.

Fixes: c2b7720a7905 ("iio: xilinx-xadc: Add basic support for Ultrascale System Monitor")
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-3-robert.hancock@calian.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/xilinx-xadc-core.c
drivers/iio/adc/xilinx-xadc.h