1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mfd/mediatek,mt6370.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: MediaTek MT6370 SubPMIC
8
9maintainers:
10  - ChiYuan Huang <cy_huang@richtek.com>
11
12description: |
13  MT6370 is a highly-integrated smart power management IC, which includes a
14  single cell Li-Ion/Li-Polymer switching battery charger, a USB Type-C &
15  Power Delivery (PD) controller, dual flash LED current sources, a RGB LED
16  driver, a backlight WLED driver, a display bias driver and a general LDO for
17  portable devices.
18
19properties:
20  compatible:
21    const: mediatek,mt6370
22
23  reg:
24    maxItems: 1
25
26  wakeup-source: true
27
28  interrupts:
29    maxItems: 1
30
31  interrupt-controller: true
32
33  "#interrupt-cells":
34    const: 1
35
36  adc:
37    type: object
38    description: |
39      Provides 9 channels for system monitoring, including VBUSDIV5 (lower
40      accuracy, higher measure range), VBUSDIV2 (higher accuracy, lower
41      measure range), VBAT, VSYS, CHG_VDDP, TS_BAT, IBUS, IBAT, and TEMP_JC.
42
43    properties:
44      compatible:
45        const: mediatek,mt6370-adc
46
47      "#io-channel-cells":
48        const: 1
49
50    required:
51      - compatible
52      - "#io-channel-cells"
53
54  backlight:
55    type: object
56    $ref: /schemas/leds/backlight/mediatek,mt6370-backlight.yaml#
57
58  charger:
59    type: object
60    $ref: /schemas/power/supply/mediatek,mt6370-charger.yaml#
61
62  tcpc:
63    type: object
64    $ref: /schemas/usb/mediatek,mt6370-tcpc.yaml#
65
66  indicator:
67    type: object
68    $ref: /schemas/leds/mediatek,mt6370-indicator.yaml#
69
70  flashlight:
71    type: object
72    $ref: /schemas/leds/mediatek,mt6370-flashlight.yaml#
73
74  regulators:
75    type: object
76    description: |
77      List all supported regulators, which support the control for DisplayBias
78      voltages and one general purpose LDO which commonly used to drive the
79      vibrator.
80
81    patternProperties:
82      "^(dsvbst|vibldo)$":
83        $ref: /schemas/regulator/regulator.yaml#
84        type: object
85        unevaluatedProperties: false
86
87      "^(dsvpos|dsvneg)$":
88        $ref: /schemas/regulator/regulator.yaml#
89        type: object
90        unevaluatedProperties: false
91
92        properties:
93          enable-gpios:
94            maxItems: 1
95
96required:
97  - compatible
98  - reg
99  - interrupts
100  - interrupt-controller
101  - "#interrupt-cells"
102  - regulators
103  - adc
104  - backlight
105  - indicator
106  - tcpc
107  - charger
108  - flashlight
109
110additionalProperties: false
111
112examples:
113  - |
114    #include <dt-bindings/interrupt-controller/irq.h>
115    #include <dt-bindings/leds/common.h>
116    #include <dt-bindings/iio/adc/mediatek,mt6370_adc.h>
117    #include <dt-bindings/usb/pd.h>
118    i2c {
119      #address-cells = <1>;
120      #size-cells = <0>;
121
122      pmic@34 {
123        compatible = "mediatek,mt6370";
124        reg = <0x34>;
125        wakeup-source;
126        interrupts-extended = <&gpio26 3 IRQ_TYPE_LEVEL_LOW>;
127        interrupt-controller;
128        #interrupt-cells = <1>;
129
130        mt6370_adc: adc {
131          compatible = "mediatek,mt6370-adc";
132          #io-channel-cells = <1>;
133        };
134
135        backlight {
136          compatible = "mediatek,mt6370-backlight";
137          mediatek,bled-channel-use = /bits/ 8 <15>;
138        };
139
140        charger {
141          compatible = "mediatek,mt6370-charger";
142          interrupts = <68>, <48>, <6>;
143          interrupt-names = "uvp_d_evt", "attach_i", "mivr";
144          io-channels = <&mt6370_adc MT6370_CHAN_IBUS>;
145
146          mt6370_otg_vbus: usb-otg-vbus-regulator {
147            regulator-name = "mt6370-usb-otg-vbus";
148            regulator-min-microvolt = <4350000>;
149            regulator-max-microvolt = <5800000>;
150            regulator-min-microamp = <500000>;
151            regulator-max-microamp = <3000000>;
152          };
153        };
154
155        indicator {
156          compatible = "mediatek,mt6370-indicator";
157          #address-cells = <1>;
158          #size-cells = <0>;
159
160          multi-led@0 {
161            reg = <0>;
162            function = LED_FUNCTION_INDICATOR;
163            color = <LED_COLOR_ID_RGB>;
164            led-max-microamp = <24000>;
165            #address-cells = <1>;
166            #size-cells = <0>;
167            led@0 {
168              reg = <0>;
169              color = <LED_COLOR_ID_RED>;
170            };
171            led@1 {
172              reg = <1>;
173              color = <LED_COLOR_ID_GREEN>;
174            };
175            led@2 {
176              reg = <2>;
177              color = <LED_COLOR_ID_BLUE>;
178            };
179          };
180          led@3 {
181            reg = <3>;
182            function = LED_FUNCTION_INDICATOR;
183            color = <LED_COLOR_ID_WHITE>;
184            led-max-microamp = <6000>;
185          };
186        };
187
188        flashlight {
189          compatible = "mediatek,mt6370-flashlight";
190          #address-cells = <1>;
191          #size-cells = <0>;
192          led@0 {
193            reg = <0>;
194            led-sources = <0>;
195            function = LED_FUNCTION_FLASH;
196            color = <LED_COLOR_ID_WHITE>;
197            function-enumerator = <1>;
198            led-max-microamp = <200000>;
199            flash-max-microamp = <500000>;
200            flash-max-timeout-us = <1248000>;
201          };
202          led@1 {
203            reg = <1>;
204            led-sources = <1>;
205            function = LED_FUNCTION_FLASH;
206            color = <LED_COLOR_ID_WHITE>;
207            function-enumerator = <2>;
208            led-max-microamp = <200000>;
209            flash-max-microamp = <500000>;
210            flash-max-timeout-us = <1248000>;
211          };
212        };
213
214        tcpc {
215          compatible = "mediatek,mt6370-tcpc";
216          interrupts-extended = <&gpio26 4 IRQ_TYPE_LEVEL_LOW>;
217
218          connector {
219            compatible = "usb-c-connector";
220            label = "USB-C";
221            vbus-supply = <&mt6370_otg_vbus>;
222            data-role = "dual";
223            power-role = "dual";
224            try-power-role = "sink";
225            source-pdos = <PDO_FIXED(5000, 1000, PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP)>;
226            sink-pdos = <PDO_FIXED(5000, 2000, PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP)>;
227            op-sink-microwatt = <10000000>;
228
229            ports {
230              #address-cells = <1>;
231              #size-cells = <0>;
232
233              port@0 {
234                reg = <0>;
235                endpoint {
236                  remote-endpoint = <&usb_hs>;
237                };
238              };
239              port@1 {
240                reg = <1>;
241                endpoint {
242                  remote-endpoint = <&usb_ss>;
243                };
244              };
245              port@2 {
246                reg = <2>;
247                endpoint {
248                  remote-endpoint = <&dp_aux>;
249                };
250              };
251            };
252          };
253        };
254
255        regulators {
256          dsvbst {
257            regulator-name = "mt6370-dsv-vbst";
258            regulator-min-microvolt = <4000000>;
259            regulator-max-microvolt = <6200000>;
260          };
261          dsvpos {
262            regulator-name = "mt6370-dsv-vpos";
263            regulator-min-microvolt = <4000000>;
264            regulator-max-microvolt = <6000000>;
265            regulator-boot-on;
266          };
267          dsvneg {
268            regulator-name = "mt6370-dsv-vneg";
269            regulator-min-microvolt = <4000000>;
270            regulator-max-microvolt = <6000000>;
271            regulator-boot-on;
272          };
273          vibldo {
274            regulator-name = "mt6370-vib-ldo";
275            regulator-min-microvolt = <1600000>;
276            regulator-max-microvolt = <4000000>;
277          };
278        };
279      };
280    };
281