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)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 13 Oct 2023 18:10:39 +0000 (19:10 +0100)
commite2bd8c28b9bd835077eb65715d416d667694a80d
tree4bdfaf822e57daaff34f2cb3cf5a77171f00b2e3
parent8d6b3ea4d9eaca80982442b68a292ce50ce0a135
iio: adc: xilinx-xadc: Correct temperature offset/scale for UltraScale

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>
drivers/iio/adc/xilinx-xadc-core.c
drivers/iio/adc/xilinx-xadc.h