public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Liviu Stan <liviu.stan@analog.com>
Cc: "Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983
Date: Tue, 28 Apr 2026 15:58:19 +0100	[thread overview]
Message-ID: <20260428155819.3b56a3fa@jic23-huawei> (raw)
In-Reply-To: <20260427132526.272716-2-liviu.stan@analog.com>

On Mon, 27 Apr 2026 16:25:07 +0300
Liviu Stan <liviu.stan@analog.com> wrote:

> The ADT7604 shares the same die as the LTC2984. It repurposes the
> custom RTD sensor type (18) as a copper trace resistance sensor
> and the custom thermistor type (27) as a leak detector, and
> removes thermocouple, diode and direct ADC sensor types.
> 
> Add adi,adt7604 to the compatible list and introduce two new
> sensor node types specific to this device:
> 
> - copper-trace@: maps to the custom RTD sensor type (18). Two
>   variants: sub-ohm (< 1 ohm, adi,copper-trace-sub-ohm boolean,
>   no custom table) and standard (> 1 ohm, optional adi,custom-rtd
>   table). Primary output is resistance in mOhm.

I don't know much about these temp sensors, but how is this different
in practice from a 2-wire RTD?  Obviously one is copper and the other
probably much more precise platinum but does that matter to us?

> 
> - leak-detector@: maps to the custom thermistor sensor type (27).
>   Takes an optional adi,custom-leak-detector lookup table encoding
>   resistance (uOhm) against coverage data (P + 273.15 in uK).
>   Primary output is resistance in Ohm; when a table is provided,
>   IIO_TEMP reports coverage percentage (raw / 1024).
> 
> allOf conditions are added to restrict thermocouple, diode, direct
> ADC and active temperature nodes to non-ADT7604 devices, and to
> restrict copper-trace and leak-detector nodes to the ADT7604.
> 
> Signed-off-by: Liviu Stan <liviu.stan@analog.com>
> ---
>  .../bindings/iio/temperature/adi,ltc2983.yaml | 170 +++++++++++++++++-
>  1 file changed, 167 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml
> index a22725f7619b..e777b37d588d 100644
> --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml
> +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml
> @@ -4,14 +4,14 @@
>  $id: http://devicetree.org/schemas/iio/temperature/adi,ltc2983.yaml#
>  $schema: http://devicetree.org/meta-schemas/core.yaml#
>  
> -title: Analog Devices LTC2983, LTC2986, LTM2985 Multi-sensor Temperature system
> +title: Analog Devices LTC2983, LTC2986, LTM2985, ADT7604 Multi-sensor Temperature system
I'd go with "LTC2983 and similar" for the title now as it's
to long. Leave the description to list amount more info.

>  
>  maintainers:
>    - Nuno Sá <nuno.sa@analog.com>
>  
>  description: |
> -  Analog Devices LTC2983, LTC2984, LTC2986, LTM2985 Multi-Sensor Digital
> -  Temperature Measurement Systems
> +  Analog Devices LTC2983, LTC2984, LTC2986, LTM2985, ADT7604 Multi-Sensor
Alphabetical order and it might be worth thinking about switching this
to a bulleted list with one device per line as it'll make adding new ones
neater. (obviously they are already not in numeric order, so fix that too ;)


> +  Digital Temperature Measurement Systems
>  
>    https://www.analog.com/media/en/technical-documentation/data-sheets/2983fc.pdf
>    https://www.analog.com/media/en/technical-documentation/data-sheets/2984fb.pdf
> @@ -43,6 +43,7 @@ properties:
>    compatible:
>      oneOf:
>        - enum:
> +          - adi,adt7604
>            - adi,ltc2983
>            - adi,ltc2986
>            - adi,ltm2985
> @@ -436,6 +437,96 @@ patternProperties:
>      required:
>        - adi,custom-temp
>  
> +  '^copper-trace@':
> +    $ref: '#/$defs/sensor-node'
> +    unevaluatedProperties: false
> +    description: |
> +      Copper trace resistance sensor (ADT7604 only). Uses the custom RTD
> +      sensor type (18). Two variants exist: sub-ohm (< 1 ohm, no custom
> +      table allowed) and standard (> 1 ohm, optional custom table).
> +
> +    properties:
> +      reg:
> +        minimum: 2
> +        maximum: 20
> +
> +      adi,sensor-type:
> +        description: Sensor type for copper trace sensors.
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        const: 18
> +
> +      adi,rsense-handle:
> +        description: Associated sense resistor sensor.
> +        $ref: /schemas/types.yaml#/definitions/phandle
> +
> +      adi,copper-trace-sub-ohm:
> +        description:
> +          Select the sub-ohm (< 1 ohm) copper trace variant. Custom table
> +          and excitation current are not allowed in this mode.

