xref: /linux/Documentation/devicetree/bindings/iio/adc/maxim,max34408.yaml (revision 06d07429858317ded2db7986113a9e0129cd599b)
1*f0d1a9b7SIvan Mikhaylov# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2*f0d1a9b7SIvan Mikhaylov%YAML 1.2
3*f0d1a9b7SIvan Mikhaylov---
4*f0d1a9b7SIvan Mikhaylov$id: http://devicetree.org/schemas/iio/adc/maxim,max34408.yaml#
5*f0d1a9b7SIvan Mikhaylov$schema: http://devicetree.org/meta-schemas/core.yaml#
6*f0d1a9b7SIvan Mikhaylov
7*f0d1a9b7SIvan Mikhaylovtitle: Maxim MAX34408/MAX34409 current monitors with overcurrent control
8*f0d1a9b7SIvan Mikhaylov
9*f0d1a9b7SIvan Mikhaylovmaintainers:
10*f0d1a9b7SIvan Mikhaylov  - Ivan Mikhaylov <fr0st61te@gmail.com>
11*f0d1a9b7SIvan Mikhaylov
12*f0d1a9b7SIvan Mikhaylovdescription: |
13*f0d1a9b7SIvan Mikhaylov  The MAX34408/MAX34409 are two- and four-channel current monitors that are
14*f0d1a9b7SIvan Mikhaylov  configured and monitored with a standard I2C/SMBus serial interface. Each
15*f0d1a9b7SIvan Mikhaylov  unidirectional current sensor offers precision high-side operation with a
16*f0d1a9b7SIvan Mikhaylov  low full-scale sense voltage. The devices automatically sequence through
17*f0d1a9b7SIvan Mikhaylov  two or four channels and collect the current-sense samples and average them
18*f0d1a9b7SIvan Mikhaylov  to reduce the effect of impulse noise. The raw ADC samples are compared to
19*f0d1a9b7SIvan Mikhaylov  user-programmable digital thresholds to indicate overcurrent conditions.
20*f0d1a9b7SIvan Mikhaylov  Overcurrent conditions trigger a hardware output to provide an immediate
21*f0d1a9b7SIvan Mikhaylov  indication to shut down any necessary external circuitry.
22*f0d1a9b7SIvan Mikhaylov
23*f0d1a9b7SIvan Mikhaylov  Specifications about the devices can be found at:
24*f0d1a9b7SIvan Mikhaylov  https://www.analog.com/media/en/technical-documentation/data-sheets/MAX34408-MAX34409.pdf
25*f0d1a9b7SIvan Mikhaylov
26*f0d1a9b7SIvan Mikhaylovproperties:
27*f0d1a9b7SIvan Mikhaylov  compatible:
28*f0d1a9b7SIvan Mikhaylov    enum:
29*f0d1a9b7SIvan Mikhaylov      - maxim,max34408
30*f0d1a9b7SIvan Mikhaylov      - maxim,max34409
31*f0d1a9b7SIvan Mikhaylov
32*f0d1a9b7SIvan Mikhaylov  "#address-cells":
33*f0d1a9b7SIvan Mikhaylov    const: 1
34*f0d1a9b7SIvan Mikhaylov
35*f0d1a9b7SIvan Mikhaylov  "#size-cells":
36*f0d1a9b7SIvan Mikhaylov    const: 0
37*f0d1a9b7SIvan Mikhaylov
38*f0d1a9b7SIvan Mikhaylov  reg:
39*f0d1a9b7SIvan Mikhaylov    maxItems: 1
40*f0d1a9b7SIvan Mikhaylov
41*f0d1a9b7SIvan Mikhaylov  interrupts:
42*f0d1a9b7SIvan Mikhaylov    maxItems: 1
43*f0d1a9b7SIvan Mikhaylov
44*f0d1a9b7SIvan Mikhaylov  powerdown-gpios:
45*f0d1a9b7SIvan Mikhaylov    description:
46*f0d1a9b7SIvan Mikhaylov      Shutdown Output. Open-drain output. This output transitions to high impedance
47*f0d1a9b7SIvan Mikhaylov      when any of the digital comparator thresholds are exceeded as long as the ENA
48*f0d1a9b7SIvan Mikhaylov      pin is high.
49*f0d1a9b7SIvan Mikhaylov    maxItems: 1
50*f0d1a9b7SIvan Mikhaylov
51*f0d1a9b7SIvan Mikhaylov  powerdown-status-gpios:
52*f0d1a9b7SIvan Mikhaylov    description:
53*f0d1a9b7SIvan Mikhaylov      SHTDN Enable Input. CMOS digital input. Connect to GND to clear the latch and
54*f0d1a9b7SIvan Mikhaylov      unconditionally deassert (force low) the SHTDN output and reset the shutdown
55*f0d1a9b7SIvan Mikhaylov      delay. Connect to VDD to enable normal latch operation of the SHTDN output.
56*f0d1a9b7SIvan Mikhaylov    maxItems: 1
57*f0d1a9b7SIvan Mikhaylov
58*f0d1a9b7SIvan Mikhaylov  vdd-supply: true
59*f0d1a9b7SIvan Mikhaylov
60*f0d1a9b7SIvan MikhaylovpatternProperties:
61*f0d1a9b7SIvan Mikhaylov  "^channel@[0-3]$":
62*f0d1a9b7SIvan Mikhaylov    $ref: adc.yaml
63*f0d1a9b7SIvan Mikhaylov    type: object
64*f0d1a9b7SIvan Mikhaylov    description:
65*f0d1a9b7SIvan Mikhaylov      Represents the internal channels of the ADC.
66*f0d1a9b7SIvan Mikhaylov
67*f0d1a9b7SIvan Mikhaylov    properties:
68*f0d1a9b7SIvan Mikhaylov      reg:
69*f0d1a9b7SIvan Mikhaylov        items:
70*f0d1a9b7SIvan Mikhaylov          - minimum: 0
71*f0d1a9b7SIvan Mikhaylov            maximum: 3
72*f0d1a9b7SIvan Mikhaylov
73*f0d1a9b7SIvan Mikhaylov      maxim,rsense-val-micro-ohms:
74*f0d1a9b7SIvan Mikhaylov        description:
75*f0d1a9b7SIvan Mikhaylov          Adjust the Rsense value to monitor higher or lower current levels for
76*f0d1a9b7SIvan Mikhaylov          input.
77*f0d1a9b7SIvan Mikhaylov        enum: [250, 500, 1000, 5000, 10000, 50000, 100000, 200000, 500000]
78*f0d1a9b7SIvan Mikhaylov        default: 1000
79*f0d1a9b7SIvan Mikhaylov
80*f0d1a9b7SIvan Mikhaylov    required:
81*f0d1a9b7SIvan Mikhaylov      - reg
82*f0d1a9b7SIvan Mikhaylov      - maxim,rsense-val-micro-ohms
83*f0d1a9b7SIvan Mikhaylov
84*f0d1a9b7SIvan Mikhaylov    unevaluatedProperties: false
85*f0d1a9b7SIvan Mikhaylov
86*f0d1a9b7SIvan Mikhaylovrequired:
87*f0d1a9b7SIvan Mikhaylov  - compatible
88*f0d1a9b7SIvan Mikhaylov  - reg
89*f0d1a9b7SIvan Mikhaylov
90*f0d1a9b7SIvan MikhaylovallOf:
91*f0d1a9b7SIvan Mikhaylov  - if:
92*f0d1a9b7SIvan Mikhaylov      properties:
93*f0d1a9b7SIvan Mikhaylov        compatible:
94*f0d1a9b7SIvan Mikhaylov          contains:
95*f0d1a9b7SIvan Mikhaylov            const: maxim,max34408
96*f0d1a9b7SIvan Mikhaylov    then:
97*f0d1a9b7SIvan Mikhaylov      patternProperties:
98*f0d1a9b7SIvan Mikhaylov        "^channel@[2-3]$": false
99*f0d1a9b7SIvan Mikhaylov        "^channel@[0-1]$":
100*f0d1a9b7SIvan Mikhaylov          properties:
101*f0d1a9b7SIvan Mikhaylov            reg:
102*f0d1a9b7SIvan Mikhaylov              maximum: 1
103*f0d1a9b7SIvan Mikhaylov    else:
104*f0d1a9b7SIvan Mikhaylov      patternProperties:
105*f0d1a9b7SIvan Mikhaylov        "^channel@[0-3]$":
106*f0d1a9b7SIvan Mikhaylov          properties:
107*f0d1a9b7SIvan Mikhaylov            reg:
108*f0d1a9b7SIvan Mikhaylov              maximum: 3
109*f0d1a9b7SIvan Mikhaylov
110*f0d1a9b7SIvan MikhaylovadditionalProperties: false
111*f0d1a9b7SIvan Mikhaylov
112*f0d1a9b7SIvan Mikhaylovexamples:
113*f0d1a9b7SIvan Mikhaylov  - |
114*f0d1a9b7SIvan Mikhaylov    #include <dt-bindings/gpio/gpio.h>
115*f0d1a9b7SIvan Mikhaylov
116*f0d1a9b7SIvan Mikhaylov    i2c {
117*f0d1a9b7SIvan Mikhaylov        #address-cells = <1>;
118*f0d1a9b7SIvan Mikhaylov        #size-cells = <0>;
119*f0d1a9b7SIvan Mikhaylov
120*f0d1a9b7SIvan Mikhaylov        adc@1e {
121*f0d1a9b7SIvan Mikhaylov              compatible = "maxim,max34409";
122*f0d1a9b7SIvan Mikhaylov              reg = <0x1e>;
123*f0d1a9b7SIvan Mikhaylov              powerdown-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
124*f0d1a9b7SIvan Mikhaylov              powerdown-status-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
125*f0d1a9b7SIvan Mikhaylov
126*f0d1a9b7SIvan Mikhaylov              #address-cells = <1>;
127*f0d1a9b7SIvan Mikhaylov              #size-cells = <0>;
128*f0d1a9b7SIvan Mikhaylov
129*f0d1a9b7SIvan Mikhaylov              channel@0 {
130*f0d1a9b7SIvan Mikhaylov                  reg = <0x0>;
131*f0d1a9b7SIvan Mikhaylov                  maxim,rsense-val-micro-ohms = <5000>;
132*f0d1a9b7SIvan Mikhaylov              };
133*f0d1a9b7SIvan Mikhaylov
134*f0d1a9b7SIvan Mikhaylov              channel@1 {
135*f0d1a9b7SIvan Mikhaylov                  reg = <0x1>;
136*f0d1a9b7SIvan Mikhaylov                  maxim,rsense-val-micro-ohms = <10000>;
137*f0d1a9b7SIvan Mikhaylov             };
138*f0d1a9b7SIvan Mikhaylov        };
139*f0d1a9b7SIvan Mikhaylov    };
140