devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] thermal: thermal-generic-adc: add temp sensor function
@ 2025-03-10  7:56 Svyatoslav Ryhel
  2025-03-10  7:56 ` [PATCH v4 1/2] dt-bindings: thermal: generic-adc: Add optional io-channel-cells property Svyatoslav Ryhel
  2025-03-10  7:56 ` [PATCH v4 2/2] thermal: thermal-generic-adc: add temperature sensor channel Svyatoslav Ryhel
  0 siblings, 2 replies; 11+ messages in thread
From: Svyatoslav Ryhel @ 2025-03-10  7:56 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Laxman Dewangan,
	Svyatoslav Ryhel
  Cc: linux-pm, devicetree, linux-kernel

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-04-14 18:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-10  7:56 [PATCH v4 0/2] thermal: thermal-generic-adc: add temp sensor function Svyatoslav Ryhel
2025-03-10  7:56 ` [PATCH v4 1/2] dt-bindings: thermal: generic-adc: Add optional io-channel-cells property Svyatoslav Ryhel
2025-03-11  8:20   ` Krzysztof Kozlowski
2025-03-11  8:30     ` Svyatoslav Ryhel
2025-03-10  7:56 ` [PATCH v4 2/2] thermal: thermal-generic-adc: add temperature sensor channel Svyatoslav Ryhel
2025-04-05 15:23   ` Svyatoslav Ryhel
2025-04-12 10:53     ` Jonathan Cameron
2025-04-12 11:06       ` Svyatoslav Ryhel
2025-04-13  9:28         ` Jonathan Cameron
2025-04-13  9:42           ` Svyatoslav Ryhel
2025-04-14 18:35             ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).