Is the absences of them enough to indicate this mode?  I.e. are there other modes
with no specified excitation mode or custom rtd table?

I'm trying to work out if we can map this to the existing binding for
custom rtd just be adding more constraints + making existing ones more specific.

I don't mind if we can't and have to add a new child node definition but
I'm not yet sure that's the case.

> +        type: boolean
> +
> +      adi,custom-rtd:
> +        description:
> +          Optional resistance-to-temperature table for copper trace sensors
> +          with resistance > 1 ohm. See Page 62 of the datasheet.
> +        $ref: /schemas/types.yaml#/definitions/uint64-matrix
> +        minItems: 3
> +        maxItems: 64
> +        items:
> +          items:
> +            - description: Resistance point in uOhms.
> +            - description: Temperature point in uK.
> +
> +    required:
> +      - adi,rsense-handle
> +
> +    allOf:
> +      - if:
> +          required:
> +            - adi,copper-trace-sub-ohm
> +        then:
> +          properties:
> +            adi,custom-rtd: false
> +
> +  '^leak-detector@':

This feels more different so I don't so I'm fine with this being a separate thing.

> +    $ref: '#/$defs/sensor-node'
> +    unevaluatedProperties: false
> +    description: |
> +      Leak detector sensor (ADT7604 only). Uses the custom thermistor sensor

I'd avoid describing things as xx only as that tends to become wrong fast!
Better to put that as a conditional only (as you have below)
Maybe here you can say, (some parts only) or something like that.

> +      type (27). Outputs resistance in ohms and, when a custom table is
> +      provided, a coverage percentage via IIO_TEMP (raw/1024 = coverage %).
> +
> +    properties:
> +      reg:
> +        minimum: 2
> +        maximum: 20
> +
> +      adi,sensor-type:
> +        description: Sensor type for leak detector sensors.
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        const: 27
> +
> +      adi,rsense-handle:
> +        description: Associated sense resistor sensor.
> +        $ref: /schemas/types.yaml#/definitions/phandle
> +
> +      adi,custom-leak-detector:
> +        description: |
> +          Lookup table mapping resistance to coverage data. Entries must be
> +          in ascending resistance order. The coverage data field encodes the
> +          coverage percentage P as (P + 273.15) expressed in uK, i.e.
> +          (P * 1000000 + 273150000).
> +        $ref: /schemas/types.yaml#/definitions/uint64-matrix
> +        minItems: 3
> +        maxItems: 64
> +        items:
> +          items:
> +            - description: Resistance point in uOhms.
> +            - description: Coverage data point (P + 273150000) in uK.
> +
> +    required:
> +      - adi,rsense-handle
> +
>    '^rsense@':
>      $ref: '#/$defs/sensor-node'
>      unevaluatedProperties: false
> @@ -477,6 +568,22 @@ allOf:
>        patternProperties:
>          '^temp@': false
>  
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: adi,adt7604
> +    then:
> +      patternProperties:
> +        '^thermocouple@': false
> +        '^diode@': false
> +        '^adc@': false
> +        '^temp@': false
> +    else:
> +      patternProperties:
> +        '^copper-trace@': false
> +        '^leak-detector@': false


  parent reply	other threads:[~2026-04-28 14:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27 13:25 [PATCH 0/2] iio: temperature: ltc2983: Add support for ADT7604 Liviu Stan
2026-04-27 13:25 ` [PATCH 1/2] dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983 Liviu Stan
2026-04-27 19:34   ` Conor Dooley
2026-04-28 14:58   ` Jonathan Cameron [this message]
2026-04-27 13:25 ` [PATCH 2/2] iio: temperature: ltc2983: Add support for ADT7604 Liviu Stan
2026-04-27 18:23   ` Andy Shevchenko
2026-04-28 11:14   ` Nuno Sá

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=20260428155819.3b56a3fa@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liviu.stan@analog.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