Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gerard Marull-Paretas <gerard@teslabs.com>
To: jic23@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, mcoquelin.stm32@gmail.com,
	alexandre.torgue@foss.st.com
Cc: fabrice.gasnier@foss.st.com, dlechner@baylibre.com,
	nuno.sa@analog.com, andy@kernel.org, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] dt-bindings: iio: adc: st,stm32-adc: add temperature sensor calibration cells
Date: Thu,  3 Dec 2026 17:52:14 +0100	[thread overview]
Message-ID: <20261203165214.54424-1-gerard@teslabs.com> (raw)

The internal temperature sensor of the STM32H7, STM32MP13 and STM32MP15
ADCs is calibrated in the factory at two temperatures, and its
calibration data (TS_CAL1 and TS_CAL2) is stored in a read-only area,
along with the internal voltage reference calibration (VREFINT_CAL).

Only the vrefint calibration can be passed to an ADC today. Allow the
two temperature sensor calibration points to be passed as nvmem cells as
well, so the ADC the temperature sensor is connected to can convert its
readings.

No Linux driver reads these cells yet: on the STM32MP1, the dedicated
digital temperature sensor is used for thermal protection instead, and
the STM32H7 device trees are deprecated. The binding is also used to
describe these SoCs outside Linux, though: PebbleOS describes the
STM32H747 with it and reads the temperature sensor through the ADC
using these cells.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
---
Changes in v2:
- Drop the stm32h743.dtsi patch, the STM32H7 device trees being deprecated
- Name the SoCs with the calibration rather than the ADC3 connection
- Add background on the users of the cells
- Link to v1: https://lore.kernel.org/r/20261124202220.23721-1-gerard@teslabs.com

 .../devicetree/bindings/iio/adc/st,stm32-adc.yaml      | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml b/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml
index c4c4575d3fa9..9fe41b89982e 100644
--- a/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml
@@ -337,12 +337,22 @@ patternProperties:
         deprecated: true
 
       nvmem-cells:
+        minItems: 1
         items:
           - description: Phandle to the calibration vrefint data provided by otp
+          - description:
+              Temperature sensor calibration data at the first calibration
+              temperature (TS_CAL1)
+          - description:
+              Temperature sensor calibration data at the second calibration
+              temperature (TS_CAL2)
 
       nvmem-cell-names:
+        minItems: 1
         items:
           - const: vrefint
+          - const: ts-cal1
+          - const: ts-cal2
 
     patternProperties:
       "^channel@([0-9]|1[0-9])$":

base-commit: 8d7fe9885c62fc9a95bf55d9db244d9672a8aadc
-- 
2.45.2



                 reply	other threads:[~2026-12-03 16:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261203165214.54424-1-gerard@teslabs.com \
    --to=gerard@teslabs.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=fabrice.gasnier@foss.st.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox