Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Liviu Stan" <liviu.stan@analog.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v4 8/9] dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983
Date: Mon, 25 May 2026 18:28:51 +0000	[thread overview]
Message-ID: <20260525182851.CEE9C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260525164013.118614-9-liviu.stan@analog.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The `default: 1000` value on `adi,excitation-current-microamp` conflicts with its conditional `false` constraint, breaking schema validation for sub-ohm copper-trace nodes.
- [Medium] The device tree binding introduces artificial/virtual sensor types (32 and 33) instead of using the hardware's actual register values (18 and 27) for copper trace and leak detector sensors.
--

commit 6b6588f2ffbcb416f3ba3df38f643fdd0a5c9afa
Author: Liviu Stan <liviu.stan@analog.com>

dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983

This commit adds support for the ADT7604 to the adi,ltc2983 binding. It
introduces new sensor node types for copper-trace and leak-detector sensors
which repurpose custom RTD and thermistor types on the hardware, and adds
validation constraints specific to the ADT7604.

> diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml
> index a22725f7619b7..ab77f987ee02d 100644
> --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml
> +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml

[ ... ]

> @@ -436,6 +441,121 @@ patternProperties:
>      required:
>        - adi,custom-temp
>  
> +  '^copper-trace@':
> +    $ref: '#/$defs/sensor-node'
> +    unevaluatedProperties: false
> +    description: |
> +      Copper trace resistance sensor (some parts only). Two variants exist:
> +      sub-ohm (< 1 ohm, no custom table allowed) and standard (> 1 ohm,
> +      required 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: 32

[Severity: Medium]
Does defining a virtual sensor type (32) conflict with the device tree
principle of describing physical hardware rather than software abstractions?

As noted in the commit message, the hardware repurposes the custom RTD
register value (18) for this sensor. Should the binding use the real
hardware value (<18>) and rely on the node name to distinguish the
configuration instead of extending this property with software-defined values?

> +
> +      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.
> +        type: boolean
> +
> +      adi,excitation-current-microamp:
> +        description:
> +          Excitation current applied to the copper trace. Not used in
> +          sub-ohm mode. The datasheet recommends 1mA for copper trace
> +          sensors due to their typically small resistance.
> +        enum: [5, 10, 25, 50, 100, 250, 500, 1000]
> +        default: 1000
> +
> +      adi,custom-copper-trace:
> +        description:
> +          Resistance-to-temperature table for copper trace sensors with
> +          resistance > 1 ohm. Required when adi,copper-trace-sub-ohm is not
> +          set. See Page 36 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-copper-trace: false
> +            adi,excitation-current-microamp: false

[Severity: High]
Will the default value defined above break schema validation for sub-ohm
copper-trace nodes?

dt-schema injects default values for missing properties before evaluating
conditionals. If a sub-ohm node correctly omits the
adi,excitation-current-microamp property, the value 1000 will be injected
automatically. This injected property would then trigger a validation failure
against the false constraint here.

> +      - if:
> +          not:
> +            required:
> +              - adi,copper-trace-sub-ohm
> +        then:
> +          required:
> +            - adi,custom-copper-trace
> +
> +  '^leak-detector@':
> +    $ref: '#/$defs/sensor-node'
> +    unevaluatedProperties: false
> +    description: |
> +      Leak detector sensor (some parts only). Outputs resistance in ohms and
> +      a coverage percentage via IIO_COVERAGE (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: 33

[Severity: Medium]
Similarly to the copper trace sensor, could this be using the actual hardware
register value (<27>) instead of the software-defined value 33?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260525164013.118614-1-liviu.stan@analog.com?part=8

  reply	other threads:[~2026-05-25 18:28 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25 16:39 [PATCH v4 0/9] iio: temperature: ltc2983: Add support for ADT7604 Liviu Stan
2026-05-25 16:39 ` [PATCH v4 1/9] iio: temperature: ltc2983: Fix n_wires default bypassing rotation check Liviu Stan
2026-05-27 16:11   ` Jonathan Cameron
2026-05-25 16:39 ` [PATCH v4 2/9] iio: temperature: ltc2983: Fix reinit_completion() called after conversion start Liviu Stan
2026-05-27 16:13   ` Jonathan Cameron
2026-05-25 16:39 ` [PATCH v4 3/9] iio: temperature: ltc2983: Fix macro parenthesization and rename Liviu Stan
2026-05-27 16:13   ` Jonathan Cameron
2026-05-25 16:39 ` [PATCH v4 4/9] iio: temperature: ltc2983: Use local device pointer consistently Liviu Stan
2026-05-27 16:18   ` Jonathan Cameron
2026-06-02 23:25     ` Andy Shevchenko
2026-06-03 14:08       ` Jonathan Cameron
2026-05-25 16:39 ` [PATCH v4 5/9] iio: temperature: ltc2983: Fix inconsistent channel wording in messages Liviu Stan
2026-05-27 16:19   ` Jonathan Cameron
2026-05-25 16:39 ` [PATCH v4 6/9] iio: temperature: ltc2983: Use fwnode_property_present() for optional properties Liviu Stan
2026-05-27 16:19   ` Jonathan Cameron
2026-06-02 23:26     ` Andy Shevchenko
2026-06-03 14:01       ` Jonathan Cameron
2026-05-25 16:39 ` [PATCH v4 7/9] iio: core: Add IIO_COVERAGE channel type Liviu Stan
2026-05-27 16:51   ` Jonathan Cameron
2026-05-25 16:39 ` [PATCH v4 8/9] dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983 Liviu Stan
2026-05-25 18:28   ` sashiko-bot [this message]
2026-05-26 16:55   ` Conor Dooley
2026-05-27 15:59     ` Liviu Stan
2026-05-27 16:51     ` Jonathan Cameron
2026-05-25 16:39 ` [PATCH v4 9/9] iio: temperature: ltc2983: Add support for ADT7604 Liviu Stan
2026-05-25 19:06   ` sashiko-bot
2026-05-26  8:47   ` Liviu Stan
2026-05-27 16:49     ` Jonathan Cameron
2026-06-02  6:38       ` Liviu Stan

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=20260525182851.CEE9C1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=liviu.stan@analog.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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