xref: /linux/Documentation/devicetree/bindings/mfd/ti,twl.yaml (revision 2cddfc2e8fc78c13b0f5286ea5dd48cdf527ad41)
1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/mfd/ti,twl.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Texas Instruments TWL family
8
9maintainers:
10  - Andreas Kemnade <andreas@kemnade.info>
11
12description: |
13  The TWLs are Integrated Power Management Chips.
14  Some versions might contain much more analog functions like
15  USB transceiver or Audio amplifier.
16  These chips are connected to an I2C bus.
17
18allOf:
19  - if:
20      properties:
21        compatible:
22          contains:
23            const: ti,twl4030
24    then:
25      patternProperties:
26        "^regulator-":
27          properties:
28            compatible:
29              enum:
30                - ti,twl4030-vaux1
31                - ti,twl4030-vaux2
32                - ti,twl4030-vaux3
33                - ti,twl4030-vaux4
34                - ti,twl4030-vmmc1
35                - ti,twl4030-vmmc2
36                - ti,twl4030-vpll1
37                - ti,twl4030-vpll2
38                - ti,twl4030-vsim
39                - ti,twl4030-vdac
40                - ti,twl4030-vintana2
41                - ti,twl4030-vio
42                - ti,twl4030-vdd1
43                - ti,twl4030-vdd2
44                - ti,twl4030-vintana1
45                - ti,twl4030-vintdig
46                - ti,twl4030-vusb1v5
47                - ti,twl4030-vusb1v8
48                - ti,twl4030-vusb3v1
49            ti,retain-on-reset: false
50
51      properties:
52        charger:
53          $ref: /schemas/power/supply/twl4030-charger.yaml
54          unevaluatedProperties: false
55
56        gpadc: false
57
58        pwrbutton:
59          properties:
60            compatible:
61              const: ti,twl4030-pwrbutton
62            interrupts:
63              items:
64                - items:
65                    const: 8
66
67        usb-comparator: false
68
69  - if:
70      properties:
71        compatible:
72          contains:
73            const: ti,twl6030
74    then:
75      patternProperties:
76        "^regulator-":
77          properties:
78            compatible:
79              enum:
80                - ti,twl6030-vaux1
81                - ti,twl6030-vaux2
82                - ti,twl6030-vaux3
83                - ti,twl6030-vmmc
84                - ti,twl6030-vpp
85                - ti,twl6030-vusim
86                - ti,twl6030-vana
87                - ti,twl6030-vcxio
88                - ti,twl6030-vdac
89                - ti,twl6030-vusb
90                - ti,twl6030-v1v8
91                - ti,twl6030-v2v1
92                - ti,twl6030-vdd1
93                - ti,twl6030-vdd2
94                - ti,twl6030-vdd3
95            regulator-initial-mode: false
96
97      properties:
98        charger:
99          $ref: /schemas/power/supply/ti,twl6030-charger.yaml
100          unevaluatedProperties: false
101
102        gpadc:
103          properties:
104            compatible:
105              const: ti,twl6030-gpadc
106
107        pwrbutton:
108          properties:
109            compatible:
110              const: ti,twl6030-pwrbutton
111            interrupts:
112              items:
113                - items:
114                    const: 0
115
116        madc: false
117
118        watchdog: false
119
120        audio: false
121
122        keypad: false
123
124        twl4030-usb: false
125
126        gpio: false
127
128        power: false
129
130  - if:
131      properties:
132        compatible:
133          contains:
134            const: ti,twl6032
135    then:
136      patternProperties:
137        "^regulator-":
138          properties:
139            compatible:
140              enum:
141                - ti,twl6032-ldo1
142                - ti,twl6032-ldo2
143                - ti,twl6032-ldo3
144                - ti,twl6032-ldo4
145                - ti,twl6032-ldo5
146                - ti,twl6032-ldo6
147                - ti,twl6032-ldo7
148                - ti,twl6032-ldoln
149                - ti,twl6032-ldousb
150                - ti,twl6032-smps3
151                - ti,twl6032-smps4
152                - ti,twl6032-vio
153            regulator-initial-mode: false
154
155      properties:
156        charger:
157          $ref: /schemas/power/supply/ti,twl6030-charger.yaml
158          unevaluatedProperties: false
159
160        gpadc:
161          properties:
162            compatible:
163              const: ti,twl6032-gpadc
164
165        pwrbutton:
166          properties:
167            compatible:
168              const: ti,twl6030-pwrbutton
169            interrupts:
170              items:
171                - items:
172                    const: 0
173
174        madc: false
175
176        watchdog: false
177
178        audio: false
179
180        keypad: false
181
182        twl4030-usb: false
183
184        gpio: false
185
186        power: false
187
188properties:
189  compatible:
190    description: >
191      TWL4030 for integrated power-management/audio CODEC device used in
192      OMAP3 based boards.
193
194      TWL6030/32 for integrated power-management used in OMAP4 based boards
195    enum:
196      - ti,twl4030
197      - ti,twl6030
198      - ti,twl6032
199
200  reg:
201    maxItems: 1
202
203  interrupts:
204    maxItems: 1
205
206  interrupt-controller: true
207
208  system-power-controller: true
209
210  "#interrupt-cells":
211    const: 1
212
213  "#clock-cells":
214    const: 1
215
216  clocks:
217    maxItems: 1
218
219  clock-names:
220    const: fck
221
222  charger:
223    type: object
224
225    properties:
226      compatible: true
227
228    required:
229      - compatible
230
231  rtc:
232    type: object
233    additionalProperties: false
234
235    properties:
236      compatible:
237        const: ti,twl4030-rtc
238      interrupts:
239        maxItems: 1
240
241  madc:
242    type: object
243    $ref: /schemas/iio/adc/ti,twl4030-madc.yaml
244    unevaluatedProperties: false
245
246  pwrbutton:
247    type: object
248    additionalProperties: false
249
250    properties:
251      compatible:
252        enum:
253          - ti,twl4030-pwrbutton
254          - ti,twl6030-pwrbutton
255      interrupts:
256        maxItems: 1
257
258  watchdog:
259    type: object
260    additionalProperties: false
261
262    properties:
263      compatible:
264        const: ti,twl4030-wdt
265
266  audio:
267    type: object
268    additionalProperties: true
269
270    properties:
271      compatible:
272        const: ti,twl4030-audio
273
274    required:
275      - compatible
276
277  keypad:
278    type: object
279    additionalProperties: true
280
281    properties:
282      compatible:
283        const: ti,twl4030-keypad
284
285    required:
286      - compatible
287
288  twl4030-usb:
289    type: object
290    additionalProperties: true
291
292    properties:
293      compatible:
294        const: ti,twl4030-usb
295
296    required:
297      - compatible
298
299  gpio:
300    type: object
301    additionalProperties: true
302
303    properties:
304      compatible:
305        const: ti,twl4030-gpio
306
307    required:
308      - compatible
309
310  power:
311    type: object
312    additionalProperties: false
313    description: >
314      The power management module inside the TWL4030 provides several
315      facilities to control the power resources, including power scripts.
316
317      For now, the binding only supports the complete shutdown of the
318      system after poweroff.
319
320      Board-specific compatible strings may be used for platform-specific
321      power configurations.
322
323      A board-specific compatible string (e.g., ti,twl4030-power-omap3-evm)
324      may be paired with a generic fallback (generally for power saving mode).
325
326    properties:
327      compatible:
328        oneOf:
329          # Case 1: A single compatible string is provided.
330          - enum:
331              - ti,twl4030-power
332              - ti,twl4030-power-reset
333              - ti,twl4030-power-idle
334              - ti,twl4030-power-idle-osc-off
335              - ti,twl4030-power-omap3-sdp
336              - ti,twl4030-power-omap3-ldp
337              - ti,twl4030-power-omap3-evm
338
339          # Case 2: The specific, valid fallback for 'idle-osc-off'.
340          - items:
341              - const: ti,twl4030-power-idle-osc-off
342              - const: ti,twl4030-power-idle
343
344          # Case 3: The specific, valid fallback for 'omap3-evm'.
345          - items:
346              - const: ti,twl4030-power-omap3-evm
347              - const: ti,twl4030-power-idle
348
349      ti,system-power-controller:
350        type: boolean
351        deprecated: true
352        description: >
353          DEPRECATED. The standard 'system-power-controller'
354          property on the parent node should be used instead.
355
356      ti,use_poweroff:
357        type: boolean
358        deprecated: true
359        description: DEPRECATED, to be removed.
360
361    required:
362      - compatible
363
364  gpadc:
365    type: object
366    $ref: /schemas/iio/adc/ti,twl6030-gpadc.yaml
367    unevaluatedProperties: false
368
369    properties:
370      compatible: true
371
372  usb-comparator:
373    type: object
374    additionalProperties: true
375
376    properties:
377      compatible:
378        const: ti,twl6030-usb
379
380    required:
381      - compatible
382
383  pwm:
384    type: object
385    $ref: /schemas/pwm/pwm.yaml#
386    unevaluatedProperties: false
387    description:
388      PWM controllers (PWM1 and PWM2 on TWL4030, PWM0 and PWM1 on TWL6030/32).
389
390    properties:
391      compatible:
392        enum:
393          - ti,twl4030-pwm
394          - ti,twl6030-pwm
395
396      '#pwm-cells':
397        const: 2
398
399    required:
400      - compatible
401      - '#pwm-cells'
402
403  pwmled:
404    type: object
405    $ref: /schemas/pwm/pwm.yaml#
406    unevaluatedProperties: false
407    description: >
408      PWM controllers connected to LED terminals (PWMA and PWMB on TWL4030.
409
410      LED PWM on TWL6030/32, mainly used as charging indicator LED).
411
412    properties:
413      compatible:
414        enum:
415          - ti,twl4030-pwmled
416          - ti,twl6030-pwmled
417
418      '#pwm-cells':
419        const: 2
420
421    required:
422      - compatible
423      - '#pwm-cells'
424
425patternProperties:
426  '^regulator-':
427    type: object
428    unevaluatedProperties: false
429    $ref: /schemas/regulator/regulator.yaml
430
431    properties:
432      compatible: true
433      regulator-initial-mode:
434        enum:
435          - 0x08 # Sleep mode, the nominal output voltage is maintained
436                 # with low power consumption with low load current capability
437          - 0x0e # Active mode, the regulator can deliver its nominal output
438                 # voltage with full-load current capability
439
440      ti,retain-on-reset:
441        description: >
442          Does not turn off the supplies during warm reset.
443
444          Could be needed for VMMC, as TWL6030 reset sequence for
445          this signal does not comply with the SD specification.
446        type: boolean
447
448unevaluatedProperties: false
449
450required:
451  - compatible
452  - reg
453  - interrupts
454  - interrupt-controller
455  - '#interrupt-cells'
456
457examples:
458  - |
459    i2c {
460      #address-cells = <1>;
461      #size-cells = <0>;
462
463      pmic@48 {
464        compatible = "ti,twl6030";
465        reg = <0x48>;
466        interrupts = <39>; /* IRQ_SYS_1N cascaded to gic */
467        interrupt-parent = <&gic>;
468        interrupt-controller;
469        #interrupt-cells = <1>;
470
471        charger {
472          compatible = "ti,twl6030-charger";
473          interrupts = <2>, <5>;
474          io-channels = <&gpadc 10>;
475          io-channel-names = "vusb";
476          monitored-battery = <&bat>;
477        };
478
479        gpadc {
480          compatible = "ti,twl6030-gpadc";
481          interrupts = <6>;
482          #io-channel-cells = <1>;
483        };
484
485        pwrbutton {
486          compatible = "ti,twl6030-pwrbutton";
487          interrupts = <0>;
488        };
489
490        rtc {
491          compatible = "ti,twl4030-rtc";
492          interrupts = <8>;
493        };
494
495        regulator-vaux1 {
496          compatible = "ti,twl6030-vaux1";
497          regulator-min-microvolt = <1000000>;
498          regulator-max-microvolt = <3000000>;
499        };
500
501        regulator-vmmc1 {
502          compatible = "ti,twl6030-vmmc";
503          ti,retain-on-reset;
504        };
505
506        pwm {
507          compatible = "ti,twl6030-pwm";
508          #pwm-cells = <2>;
509        };
510
511        pwmled {
512          compatible = "ti,twl6030-pwmled";
513          #pwm-cells = <2>;
514        };
515      };
516    };
517
518  - |
519    i2c {
520      #address-cells = <1>;
521      #size-cells = <0>;
522
523      pmic@48 {
524        compatible = "ti,twl4030";
525        reg = <0x48>;
526        interrupts = <7>; /* SYS_NIRQ cascaded to intc */
527        interrupt-parent = <&intc>;
528        interrupt-controller;
529        #interrupt-cells = <1>;
530
531        charger {
532          compatible = "ti,twl4030-bci";
533          interrupts = <9>, <2>;
534          bci3v1-supply = <&vusb3v1>;
535          io-channels = <&twl_madc 11>;
536          io-channel-names = "vac";
537        };
538
539        twl_madc: madc {
540          compatible = "ti,twl4030-madc";
541          interrupts = <3>;
542          #io-channel-cells = <1>;
543        };
544
545        pwrbutton {
546          compatible = "ti,twl4030-pwrbutton";
547          interrupts = <8>;
548        };
549
550        rtc {
551          compatible = "ti,twl4030-rtc";
552          interrupts = <11>;
553        };
554
555        regulator-vaux1 {
556          compatible = "ti,twl4030-vaux1";
557          regulator-min-microvolt = <1000000>;
558          regulator-max-microvolt = <3000000>;
559          regulator-initial-mode = <0xe>;
560        };
561
562        vusb3v1: regulator-vusb3v1 {
563          compatible = "ti,twl4030-vusb3v1";
564        };
565
566        watchdog {
567          compatible = "ti,twl4030-wdt";
568        };
569
570        power {
571          compatible = "ti,twl4030-power";
572        };
573
574        pwm {
575          compatible = "ti,twl4030-pwm";
576          #pwm-cells = <2>;
577        };
578
579        pwmled {
580          compatible = "ti,twl4030-pwmled";
581          #pwm-cells = <2>;
582        };
583      };
584    };
585...
586