1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mfd/maxim,max5970.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Regulator for MAX5970 Smart Switch from Maxim Integrated
8
9maintainers:
10  - Patrick Rudolph <patrick.rudolph@9elements.com>
11
12description: |
13  The smart switch provides no output regulation, but independent fault protection
14  and voltage and current sensing.
15  Programming is done through I2C bus.
16
17  Datasheets:
18    https://datasheets.maximintegrated.com/en/ds/MAX5970.pdf
19    https://datasheets.maximintegrated.com/en/ds/MAX5978.pdf
20
21properties:
22  compatible:
23    enum:
24      - maxim,max5970
25      - maxim,max5978
26
27  reg:
28    maxItems: 1
29
30  interrupts:
31    maxItems: 1
32
33  leds:
34    type: object
35    description:
36      Properties for four LEDS.
37
38    properties:
39      "#address-cells":
40        const: 1
41
42      "#size-cells":
43        const: 0
44
45    patternProperties:
46      "^led@[0-3]$":
47        $ref: /schemas/leds/common.yaml#
48        type: object
49
50    additionalProperties: false
51
52  vss1-supply:
53    description: Supply of the first channel.
54
55  vss2-supply:
56    description: Supply of the second channel.
57
58  regulators:
59    type: object
60    description:
61      Properties for both hot swap control/switch.
62
63    patternProperties:
64      "^sw[0-1]$":
65        $ref: /schemas/regulator/regulator.yaml#
66        type: object
67        properties:
68          shunt-resistor-micro-ohms:
69            description: |
70              The value of current sense resistor in microohms.
71
72        required:
73          - shunt-resistor-micro-ohms
74
75        unevaluatedProperties: false
76
77    additionalProperties: false
78
79required:
80  - compatible
81  - reg
82  - regulators
83  - vss1-supply
84
85allOf:
86  - if:
87      properties:
88        compatible:
89          enum:
90            - maxim,max5970
91    then:
92      required:
93        - vss2-supply
94
95additionalProperties: false
96
97examples:
98  - |
99    i2c {
100        #address-cells = <1>;
101        #size-cells = <0>;
102        regulator@3a {
103            compatible = "maxim,max5978";
104            reg = <0x3a>;
105            vss1-supply = <&p3v3>;
106
107            regulators {
108                sw0_ref_0: sw0 {
109                    shunt-resistor-micro-ohms = <12000>;
110                };
111            };
112
113            leds {
114                #address-cells = <1>;
115                #size-cells = <0>;
116                led@0 {
117                    reg = <0>;
118                    label = "led0";
119                    default-state = "on";
120                };
121                led@1 {
122                    reg = <1>;
123                    label = "led1";
124                    default-state = "on";
125                };
126            };
127        };
128    };
129
130  - |
131    i2c {
132        #address-cells = <1>;
133        #size-cells = <0>;
134
135        regulator@3a {
136            compatible = "maxim,max5970";
137            reg = <0x3a>;
138            vss1-supply = <&p3v3>;
139            vss2-supply = <&p5v>;
140
141            regulators {
142                sw0_ref_1: sw0 {
143                    shunt-resistor-micro-ohms = <12000>;
144                };
145                sw1_ref_1: sw1 {
146                    shunt-resistor-micro-ohms = <10000>;
147                };
148            };
149        };
150    };
151...
152