diff options
author | Robert Hancock <robert.hancock@calian.com> | 2023-09-15 03:10:19 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2023-10-13 21:10:39 +0300 |
commit | e2bd8c28b9bd835077eb65715d416d667694a80d (patch) | |
tree | 4bdfaf822e57daaff34f2cb3cf5a77171f00b2e3 /drivers/iio/adc/xilinx-xadc.h | |
parent | 8d6b3ea4d9eaca80982442b68a292ce50ce0a135 (diff) | |
download | linux-e2bd8c28b9bd835077eb65715d416d667694a80d.tar.xz |
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>
Diffstat (limited to 'drivers/iio/adc/xilinx-xadc.h')
-rw-r--r-- | drivers/iio/adc/xilinx-xadc.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iio/adc/xilinx-xadc.h b/drivers/iio/adc/xilinx-xadc.h index 7d78ce698967..3036f4d613ff 100644 --- a/drivers/iio/adc/xilinx-xadc.h +++ b/drivers/iio/adc/xilinx-xadc.h @@ -85,6 +85,8 @@ struct xadc_ops { unsigned int flags; enum xadc_type type; + int temp_scale; + int temp_offset; }; static inline int _xadc_read_adc_reg(struct xadc *xadc, unsigned int reg, |