Skip to content

Commit a496ba2

Browse files
leaveyoustunjic23
authored andcommitted
dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983
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> Acked-by: Conor Dooley <conor.dooley@microchip.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent 622775d commit a496ba2

1 file changed

Lines changed: 214 additions & 3 deletions

File tree

Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml

Lines changed: 214 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@
44
$id: http://devicetree.org/schemas/iio/temperature/adi,ltc2983.yaml#
55
$schema: http://devicetree.org/meta-schemas/core.yaml#
66

7-
title: Analog Devices LTC2983, LTC2986, LTM2985 Multi-sensor Temperature system
7+
title: Analog Devices LTC2983 and similar Multi-sensor Temperature systems
88

99
maintainers:
1010
- Nuno Sá <nuno.sa@analog.com>
1111

1212
description: |
13-
Analog Devices LTC2983, LTC2984, LTC2986, LTM2985 Multi-Sensor Digital
14-
Temperature Measurement Systems
13+
Analog Devices Multi-Sensor Digital Temperature Measurement Systems:
14+
- ADT7604
15+
- LTC2983
16+
- LTC2984
17+
- LTC2986
18+
- LTM2985
1519
1620
https://www.analog.com/media/en/technical-documentation/data-sheets/2983fc.pdf
1721
https://www.analog.com/media/en/technical-documentation/data-sheets/2984fb.pdf
@@ -43,6 +47,7 @@ properties:
4347
compatible:
4448
oneOf:
4549
- enum:
50+
- adi,adt7604
4651
- adi,ltc2983
4752
- adi,ltc2986
4853
- adi,ltm2985
@@ -436,6 +441,121 @@ patternProperties:
436441
required:
437442
- adi,custom-temp
438443

444+
'^copper-trace@':
445+
$ref: '#/$defs/sensor-node'
446+
unevaluatedProperties: false
447+
description: |
448+
Copper trace resistance sensor (some parts only). Two variants exist:
449+
sub-ohm (< 1 ohm, no custom table allowed) and standard (> 1 ohm,
450+
required custom table).
451+
452+
properties:
453+
reg:
454+
minimum: 2
455+
maximum: 20
456+
457+
adi,sensor-type:
458+
description: Sensor type for copper trace sensors.
459+
$ref: /schemas/types.yaml#/definitions/uint32
460+
const: 32
461+
462+
adi,rsense-handle:
463+
description: Associated sense resistor sensor.
464+
$ref: /schemas/types.yaml#/definitions/phandle
465+
466+
adi,copper-trace-sub-ohm:
467+
description:
468+
Select the sub-ohm (< 1 ohm) copper trace variant. Custom table
469+
and excitation current are not allowed in this mode.
470+
type: boolean
471+
472+
adi,excitation-current-microamp:
473+
description:
474+
Excitation current applied to the copper trace. Not used in
475+
sub-ohm mode. The datasheet recommends 1mA for copper trace
476+
sensors due to their typically small resistance.
477+
enum: [5, 10, 25, 50, 100, 250, 500, 1000]
478+
default: 1000
479+
480+
adi,custom-copper-trace:
481+
description:
482+
Resistance-to-temperature table for copper trace sensors with
483+
resistance > 1 ohm. Required when adi,copper-trace-sub-ohm is not
484+
set. See Page 36 of the datasheet.
485+
$ref: /schemas/types.yaml#/definitions/uint64-matrix
486+
minItems: 3
487+
maxItems: 64
488+
items:
489+
items:
490+
- description: Resistance point in uOhms.
491+
- description: Temperature point in uK.
492+
493+
required:
494+
- adi,rsense-handle
495+
496+
allOf:
497+
- if:
498+
required:
499+
- adi,copper-trace-sub-ohm
500+
then:
501+
properties:
502+
adi,custom-copper-trace: false
503+
adi,excitation-current-microamp: false
504+
- if:
505+
not:
506+
required:
507+
- adi,copper-trace-sub-ohm
508+
then:
509+
required:
510+
- adi,custom-copper-trace
511+
512+
'^leak-detector@':
513+
$ref: '#/$defs/sensor-node'
514+
unevaluatedProperties: false
515+
description: |
516+
Leak detector sensor (some parts only). Outputs resistance in ohms and
517+
a coverage percentage via IIO_COVERAGE (raw/1024 = coverage %).
518+
519+
properties:
520+
reg:
521+
minimum: 2
522+
maximum: 20
523+
524+
adi,sensor-type:
525+
description: Sensor type for leak detector sensors.
526+
$ref: /schemas/types.yaml#/definitions/uint32
527+
const: 33
528+
529+
adi,rsense-handle:
530+
description: Associated sense resistor sensor.
531+
$ref: /schemas/types.yaml#/definitions/phandle
532+
533+
adi,excitation-current-nanoamp:
534+
description:
535+
Excitation current applied to the leak detector. The correct value
536+
depends on the electrical characteristics of the liquid being sensed.
537+
For example, 10000 (10µA) is recommended for PG25 (see datasheet
538+
Table 39).
539+
enum: [250, 500, 1000, 5000, 10000, 25000, 50000, 100000, 250000,
540+
500000, 1000000]
541+
542+
adi,custom-leak-detector:
543+
description: |
544+
Lookup table mapping resistance to coverage percentage. Entries must
545+
be in ascending resistance order.
546+
$ref: /schemas/types.yaml#/definitions/uint64-matrix
547+
minItems: 3
548+
maxItems: 64
549+
items:
550+
items:
551+
- description: Resistance point in uOhms.
552+
- description: Coverage data percentage (0 to 100).
553+
554+
required:
555+
- adi,rsense-handle
556+
- adi,excitation-current-nanoamp
557+
- adi,custom-leak-detector
558+
439559
'^rsense@':
440560
$ref: '#/$defs/sensor-node'
441561
unevaluatedProperties: false
@@ -477,6 +597,32 @@ allOf:
477597
patternProperties:
478598
'^temp@': false
479599

