[PATCH v4 0/2] thermal: thermal-generic-adc: add temp sensor function
From: Svyatoslav Ryhel
Date: Mon Mar 10 2025 - 03:57:37 EST
To avoid duplicating sensor functionality and conversion tables, this
design allows converting an ADC IIO channel's output directly into a
temperature IIO channel. This is particularly useful for devices where
hwmon isn't suitable or where temperature data must be accessible through
IIO.
One such device is, for example, the MAX17040 fuel gauge.
The temperature data, while technically a product of conversion and thus
categorized as IIO_CHAN_INFO_PROCESSED, maintains its unscaled state
(milli-degree). To account for this, IIO_CHAN_INFO_RAW is used along with
IIO_CHAN_INFO_SCALE to provide different degrees of accuracy.
---
Changes on switching from v3 to v4:
- switch to use of RAW and SCALED channels to provide more accurate data
Changes on switching from v2 to v3:
- rephrased commit headers
Changes on switching from v1 to v2:
- documented #iio-channel-cells property
- switched to IIO_CHAN_INFO_PROCESSED
---
Svyatoslav Ryhel (2):
dt-bindings: thermal: generic-adc: Add optional io-channel-cells
property
thermal: thermal-generic-adc: add temperature sensor channel
.../bindings/thermal/generic-adc-thermal.yaml | 4 ++
drivers/thermal/thermal-generic-adc.c | 62 ++++++++++++++++++-
2 files changed, 65 insertions(+), 1 deletion(-)
--
2.43.0