xref: /freebsd/sys/contrib/device-tree/Bindings/mfd/mediatek,mt6360.yaml (revision 3c4ba5f55438f7afd4f4b0b56f88f2bb505fd6a6)
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mfd/mediatek,mt6360.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: MT6360 PMIC from MediaTek Integrated
8
9maintainers:
10  - Gene Chen <gene_chen@richtek.com>
11
12description: |
13  MT6360 is a PMIC device with the following sub modules.
14  It is interfaced to host controller using I2C interface.
15
16  This document describes the binding for PMIC device and its sub module.
17
18properties:
19  compatible:
20    const: mediatek,mt6360
21
22  reg:
23    maxItems: 1
24
25  wakeup-source: true
26
27  interrupts:
28    maxItems: 1
29
30  interrupt-names:
31    const: IRQB
32
33  interrupt-controller: true
34
35  "#interrupt-cells":
36    const: 1
37    description:
38      The first cell is the IRQ number.
39
40  regulators:
41    $ref: /schemas/regulator/mt6360-regulator.yaml#
42
43  charger:
44    $ref: /schemas/power/supply/mt6360_charger.yaml#
45
46  tcpc:
47    $ref: /schemas/usb/mediatek,mt6360-tcpc.yaml#
48
49  led-controller:
50    $ref: /schemas/leds/leds-mt6360.yaml#
51
52required:
53  - compatible
54  - reg
55  - interrupts
56  - interrupt-controller
57  - "#interrupt-cells"
58
59additionalProperties:
60  type: object
61
62examples:
63  - |
64    #include <dt-bindings/interrupt-controller/irq.h>
65    #include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
66    #include <dt-bindings/leds/common.h>
67    #include <dt-bindings/usb/pd.h>
68    i2c {
69        #address-cells = <1>;
70        #size-cells = <0>;
71
72        pmic@34 {
73            compatible = "mediatek,mt6360";
74            reg = <0x34>;
75            wakeup-source;
76            interrupts-extended = <&gpio26 0 IRQ_TYPE_LEVEL_LOW>;
77            interrupt-names = "IRQB";
78            interrupt-controller;
79            #interrupt-cells = <1>;
80
81            mt6360_charger: charger {
82                compatible = "mediatek,mt6360-chg";
83                richtek,vinovp-microvolt = <14500000>;
84
85                otg_vbus_regulator: usb-otg-vbus-regulator {
86                    regulator-compatible = "usb-otg-vbus";
87                    regulator-name = "usb-otg-vbus";
88                    regulator-min-microvolt = <4425000>;
89                    regulator-max-microvolt = <5825000>;
90                };
91            };
92
93            led-controller {
94                compatible = "mediatek,mt6360-led";
95                #address-cells = <1>;
96                #size-cells = <0>;
97
98                multi-led@0 {
99                    reg = <0>;
100                    function = LED_FUNCTION_INDICATOR;
101                    color = <LED_COLOR_ID_RGB>;
102                    led-max-microamp = <24000>;
103                    #address-cells = <1>;
104                    #size-cells = <0>;
105                    led@0 {
106                        reg = <0>;
107                        color = <LED_COLOR_ID_RED>;
108                    };
109                    led@1 {
110                        reg = <1>;
111                        color = <LED_COLOR_ID_GREEN>;
112                    };
113                    led@2 {
114                        reg = <2>;
115                        color = <LED_COLOR_ID_BLUE>;
116                    };
117                };
118                led@3 {
119                    reg = <3>;
120                    function = LED_FUNCTION_INDICATOR;
121                    color = <LED_COLOR_ID_WHITE>;
122                    led-max-microamp = <150000>;
123                };
124                led@4 {
125                    reg = <4>;
126                    function = LED_FUNCTION_FLASH;
127                    color = <LED_COLOR_ID_WHITE>;
128                    function-enumerator = <1>;
129                    led-max-microamp = <200000>;
130                    flash-max-microamp = <500000>;
131                    flash-max-timeout-us = <1024000>;
132                };
133                led@5 {
134                    reg = <5>;
135                    function = LED_FUNCTION_FLASH;
136                    color = <LED_COLOR_ID_WHITE>;
137                    function-enumerator = <2>;
138                    led-max-microamp = <200000>;
139                    flash-max-microamp = <500000>;
140                    flash-max-timeout-us = <1024000>;
141                };
142            };
143
144            regulators {
145                compatible = "mediatek,mt6360-regulator";
146                LDO_VIN3-supply = <&BUCK2>;
147                buck1 {
148                    regulator-compatible = "BUCK1";
149                    regulator-name = "mt6360,buck1";
150                    regulator-min-microvolt = <300000>;
151                    regulator-max-microvolt = <1300000>;
152                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
153                         MT6360_OPMODE_LP
154                         MT6360_OPMODE_ULP>;
155                };
156                BUCK2: buck2 {
157                    regulator-compatible = "BUCK2";
158                    regulator-name = "mt6360,buck2";
159                    regulator-min-microvolt = <300000>;
160                    regulator-max-microvolt = <1300000>;
161                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
162                         MT6360_OPMODE_LP
163                         MT6360_OPMODE_ULP>;
164                };
165                ldo6 {
166                    regulator-compatible = "LDO6";
167                    regulator-name = "mt6360,ldo6";
168                    regulator-min-microvolt = <500000>;
169                    regulator-max-microvolt = <2100000>;
170                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
171                         MT6360_OPMODE_LP>;
172                };
173                ldo7 {
174                    regulator-compatible = "LDO7";
175                    regulator-name = "mt6360,ldo7";
176                    regulator-min-microvolt = <500000>;
177                    regulator-max-microvolt = <2100000>;
178                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
179                         MT6360_OPMODE_LP>;
180                };
181                ldo1 {
182                    regulator-compatible = "LDO1";
183                    regulator-name = "mt6360,ldo1";
184                    regulator-min-microvolt = <1200000>;
185                    regulator-max-microvolt = <3600000>;
186                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
187                         MT6360_OPMODE_LP>;
188                };
189                ldo2 {
190                    regulator-compatible = "LDO2";
191                    regulator-name = "mt6360,ldo2";
192                    regulator-min-microvolt = <1200000>;
193                    regulator-max-microvolt = <3600000>;
194                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
195                         MT6360_OPMODE_LP>;
196                };
197                ldo3 {
198                    regulator-compatible = "LDO3";
199                    regulator-name = "mt6360,ldo3";
200                    regulator-min-microvolt = <1200000>;
201                    regulator-max-microvolt = <3600000>;
202                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
203                         MT6360_OPMODE_LP>;
204                };
205                ldo5 {
206                    regulator-compatible = "LDO5";
207                    regulator-name = "mt6360,ldo5";
208                    regulator-min-microvolt = <2700000>;
209                    regulator-max-microvolt = <3600000>;
210                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
211                         MT6360_OPMODE_LP>;
212                };
213            };
214
215            tcpc {
216                compatible = "mediatek,mt6360-tcpc";
217                interrupts-extended = <&gpio26 3 IRQ_TYPE_LEVEL_LOW>;
218                interrupt-names = "PD_IRQB";
219
220                connector {
221                    compatible = "usb-c-connector";
222                    label = "USB-C";
223                    data-role = "dual";
224                    power-role = "dual";
225                    try-power-role = "sink";
226                    source-pdos = <PDO_FIXED(5000, 1000, PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP)>;
227                    sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP)>;
228                    op-sink-microwatt = <10000000>;
229
230                    ports {
231                        #address-cells = <1>;
232                        #size-cells = <0>;
233
234                        port@0 {
235                            reg = <0>;
236                            endpoint {
237                                remote-endpoint = <&usb_hs>;
238                            };
239                        };
240                        port@1 {
241                            reg = <1>;
242                            endpoint {
243                                remote-endpoint = <&usb_ss>;
244                          };
245                        };
246                        port@2 {
247                            reg = <2>;
248                            endpoint {
249                                remote-endpoint = <&dp_aux>;
250                            };
251                        };
252                    };
253                };
254            };
255        };
256    };
257