600+
- if:
601+
properties:
602+
compatible:
603+
contains:
604+
const: adi,adt7604
605+
then:
606+
patternProperties:
607+
'^thermocouple@': false
608+
'^diode@': false
609+
'^adc@': false
610+
'^temp@': false
611+
'^rtd@':
612+
properties:
613+
adi,sensor-type:
614+
not:
615+
const: 18
616+
'^thermistor@':
617+
properties:
618+
adi,sensor-type:
619+
not:
620+
const: 27
621+
else:
622+
patternProperties:
623+
'^copper-trace@': false
624+
'^leak-detector@': false
625+
480626
examples:
481627
- |
482628
#include <dt-bindings/interrupt-controller/irq.h>
@@ -556,4 +702,69 @@ examples:
556702
};
557703
};
558704
};
705+
706+
- |
707+
#include <dt-bindings/interrupt-controller/irq.h>
708+
spi {
709+
#address-cells = <1>;
710+
#size-cells = <0>;
711+
712+
temperature-sensor@0 {
713+
compatible = "adi,adt7604";
714+
reg = <0>;
715+
interrupt-parent = <&gpio>;
716+
interrupts = <25 IRQ_TYPE_EDGE_RISING>;
717+
718+
#address-cells = <1>;
719+
#size-cells = <0>;
720+
vdd-supply = <&supply>;
721+
722+
trace_rsense: rsense@2 {
723+
reg = <2>;
724+
adi,sensor-type = <29>;
725+
adi,rsense-val-milli-ohms = <100000>; // 100 ohm
726+
};
727+
728+
copper-trace@4 {
729+
reg = <4>;
730+
adi,sensor-type = <32>;
731+
adi,rsense-handle = <&trace_rsense>;
732+
adi,copper-trace-sub-ohm;
733+
};
734+
735+
r_sense: rsense@12 {
736+
reg = <12>;
737+
adi,sensor-type = <29>;
738+
adi,rsense-val-milli-ohms = <1000000>; // 1 kohm
739+
};
740+
741+
leak-detector@14 {
742+
reg = <14>;
743+
adi,sensor-type = <33>;
744+
adi,rsense-handle = <&r_sense>;
745+
adi,excitation-current-nanoamp = <10000>;
746+
adi,custom-leak-detector =
747+
/bits/ 64 < 0 100>,
748+
/bits/ 64 < 202020000 99>,
749+
/bits/ 64 < 285710000 70>,
750+
/bits/ 64 < 333330000 60>,
751+
/bits/ 64 < 400000000 50>,
752+
/bits/ 64 < 500000000 40>,
753+
/bits/ 64 < 666670000 30>,
754+
/bits/ 64 < 1000000000 20>,
755+
/bits/ 64 < 2000000000 10>,
756+
/bits/ 64 <1000000000000 0>;
757+
};
758+
759+
rtd@18 {
760+
reg = <18>;
761+
adi,sensor-type = <12>; // PT100
762+
adi,rsense-handle = <&r_sense>;
763+
adi,number-of-wires = <2>;
764+
adi,rsense-share;
765+
adi,excitation-current-microamp = <500>;
766+
adi,rtd-curve = <0>;
767+
};
768+
};
769+
};
559770
...

0 commit comments

Comments
 (0)