xref: /freebsd/sys/contrib/device-tree/Bindings/mfd/samsung,s5m8767.yaml (revision 8cc087a1eee9ec1ca9f7ac1e63ad51bdb5a682eb)
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mfd/samsung,s5m8767.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Samsung S5M8767 Power Management IC
8
9maintainers:
10  - Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
11
12description: |
13  This is a part of device tree bindings for S2M and S5M family of Power
14  Management IC (PMIC).
15
16  The Samsung S5M8767 is a Power Management IC which includes voltage
17  and current regulators, RTC, clock outputs and other sub-blocks.
18
19properties:
20  compatible:
21    const: samsung,s5m8767-pmic
22
23  clocks:
24    $ref: ../clock/samsung,s2mps11.yaml
25    description:
26      Child node describing clock provider.
27
28  interrupts:
29    maxItems: 1
30
31  reg:
32    maxItems: 1
33
34  regulators:
35    $ref: ../regulator/samsung,s5m8767.yaml
36    description:
37      List of child nodes that specify the regulators.
38
39  s5m8767,pmic-buck2-dvs-voltage:
40    $ref: /schemas/types.yaml#/definitions/uint32-array
41    minItems: 8
42    maxItems: 8
43    description: |
44      A set of 8 voltage values in micro-volt (uV) units for buck2 when
45      changing voltage using gpio dvs.
46
47  s5m8767,pmic-buck3-dvs-voltage:
48    $ref: /schemas/types.yaml#/definitions/uint32-array
49    minItems: 8
50    maxItems: 8
51    description: |
52      A set of 8 voltage values in micro-volt (uV) units for buck3 when
53      changing voltage using gpio dvs.
54
55  s5m8767,pmic-buck4-dvs-voltage:
56    $ref: /schemas/types.yaml#/definitions/uint32-array
57    minItems: 8
58    maxItems: 8
59    description: |
60      A set of 8 voltage values in micro-volt (uV) units for buck4 when
61      changing voltage using gpio dvs.
62
63  s5m8767,pmic-buck-ds-gpios:
64    minItems: 3
65    maxItems: 3
66    description: |
67      GPIO specifiers for three host gpio's used for selecting GPIO DVS lines.
68      It is one-to-one mapped to dvs gpio lines.
69
70  s5m8767,pmic-buck2-uses-gpio-dvs:
71    type: boolean
72    description: buck2 can be controlled by gpio dvs.
73
74  s5m8767,pmic-buck3-uses-gpio-dvs:
75    type: boolean
76    description: buck3 can be controlled by gpio dvs.
77
78  s5m8767,pmic-buck4-uses-gpio-dvs:
79    type: boolean
80    description: buck4 can be controlled by gpio dvs.
81
82  s5m8767,pmic-buck-default-dvs-idx:
83    $ref: /schemas/types.yaml#/definitions/uint32-array
84    minimum: 0
85    maximum: 7
86    default: 0
87    description: |
88      Default voltage setting selected from the possible 8 options selectable
89      by the dvs gpios. The value of this property should be between 0 and 7.
90      If not specified or if out of range, the default value of this property
91      is set to 0.
92
93  s5m8767,pmic-buck-dvs-gpios:
94    minItems: 3
95    maxItems: 3
96    description: |
97      GPIO specifiers for three host gpio's used for dvs.
98
99  vinb1-supply:
100    description: Power supply for buck1
101  vinb2-supply:
102    description: Power supply for buck2
103  vinb3-supply:
104    description: Power supply for buck3
105  vinb4-supply:
106    description: Power supply for buck4
107  vinb5-supply:
108    description: Power supply for buck5
109  vinb6-supply:
110    description: Power supply for buck6
111  vinb7-supply:
112    description: Power supply for buck7
113  vinb8-supply:
114    description: Power supply for buck8
115  vinb9-supply:
116    description: Power supply for buck9
117
118  vinl1-supply:
119    description: Power supply for LDO3, LDO10, LDO26, LDO27
120  vinl2-supply:
121    description: Power supply for LDO13, LDO16, LDO25, LDO28
122  vinl3-supply:
123    description: Power supply for LDO11, LDO14
124  vinl4-supply:
125    description: Power supply for LDO4, LDO9
126  vinl5-supply:
127    description: Power supply for LDO12, LDO17, LDO19, LDO23
128  vinl6-supply:
129    description: Power supply for LDO18, LDO20, LDO21, LDO24
130  vinl7-supply:
131    description: Power supply for LDO5, LDO22
132  vinl8-supply:
133    description: Power supply for LDO1, LDO6, LDO7, LDO8, LDO15
134  vinl9-supply:
135    description: Power supply for LDO2
136
137  wakeup-source: true
138
139required:
140  - compatible
141  - reg
142  - regulators
143  - s5m8767,pmic-buck-ds-gpios
144
145dependencies:
146  s5m8767,pmic-buck2-dvs-voltage: [ 's5m8767,pmic-buck-dvs-gpios' ]
147  s5m8767,pmic-buck3-dvs-voltage: [ 's5m8767,pmic-buck-dvs-gpios' ]
148  s5m8767,pmic-buck4-dvs-voltage: [ 's5m8767,pmic-buck-dvs-gpios' ]
149  s5m8767,pmic-buck2-uses-gpio-dvs: [ 's5m8767,pmic-buck-dvs-gpios', 's5m8767,pmic-buck2-dvs-voltage' ]
150  s5m8767,pmic-buck3-uses-gpio-dvs: [ 's5m8767,pmic-buck-dvs-gpios', 's5m8767,pmic-buck3-dvs-voltage' ]
151  s5m8767,pmic-buck4-uses-gpio-dvs: [ 's5m8767,pmic-buck-dvs-gpios', 's5m8767,pmic-buck4-dvs-voltage' ]
152
153additionalProperties: false
154
155allOf:
156  - if:
157      required:
158        - s5m8767,pmic-buck2-uses-gpio-dvs
159    then:
160      properties:
161        s5m8767,pmic-buck3-uses-gpio-dvs: false
162        s5m8767,pmic-buck4-uses-gpio-dvs: false
163
164  - if:
165      required:
166        - s5m8767,pmic-buck3-uses-gpio-dvs
167    then:
168      properties:
169        s5m8767,pmic-buck2-uses-gpio-dvs: false
170        s5m8767,pmic-buck4-uses-gpio-dvs: false
171
172  - if:
173      required:
174        - s5m8767,pmic-buck4-uses-gpio-dvs
175    then:
176      properties:
177        s5m8767,pmic-buck2-uses-gpio-dvs: false
178        s5m8767,pmic-buck3-uses-gpio-dvs: false
179
180examples:
181  - |
182    #include <dt-bindings/gpio/gpio.h>
183    #include <dt-bindings/interrupt-controller/irq.h>
184
185    i2c {
186        #address-cells = <1>;
187        #size-cells = <0>;
188
189        pmic@66 {
190            compatible = "samsung,s5m8767-pmic";
191            reg = <0x66>;
192
193            interrupt-parent = <&gpx3>;
194            interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
195            pinctrl-names = "default";
196            pinctrl-0 = <&s5m8767_irq &s5m8767_dvs &s5m8767_ds>;
197            wakeup-source;
198
199            s5m8767,pmic-buck-default-dvs-idx = <3>;
200            s5m8767,pmic-buck2-uses-gpio-dvs;
201
202            s5m8767,pmic-buck-dvs-gpios = <&gpd1 0 GPIO_ACTIVE_LOW>,
203                                          <&gpd1 1 GPIO_ACTIVE_LOW>,
204                                          <&gpd1 2 GPIO_ACTIVE_LOW>;
205
206            s5m8767,pmic-buck-ds-gpios = <&gpx2 3 GPIO_ACTIVE_LOW>,
207                                         <&gpx2 4 GPIO_ACTIVE_LOW>,
208                                         <&gpx2 5 GPIO_ACTIVE_LOW>;
209
210            s5m8767,pmic-buck2-dvs-voltage = <1350000>, <1300000>,
211                                             <1250000>, <1200000>,
212                                             <1150000>, <1100000>,
213                                             <1000000>, <950000>;
214
215            s5m8767,pmic-buck3-dvs-voltage = <1100000>, <1100000>,
216                                             <1100000>, <1100000>,
217                                             <1000000>, <1000000>,
218                                             <1000000>, <1000000>;
219
220            s5m8767,pmic-buck4-dvs-voltage = <1200000>, <1200000>,
221                                             <1200000>, <1200000>,
222                                             <1200000>, <1200000>,
223                                             <1200000>, <1200000>;
224
225            clocks {
226                compatible = "samsung,s5m8767-clk";
227                #clock-cells = <1>;
228                clock-output-names = "en32khz_ap", "en32khz_cp", "en32khz_bt";
229            };
230
231            regulators {
232                LDO1 {
233                    regulator-name = "VDD_ALIVE";
234                    regulator-min-microvolt = <1100000>;
235                    regulator-max-microvolt = <1100000>;
236                    regulator-always-on;
237                    regulator-boot-on;
238                    op_mode = <1>; /* Normal Mode */
239                };
240
241                // ...
242
243                BUCK1 {
244                    regulator-name = "VDD_MIF";
245                    regulator-min-microvolt = <950000>;
246                    regulator-max-microvolt = <1100000>;
247                    regulator-always-on;
248                    regulator-boot-on;
249                    op_mode = <1>; /* Normal Mode */
250                };
251
252                BUCK2 {
253                    regulator-name = "VDD_ARM";
254                    regulator-min-microvolt = <900000>;
255                    regulator-max-microvolt = <1350000>;
256                    regulator-always-on;
257                    regulator-boot-on;
258                    op_mode = <1>; /* Normal Mode */
259                };
260
261                // ...
262            };
263        };
264    };
265
266  - |
267    #include <dt-bindings/gpio/gpio.h>
268    #include <dt-bindings/interrupt-controller/irq.h>
269
270    i2c {
271        #address-cells = <1>;
272        #size-cells = <0>;
273
274        pmic@66 {
275            compatible = "samsung,s5m8767-pmic";
276            reg = <0x66>;
277
278            interrupt-parent = <&gpx3>;
279            interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
280            pinctrl-names = "default";
281            pinctrl-0 = <&s5m8767_irq &s5m8767_dvs &s5m8767_ds>;
282            wakeup-source;
283
284            s5m8767,pmic-buck-ds-gpios = <&gpx2 3 GPIO_ACTIVE_LOW>,
285                                         <&gpx2 4 GPIO_ACTIVE_LOW>,
286                                         <&gpx2 5 GPIO_ACTIVE_LOW>;
287
288            clocks {
289                compatible = "samsung,s5m8767-clk";
290                #clock-cells = <1>;
291                clock-output-names = "en32khz_ap", "en32khz_cp", "en32khz_bt";
292            };
293
294            regulators {
295                LDO1 {
296                    regulator-name = "VDD_ALIVE";
297                    regulator-min-microvolt = <1100000>;
298                    regulator-max-microvolt = <1100000>;
299                    regulator-always-on;
300                    regulator-boot-on;
301                    op_mode = <1>; /* Normal Mode */
302                };
303
304                // ...
305            };
306        };
307    };
308