* Re: [PATCH v3 7/8] dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983
[not found] <20260521182308.4E2731F000E9@smtp.kernel.org>
@ 2026-05-22 11:42 ` Liviu Stan
2026-05-22 13:17 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Liviu Stan @ 2026-05-22 11:42 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Michael Hennerich, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Antoniu Miclaus, Liviu Stan,
Francesco Lavra, linux-iio, linux-kernel, linux, devicetree
On Thu, 21 May 2026 18:23:07 +0000 sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
> - [Low] The new compatible string 'adi,adt7604' is omitted from the existing conditional block that disables '^temp@' nodes, violating subsystem guidelines.
> - [Low] The schema allows invalid 'adi,sensor-type' values in '^rtd@' and '^thermistor@' nodes for the ADT7604.
> --
>
> commit fbbcd3bcbfbb106e48a6545868dd2b27a56b39b5
> 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 LTC2983 binding schema. It
> introduces the adi,adt7604 compatible string and adds two new sensor node
> types: copper-trace@ and leak-detector@. It also adds conditional checks to
> restrict unsupported nodes for the ADT7604 device.
>
> > diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml
> > index a22725f7619b7..14cfa28809edd 100644
> > --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml
> > +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml
> [ ... ]
> > @@ -477,6 +597,22 @@ allOf:
> > patternProperties:
> > '^temp@': false
> >
> > + - if:
> > + properties:
> > + compatible:
> > + contains:
> > + const: adi,adt7604
> > + then:
> > + patternProperties:
> > + '^thermocouple@': false
> > + '^diode@': false
> > + '^adc@': false
> > + '^temp@': false
>
> [Severity: Low]
> Since ADT7604 shares the ^temp@: false constraint with the existing devices,
> should adi,adt7604 be added to the existing compatible enum block instead of
> duplicating the ^temp@ restriction in this new conditional?
I think keeping all ADT7604 related constraints in one block is more readable.
For the block above it's different because ltc2984 and ltc2983 share the same
constraints.
>
> [Severity: Low]
> The commit message mentions that ADT7604 repurposes the custom RTD sensor type
> (18) and custom thermistor type (27).
>
> However, the schema doesn't restrict adi,sensor-type = <18> inside ^rtd@ nodes
> or adi,sensor-type = <27> inside ^thermistor@ nodes for the adi,adt7604
> compatible.
>
> Should these restrictions be added to this block to prevent invalid device
> tree configurations from passing validation?
>
This makes sense, we could restrict sensor type 18 and 27 for the ADT7604, even
though the driver's supported_sensors bitmask already rejects them.
I could add something like:
- if:
properties:
compatible:
contains:
const: adi,adt7604
then:
patternProperties:
'^thermocouple@': false
'^diode@': false
'^adc@': false
'^temp@': false
'^rtd@':
properties:
adi,sensor-type:
not:
const: 18
'^thermistor@':
properties:
adi,sensor-type:
not:
const: 27
What do you think?
Thanks,
Liviu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3 7/8] dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983
2026-05-22 11:42 ` [PATCH v3 7/8] dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983 Liviu Stan
@ 2026-05-22 13:17 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2026-05-22 13:17 UTC (permalink / raw)
To: Liviu Stan
Cc: David Lechner, Nuno Sá,
Andy Shevchenko, Michael Hennerich, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Antoniu Miclaus,
Francesco Lavra, linux-iio, linux-kernel, linux, devicetree
On Fri, 22 May 2026 14:42:53 +0300
Liviu Stan <liviu.stan@analog.com> wrote:
> On Thu, 21 May 2026 18:23:07 +0000 sashiko-bot@kernel.org wrote:
>
> > Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
> > - [Low] The new compatible string 'adi,adt7604' is omitted from the existing conditional block that disables '^temp@' nodes, violating subsystem guidelines.
> > - [Low] The schema allows invalid 'adi,sensor-type' values in '^rtd@' and '^thermistor@' nodes for the ADT7604.
> > --
> >
> > commit fbbcd3bcbfbb106e48a6545868dd2b27a56b39b5
> > 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 LTC2983 binding schema. It
> > introduces the adi,adt7604 compatible string and adds two new sensor node
> > types: copper-trace@ and leak-detector@. It also adds conditional checks to
> > restrict unsupported nodes for the ADT7604 device.
> >
> > > diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml
> > > index a22725f7619b7..14cfa28809edd 100644
> > > --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml
> > > +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml
> > [ ... ]
> > > @@ -477,6 +597,22 @@ allOf:
> > > patternProperties:
> > > '^temp@': false
> > >
> > > + - if:
> > > + properties:
> > > + compatible:
> > > + contains:
> > > + const: adi,adt7604
> > > + then:
> > > + patternProperties:
> > > + '^thermocouple@': false
> > > + '^diode@': false
> > > + '^adc@': false
> > > + '^temp@': false
> >
> > [Severity: Low]
> > Since ADT7604 shares the ^temp@: false constraint with the existing devices,
> > should adi,adt7604 be added to the existing compatible enum block instead of
> > duplicating the ^temp@ restriction in this new conditional?
>
> I think keeping all ADT7604 related constraints in one block is more readable.
> For the block above it's different because ltc2984 and ltc2983 share the same
> constraints.
Agreed
>
> >
> > [Severity: Low]
> > The commit message mentions that ADT7604 repurposes the custom RTD sensor type
> > (18) and custom thermistor type (27).
> >
> > However, the schema doesn't restrict adi,sensor-type = <18> inside ^rtd@ nodes
> > or adi,sensor-type = <27> inside ^thermistor@ nodes for the adi,adt7604
> > compatible.
> >
> > Should these restrictions be added to this block to prevent invalid device
> > tree configurations from passing validation?
> >
>
> This makes sense, we could restrict sensor type 18 and 27 for the ADT7604, even
> though the driver's supported_sensors bitmask already rejects them.
>
> I could add something like:
>
> - if:
> properties:
> compatible:
> contains:
> const: adi,adt7604
> then:
> patternProperties:
> '^thermocouple@': false
> '^diode@': false
> '^adc@': false
> '^temp@': false
> '^rtd@':
> properties:
> adi,sensor-type:
> not:
> const: 18
> '^thermistor@':
> properties:
> adi,sensor-type:
> not:
> const: 27
>
> What do you think?
>
Seems like a nice to have.
> Thanks,
> Liviu
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v3 7/8] dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983
2026-05-21 16:42 [PATCH v3 0/8] iio: temperature: ltc2983: Add support for ADT7604 Liviu Stan
@ 2026-05-21 16:43 ` Liviu Stan
0 siblings, 0 replies; 3+ messages in thread
From: Liviu Stan @ 2026-05-21 16:43 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Michael Hennerich, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Antoniu Miclaus, Liviu Stan,
Francesco Lavra, linux-iio, linux-kernel, linux, devicetree
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 excitation current) and standard (> 1 ohm,
required adi,custom-copper-trace table, optional excitation current
defaulting to the datasheet recommended value). Primary output
is resistance in ohms. For > 1 ohm copper traces with a custom table,
the chip also outputs temperature in millidegrees Celsius.
- leak-detector@: maps to the custom thermistor sensor type (27).
Takes a required adi,custom-leak-detector lookup table encoding
resistance (uOhm) against coverage data (%). Two outputs:
resistance in ohms and coverage in percent.
Separate node types are used rather than extending the existing
rtd@ and thermistor@ nodes because adi,custom-rtd is required
for sensor type 18, and several properties (adi,number-of-wires,
adi,rtd-curve, adi,rsense-share, adi,single-ended,
adi,current-rotate) have no meaning for the new sensor types, since
the configuration is hardcoded, and would need to be explicitly
forbidden or ignored in the driver.
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
(some parts only).
Signed-off-by: Liviu Stan <liviu.stan@analog.com>
---
Changes in v3:
- Changed the custom leak detector table encoding, users now specify
plain coverage percentage values (0-100) in the device tree and the
driver applies the +273.15 C offset internally before writing the
hardware table
- Changed custom-rtd to custom-copper-trace to better represent the
copper trace custom table, and made it required for > 1 ohm variants
- Made custom-leak-detector required for leak detector sensors
- Updated commit message to reflect the changes
- Updated leak detector node description
- Updated adi,custom-leak-detector description
- Modified the example leak detector custom table to match the datasheet
.../bindings/iio/temperature/adi,ltc2983.yaml | 207 +++++++++++++++++-
1 file changed, 204 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..14cfa28809ed 100644
--- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml
+++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml
@@ -4,14 +4,18 @@
$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 and similar Multi-sensor Temperature systems
maintainers:
- Nuno Sá <nuno.sa@analog.com>
description: |
- Analog Devices LTC2983, LTC2984, LTC2986, LTM2985 Multi-Sensor Digital
- Temperature Measurement Systems
+ Analog Devices Multi-Sensor Digital Temperature Measurement Systems:
+ - ADT7604
+ - LTC2983
+ - LTC2984
+ - LTC2986
+ - LTM2985
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 +47,7 @@ properties:
compatible:
oneOf:
- enum:
+ - adi,adt7604
- adi,ltc2983
- adi,ltc2986
- adi,ltm2985
@@ -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
+
+ 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
+ - 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
+
+ adi,rsense-handle:
+ description: Associated sense resistor sensor.
+ $ref: /schemas/types.yaml#/definitions/phandle
+
+ adi,excitation-current-nanoamp:
+ description:
+ Excitation current applied to the leak detector. The correct value
+ depends on the electrical characteristics of the liquid being sensed.
+ For example, 10000 (10µA) is recommended for PG25 (see datasheet
+ Table 39).
+ enum: [250, 500, 1000, 5000, 10000, 25000, 50000, 100000, 250000,
+ 500000, 1000000]
+
+ adi,custom-leak-detector:
+ description: |
+ Lookup table mapping resistance to coverage percentage. Entries must
+ be in ascending resistance order.
+ $ref: /schemas/types.yaml#/definitions/uint64-matrix
+ minItems: 3
+ maxItems: 64
+ items:
+ items:
+ - description: Resistance point in uOhms.
+ - description: Coverage data percentage (0 to 100).
+
+ required:
+ - adi,rsense-handle
+ - adi,excitation-current-nanoamp
+ - adi,custom-leak-detector
+
'^rsense@':
$ref: '#/$defs/sensor-node'
unevaluatedProperties: false
@@ -477,6 +597,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
+
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
@@ -556,4 +692,69 @@ examples:
};
};
};
+
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+ spi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ temperature-sensor@0 {
+ compatible = "adi,adt7604";
+ reg = <0>;
+ interrupt-parent = <&gpio>;
+ interrupts = <25 IRQ_TYPE_EDGE_RISING>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+ vdd-supply = <&supply>;
+
+ trace_rsense: rsense@2 {
+ reg = <2>;
+ adi,sensor-type = <29>;
+ adi,rsense-val-milli-ohms = <100000>; // 100 ohm
+ };
+
+ copper-trace@4 {
+ reg = <4>;
+ adi,sensor-type = <32>;
+ adi,rsense-handle = <&trace_rsense>;
+ adi,copper-trace-sub-ohm;
+ };
+
+ r_sense: rsense@12 {
+ reg = <12>;
+ adi,sensor-type = <29>;
+ adi,rsense-val-milli-ohms = <1000000>; // 1 kohm
+ };
+
+ leak-detector@14 {
+ reg = <14>;
+ adi,sensor-type = <33>;
+ adi,rsense-handle = <&r_sense>;
+ adi,excitation-current-nanoamp = <10000>;
+ adi,custom-leak-detector =
+ /bits/ 64 < 0 100>,
+ /bits/ 64 < 202020000 99>,
+ /bits/ 64 < 285710000 70>,
+ /bits/ 64 < 333330000 60>,
+ /bits/ 64 < 400000000 50>,
+ /bits/ 64 < 500000000 40>,
+ /bits/ 64 < 666670000 30>,
+ /bits/ 64 < 1000000000 20>,
+ /bits/ 64 < 2000000000 10>,
+ /bits/ 64 <1000000000000 0>;
+ };
+
+ rtd@18 {
+ reg = <18>;
+ adi,sensor-type = <12>; // PT100
+ adi,rsense-handle = <&r_sense>;
+ adi,number-of-wires = <2>;
+ adi,rsense-share;
+ adi,excitation-current-microamp = <500>;
+ adi,rtd-curve = <0>;
+ };
+ };
+ };
...
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-22 13:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20260521182308.4E2731F000E9@smtp.kernel.org>
2026-05-22 11:42 ` [PATCH v3 7/8] dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983 Liviu Stan
2026-05-22 13:17 ` Jonathan Cameron
2026-05-21 16:42 [PATCH v3 0/8] iio: temperature: ltc2983: Add support for ADT7604 Liviu Stan
2026-05-21 16:43 ` [PATCH v3 7/8] dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983 Liviu Stan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®