xref: /freebsd/sys/contrib/device-tree/Bindings/mfd/mediatek,mt6360.yaml (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
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-name = "usb-otg-vbus";
87                    regulator-min-microvolt = <4425000>;
88                    regulator-max-microvolt = <5825000>;
89                };
90            };
91
92            led-controller {
93                compatible = "mediatek,mt6360-led";
94                #address-cells = <1>;
95                #size-cells = <0>;
96
97                multi-led@0 {
98                    reg = <0>;
99                    function = LED_FUNCTION_INDICATOR;
100                    color = <LED_COLOR_ID_RGB>;
101                    led-max-microamp = <24000>;
102                    #address-cells = <1>;
103                    #size-cells = <0>;
104                    led@0 {
105                        reg = <0>;
106                        color = <LED_COLOR_ID_RED>;
107                    };
108                    led@1 {
109                        reg = <1>;
110                        color = <LED_COLOR_ID_GREEN>;
111                    };
112                    led@2 {
113                        reg = <2>;
114                        color = <LED_COLOR_ID_BLUE>;
115                    };
116                };
117                led@3 {
118                    reg = <3>;
119                    function = LED_FUNCTION_INDICATOR;
120                    color = <LED_COLOR_ID_WHITE>;
121                    led-max-microamp = <150000>;
122                };
123                led@4 {
124                    reg = <4>;
125                    function = LED_FUNCTION_FLASH;
126                    color = <LED_COLOR_ID_WHITE>;
127                    function-enumerator = <1>;
128                    led-max-microamp = <200000>;
129                    flash-max-microamp = <500000>;
130                    flash-max-timeout-us = <1024000>;
131                };
132                led@5 {
133                    reg = <5>;
134                    function = LED_FUNCTION_FLASH;
135                    color = <LED_COLOR_ID_WHITE>;
136                    function-enumerator = <2>;
137                    led-max-microamp = <200000>;
138                    flash-max-microamp = <500000>;
139                    flash-max-timeout-us = <1024000>;
140                };
141            };
142
143            regulators {
144                compatible = "mediatek,mt6360-regulator";
145                LDO_VIN3-supply = <&BUCK2>;
146                buck1 {
147                    regulator-name = "mt6360,buck1";
148                    regulator-min-microvolt = <300000>;
149                    regulator-max-microvolt = <1300000>;
150                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
151                         MT6360_OPMODE_LP
152                         MT6360_OPMODE_ULP>;
153                };
154                BUCK2: buck2 {
155                    regulator-name = "mt6360,buck2";
156                    regulator-min-microvolt = <300000>;
157                    regulator-max-microvolt = <1300000>;
158                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
159                         MT6360_OPMODE_LP
160                         MT6360_OPMODE_ULP>;
161                };
162                ldo6 {
163                    regulator-name = "mt6360,ldo6";
164                    regulator-min-microvolt = <500000>;
165                    regulator-max-microvolt = <2100000>;
166                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
167                         MT6360_OPMODE_LP>;
168                };
169                ldo7 {
170                    regulator-name = "mt6360,ldo7";
171                    regulator-min-microvolt = <500000>;
172                    regulator-max-microvolt = <2100000>;
173                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
174                         MT6360_OPMODE_LP>;
175                };
176                ldo1 {
177                    regulator-name = "mt6360,ldo1";
178                    regulator-min-microvolt = <1200000>;
179                    regulator-max-microvolt = <3600000>;
180                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
181                         MT6360_OPMODE_LP>;
182                };
183                ldo2 {
184                    regulator-name = "mt6360,ldo2";
185                    regulator-min-microvolt = <1200000>;
186                    regulator-max-microvolt = <3600000>;
187                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
188                         MT6360_OPMODE_LP>;
189                };
190                ldo3 {
191                    regulator-name = "mt6360,ldo3";
192                    regulator-min-microvolt = <1200000>;
193                    regulator-max-microvolt = <3600000>;
194                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
195                         MT6360_OPMODE_LP>;
196                };
197                ldo5 {
198                    regulator-name = "mt6360,ldo5";
199                    regulator-min-microvolt = <2700000>;
200                    regulator-max-microvolt = <3600000>;
201                    regulator-allowed-modes = <MT6360_OPMODE_NORMAL
202                         MT6360_OPMODE_LP>;
203                };
204            };
205
206            tcpc {
207                compatible = "mediatek,mt6360-tcpc";
208                interrupts-extended = <&gpio26 3 IRQ_TYPE_LEVEL_LOW>;
209                interrupt-names = "PD_IRQB";
210
211                connector {
212                    compatible = "usb-c-connector";
213                    label = "USB-C";
214                    data-role = "dual";
215                    power-role = "dual";
216                    try-power-role = "sink";
217                    source-pdos = <PDO_FIXED(5000, 1000, PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP)>;
218                    sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP)>;
219                    op-sink-microwatt = <10000000>;
220
221                    ports {
222                        #address-cells = <1>;
223                        #size-cells = <0>;
224
225                        port@0 {
226                            reg = <0>;
227                            endpoint {
228                                remote-endpoint = <&usb_hs>;
229                            };
230                        };
231                        port@1 {
232                            reg = <1>;
233                            endpoint {
234                                remote-endpoint = <&usb_ss>;
235                          };
236                        };
237                        port@2 {
238                            reg = <2>;
239                            endpoint {
240                                remote-endpoint = <&dp_aux>;
241                            };
242                        };
243                    };
244                };
245            };
246        };
247    };
248