xref: /linux/Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml (revision 05d32474ab547fb097cfe3f3eb00a2aa7cdf4067)
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,mt6397.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: MediaTek MT6397/MT6323 PMIC
8
9maintainers:
10  - Sen Chu <sen.chu@mediatek.com>
11  - Macpaul Lin <macpaul.lin@mediatek.com>
12
13description: |
14  MT6397/MT6323 is a power management system chip.
15  Please see the sub-modules below for supported features.
16
17  MT6397/MT6323 is a multifunction device with the following sub modules:
18  - Regulators
19  - RTC
20  - ADC
21  - Audio codec
22  - GPIO
23  - Clock
24  - LED
25  - Keys
26  - Power controller
27
28  It is interfaced to host controller using SPI interface by a proprietary hardware
29  called PMIC wrapper or pwrap. MT6397/MT6323 PMIC is a child device of pwrap.
30  See the following for pwrap node definitions:
31  Documentation/devicetree/bindings/soc/mediatek/mediatek,pwrap.yaml
32
33properties:
34  compatible:
35    oneOf:
36      - enum:
37          - mediatek,mt6323
38          - mediatek,mt6331 # "mediatek,mt6331" for PMIC MT6331 and MT6332.
39          - mediatek,mt6328
40          - mediatek,mt6358
41          - mediatek,mt6359
42          - mediatek,mt6397
43      - items:
44          - enum:
45              - mediatek,mt6366
46          - const: mediatek,mt6358
47      - items:
48          - enum:
49              - mediatek,mt6365
50          - const: mediatek,mt6359
51
52  interrupts:
53    maxItems: 1
54
55  interrupt-controller: true
56
57  "#interrupt-cells":
58    const: 2
59
60  rtc:
61    type: object
62    $ref: /schemas/rtc/rtc.yaml#
63    unevaluatedProperties: false
64    description:
65      MT6397 Real Time Clock.
66
67    properties:
68      compatible:
69        oneOf:
70          - enum:
71              - mediatek,mt6323-rtc
72              - mediatek,mt6331-rtc
73              - mediatek,mt6358-rtc
74              - mediatek,mt6397-rtc
75          - items:
76              - enum:
77                  - mediatek,mt6359-rtc
78                  - mediatek,mt6365-rtc
79                  - mediatek,mt6366-rtc
80              - const: mediatek,mt6358-rtc
81
82      start-year: true
83
84    required:
85      - compatible
86
87  regulators:
88    type: object
89    description:
90      List of child nodes that specify the regulators.
91    additionalProperties: true
92
93    properties:
94      compatible:
95        oneOf:
96          - enum:
97              - mediatek,mt6323-regulator
98              - mediatek,mt6328-regulator
99              - mediatek,mt6331-regulator
100              - mediatek,mt6358-regulator
101              - mediatek,mt6359-regulator
102              - mediatek,mt6397-regulator
103          - items:
104              - enum:
105                  - mediatek,mt6366-regulator
106              - const: mediatek,mt6358-regulator
107          - items:
108              - enum:
109                  - mediatek,mt6365-regulator
110              - const: mediatek,mt6359-regulator
111
112    required:
113      - compatible
114
115  adc:
116    type: object
117    $ref: /schemas/iio/adc/mediatek,mt6359-auxadc.yaml#
118    unevaluatedProperties: false
119
120  audio-codec:
121    type: object
122    description:
123      Audio codec support with MT6358 and MT6397.
124    additionalProperties: true
125
126    properties:
127      compatible:
128        oneOf:
129          - enum:
130              - mediatek,mt6358-sound
131              - mediatek,mt6359-codec
132              - mediatek,mt6397-codec
133          - items:
134              - enum:
135                  - mediatek,mt6366-sound
136              - const: mediatek,mt6358-sound
137          - items:
138              - enum:
139                  - mediatek,mt6365-codec
140              - const: mediatek,mt6359-codec
141
142    required:
143      - compatible
144
145  clocks:
146    type: object
147    additionalProperties: false
148    description:
149      This is a clock buffer node for mt6397. However, there are no sub nodes
150      or any public document exposed in public.
151
152    properties:
153      compatible:
154        const: mediatek,mt6397-clk
155
156      '#clock-cells':
157        const: 1
158
159    required:
160      - compatible
161
162  leds:
163    type: object
164    additionalProperties: false
165    description: |
166      MT6323 LED controller is subfunction provided by MT6323 PMIC, so the LED
167      controllers are defined as the subnode of the function node provided by MT6323
168      PMIC controller that is being defined as one kind of Muti-Function Device (MFD)
169      using shared bus called PMIC wrapper for each subfunction to access remote
170      MT6323 PMIC hardware.
171
172      Each led is represented as a child node of the mediatek,mt6323-led that
173      describes the initial behavior for each LED physically and currently only four
174      LED child nodes can be supported.
175
176    properties:
177      compatible:
178        enum:
179          - mediatek,mt6323-led
180          - mediatek,mt6331-led
181          - mediatek,mt6332-led
182
183      reg:
184        maxItems: 1
185
186      "#address-cells":
187        const: 1
188
189      "#size-cells":
190        const: 0
191
192    patternProperties:
193      "^led@[0-3]$":
194        type: object
195        $ref: /schemas/leds/common.yaml#
196        unevaluatedProperties: false
197
198        properties:
199          reg:
200            description:
201              LED channel number (0..3)
202            minimum: 0
203            maximum: 3
204
205        required:
206          - reg
207
208    required:
209      - compatible
210      - "#address-cells"
211      - "#size-cells"
212
213  keys:
214    type: object
215    $ref: /schemas/input/mediatek,pmic-keys.yaml
216    unevaluatedProperties: false
217    description:
218      Power and Home keys.
219
220  power-controller:
221    type: object
222    additionalProperties: false
223    description:
224      The power controller which could be found on PMIC is responsible for
225      externally powering off or on the remote MediaTek SoC through the
226      circuit BBPU (baseband power up).
227
228    properties:
229      compatible:
230        const: mediatek,mt6323-pwrc
231
232      '#power-domain-cells':
233        const: 0
234
235  pinctrl:
236    type: object
237    $ref: /schemas/pinctrl/mediatek,mt65xx-pinctrl.yaml
238    unevaluatedProperties: false
239    description:
240      Pin controller
241
242  vsys-smps-supply:
243    description: Supply for regulator control logic
244
245patternProperties:
246  "^vsys-v[a-z]+[0-9]*-supply$":
247    description: Supplies for PMIC buck regulators
248  "^vs(ys|[12])-ldo[1-9]-supply$":
249    description: Supplies for PMIC LDO regulators
250
251required:
252  - compatible
253  - regulators
254
255additionalProperties: false
256
257allOf:
258  - if:
259      properties:
260        "compatible":
261          contains:
262            const: mediatek,mt6359
263    then:
264      properties:
265        vsys-ldo1-supply:
266          description: Supply for LDOs vcn33_[12], vio28, vfe28, vibr
267        vsys-ldo2-supply:
268          description: Supply for LDOs vaux18, vbif28, vxo22, vrfck, vrfck_1,
269            vemc, vsim1, vsim2, vusb
270        vsys-vcore-supply:
271          description: Supply for buck regulator vcore
272        vsys-vgpu11-supply:
273          description: Supply for buck regulator vgpu11
274        vsys-vmodem-supply:
275          description: Supply for buck regulator vmodem
276        vsys-vpa-supply:
277          description: Supply for buck regulator vpa
278        vsys-vproc1-supply:
279          description: Supply for buck regulator vproc1
280        vsys-vproc2-supply:
281          description: Supply for buck regulator vproc2
282        vsys-vpu-supply:
283          description: Supply for buck regulator vpu
284        vsys-vs1-supply:
285          description: Supply for buck regulator vs1
286        vsys-vs2-supply:
287          description: Supply for buck regulator vs2
288        vs1-ldo1-supply:
289          description: Supply for LDOs vaud18, vcamio, vm18, vufs
290        vs1-ldo2-supply:
291          description: Supply for LDOs vcn18, vefuse, vio18, vrf18
292        vs2-ldo1-supply:
293          description:
294            Supply for LDOs vsram_proc1, vsram_proc2, vsram_others, vsram_md
295        vs2-ldo2-supply:
296          description: Supply for LDOs va09, va12, vcn13, vrf12
297
298examples:
299  - |
300    #include <dt-bindings/interrupt-controller/arm-gic.h>
301    #include <dt-bindings/leds/common.h>
302
303    pmic {
304        compatible = "mediatek,mt6323";
305        interrupt-parent = <&pio>;
306        interrupts = <150 IRQ_TYPE_LEVEL_HIGH>;
307        interrupt-controller;
308        #interrupt-cells = <2>;
309
310        leds {
311            compatible = "mediatek,mt6323-led";
312            #address-cells = <1>;
313            #size-cells = <0>;
314        };
315
316        regulators {
317            compatible = "mediatek,mt6323-regulator";
318
319            buck_vproc {
320                regulator-name = "vproc";
321                regulator-min-microvolt = < 700000>;
322                regulator-max-microvolt = <1350000>;
323                regulator-ramp-delay = <12500>;
324                regulator-always-on;
325                regulator-boot-on;
326            };
327
328            buck_vsys {
329                regulator-name = "vsys";
330                regulator-min-microvolt = <1400000>;
331                regulator-max-microvolt = <2987500>;
332                regulator-ramp-delay = <25000>;
333                regulator-always-on;
334                regulator-boot-on;
335            };
336
337            buck_vpa {
338                regulator-name = "vpa";
339                regulator-min-microvolt = < 500000>;
340                regulator-max-microvolt = <3650000>;
341            };
342
343            ldo_vtcxo {
344                regulator-name = "vtcxo";
345                regulator-min-microvolt = <2800000>;
346                regulator-max-microvolt = <2800000>;
347                regulator-enable-ramp-delay = <90>;
348                regulator-always-on;
349                regulator-boot-on;
350            };
351
352            ldo_vcn28 {
353                regulator-name = "vcn28";
354                regulator-min-microvolt = <2800000>;
355                regulator-max-microvolt = <2800000>;
356                regulator-enable-ramp-delay = <185>;
357            };
358
359            ldo_vcn33_bt {
360                regulator-name = "vcn33_bt";
361                regulator-min-microvolt = <3300000>;
362                regulator-max-microvolt = <3600000>;
363                regulator-enable-ramp-delay = <185>;
364            };
365
366            ldo_vcn33_wifi {
367                regulator-name = "vcn33_wifi";
368                regulator-min-microvolt = <3300000>;
369                regulator-max-microvolt = <3600000>;
370                regulator-enable-ramp-delay = <185>;
371            };
372
373            ldo_va {
374                regulator-name = "va";
375                regulator-min-microvolt = <2800000>;
376                regulator-max-microvolt = <2800000>;
377                regulator-enable-ramp-delay = <216>;
378                regulator-always-on;
379                regulator-boot-on;
380            };
381
382            ldo_vcama {
383                regulator-name = "vcama";
384                regulator-min-microvolt = <1500000>;
385                regulator-max-microvolt = <2800000>;
386                regulator-enable-ramp-delay = <216>;
387            };
388
389            ldo_vio28 {
390                regulator-name = "vio28";
391                regulator-min-microvolt = <2800000>;
392                regulator-max-microvolt = <2800000>;
393                regulator-enable-ramp-delay = <216>;
394                regulator-always-on;
395                regulator-boot-on;
396            };
397
398            ldo_vusb {
399                regulator-name = "vusb";
400                regulator-min-microvolt = <3300000>;
401                regulator-max-microvolt = <3300000>;
402                regulator-enable-ramp-delay = <216>;
403                regulator-boot-on;
404            };
405
406            ldo_vmc {
407                regulator-name = "vmc";
408                regulator-min-microvolt = <1800000>;
409                regulator-max-microvolt = <3300000>;
410                regulator-enable-ramp-delay = <36>;
411                regulator-boot-on;
412            };
413
414            ldo_vmch {
415                regulator-name = "vmch";
416                regulator-min-microvolt = <3000000>;
417                regulator-max-microvolt = <3300000>;
418                regulator-enable-ramp-delay = <36>;
419                regulator-boot-on;
420            };
421
422            ldo_vemc3v3 {
423                regulator-name = "vemc3v3";
424                regulator-min-microvolt = <3000000>;
425                regulator-max-microvolt = <3300000>;
426                regulator-enable-ramp-delay = <36>;
427                regulator-boot-on;
428            };
429
430            ldo_vgp1 {
431                regulator-name = "vgp1";
432                regulator-min-microvolt = <1200000>;
433                regulator-max-microvolt = <3300000>;
434                regulator-enable-ramp-delay = <216>;
435            };
436
437            ldo_vgp2 {
438                regulator-name = "vgp2";
439                regulator-min-microvolt = <1200000>;
440                regulator-max-microvolt = <3000000>;
441                regulator-enable-ramp-delay = <216>;
442            };
443
444            ldo_vgp3 {
445                regulator-name = "vgp3";
446                regulator-min-microvolt = <1200000>;
447                regulator-max-microvolt = <1800000>;
448                regulator-enable-ramp-delay = <216>;
449            };
450
451            ldo_vcn18 {
452                regulator-name = "vcn18";
453                regulator-min-microvolt = <1800000>;
454                regulator-max-microvolt = <1800000>;
455                regulator-enable-ramp-delay = <216>;
456            };
457
458            ldo_vsim1 {
459                regulator-name = "vsim1";
460                regulator-min-microvolt = <1800000>;
461                regulator-max-microvolt = <3000000>;
462                regulator-enable-ramp-delay = <216>;
463            };
464
465            ldo_vsim2 {
466                regulator-name = "vsim2";
467                regulator-min-microvolt = <1800000>;
468                regulator-max-microvolt = <3000000>;
469                regulator-enable-ramp-delay = <216>;
470            };
471
472            ldo_vrtc {
473                regulator-name = "vrtc";
474                regulator-min-microvolt = <2800000>;
475                regulator-max-microvolt = <2800000>;
476                regulator-always-on;
477                regulator-boot-on;
478            };
479
480            ldo_vcamaf {
481                regulator-name = "vcamaf";
482                regulator-min-microvolt = <1200000>;
483                regulator-max-microvolt = <3300000>;
484                regulator-enable-ramp-delay = <216>;
485            };
486
487            ldo_vibr {
488                regulator-name = "vibr";
489                regulator-min-microvolt = <1200000>;
490                regulator-max-microvolt = <3300000>;
491                regulator-enable-ramp-delay = <36>;
492            };
493
494            ldo_vrf18 {
495                regulator-name = "vrf18";
496                regulator-min-microvolt = <1825000>;
497                regulator-max-microvolt = <1825000>;
498                regulator-enable-ramp-delay = <187>;
499            };
500
501            ldo_vm {
502                regulator-name = "vm";
503                regulator-min-microvolt = <1200000>;
504                regulator-max-microvolt = <1800000>;
505                regulator-enable-ramp-delay = <216>;
506                regulator-always-on;
507                regulator-boot-on;
508            };
509
510            ldo_vio18 {
511                regulator-name = "vio18";
512                regulator-min-microvolt = <1800000>;
513                regulator-max-microvolt = <1800000>;
514                regulator-enable-ramp-delay = <216>;
515                regulator-always-on;
516                regulator-boot-on;
517            };
518
519           ldo_vcamd {
520                regulator-name = "vcamd";
521                regulator-min-microvolt = <1200000>;
522                regulator-max-microvolt = <1800000>;
523                regulator-enable-ramp-delay = <216>;
524            };
525
526            ldo_vcamio {
527                regulator-name = "vcamio";
528                regulator-min-microvolt = <1800000>;
529                regulator-max-microvolt = <1800000>;
530                regulator-enable-ramp-delay = <216>;
531            };
532        };
533
534        keys {
535            compatible = "mediatek,mt6323-keys";
536            mediatek,long-press-mode = <1>;
537            power-off-time-sec = <0>;
538
539            power {
540                linux,keycodes = <116>;
541                wakeup-source;
542            };
543
544            home {
545                linux,keycodes = <114>;
546            };
547        };
548
549        power-controller {
550            compatible = "mediatek,mt6323-pwrc";
551            #power-domain-cells = <0>;
552        };
553
554        rtc {
555            compatible = "mediatek,mt6323-rtc";
556        };
557    };
558
559  - |
560    #include <dt-bindings/input/input.h>
561    #include <dt-bindings/interrupt-controller/arm-gic.h>
562
563    pmic {
564        compatible = "mediatek,mt6358";
565        interrupt-controller;
566        #interrupt-cells = <2>;
567
568        audio-codec {
569            compatible = "mediatek,mt6358-sound";
570            Avdd-supply = <&mt6358_vaud28_reg>;
571            mediatek,dmic-mode = <0>;
572        };
573
574        regulators {
575            compatible = "mediatek,mt6358-regulator";
576
577            buck_vdram1 {
578                regulator-name = "vdram1";
579                regulator-min-microvolt = <500000>;
580                regulator-max-microvolt = <2087500>;
581                regulator-ramp-delay = <12500>;
582                regulator-enable-ramp-delay = <0>;
583                regulator-always-on;
584                regulator-allowed-modes = <0 1>;
585            };
586
587            // ...
588
589            ldo_vsim2 {
590                regulator-name = "vsim2";
591                regulator-min-microvolt = <1700000>;
592                regulator-max-microvolt = <3100000>;
593                regulator-enable-ramp-delay = <540>;
594            };
595        };
596
597        rtc {
598            compatible = "mediatek,mt6358-rtc";
599        };
600
601        keys {
602            compatible = "mediatek,mt6358-keys";
603
604            power {
605                linux,keycodes = <KEY_POWER>;
606                wakeup-source;
607            };
608
609            home {
610                linux,keycodes = <KEY_HOME>;
611            };
612        };
613    };
614
615  - |
616    #include <dt-bindings/interrupt-controller/arm-gic.h>
617
618    pmic {
619        compatible = "mediatek,mt6397";
620
621        interrupt-parent = <&pio>;
622        interrupts-extended = <&pio 222 IRQ_TYPE_LEVEL_HIGH>;
623        interrupt-controller;
624        #interrupt-cells = <2>;
625
626        audio-codec {
627            compatible = "mediatek,mt6397-codec";
628        };
629
630        clocks {
631            compatible = "mediatek,mt6397-clk";
632            #clock-cells = <1>;
633        };
634
635        pinctrl {
636            compatible = "mediatek,mt6397-pinctrl";
637            gpio-controller;
638            #gpio-cells = <2>;
639        };
640
641        regulators {
642            compatible = "mediatek,mt6397-regulator";
643
644            buck_vpca15 {
645                regulator-name = "vpca15";
646                regulator-min-microvolt = < 850000>;
647                regulator-max-microvolt = <1350000>;
648                regulator-ramp-delay = <12500>;
649                regulator-enable-ramp-delay = <200>;
650            };
651
652            // ...
653
654            ldo_vibr {
655                regulator-name = "vibr";
656                regulator-min-microvolt = <1200000>;
657                regulator-max-microvolt = <3300000>;
658                regulator-enable-ramp-delay = <218>;
659            };
660        };
661
662        rtc {
663            compatible = "mediatek,mt6397-rtc";
664        };
665    };
666