xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/regulator/gpio-regulator.yaml (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun%YAML 1.2
3*4882a593Smuzhiyun---
4*4882a593Smuzhiyun$id: http://devicetree.org/schemas/regulator/gpio-regulator.yaml#
5*4882a593Smuzhiyun$schema: http://devicetree.org/meta-schemas/core.yaml#
6*4882a593Smuzhiyun
7*4882a593Smuzhiyuntitle: GPIO controlled regulators
8*4882a593Smuzhiyun
9*4882a593Smuzhiyunmaintainers:
10*4882a593Smuzhiyun  - Liam Girdwood <lgirdwood@gmail.com>
11*4882a593Smuzhiyun  - Mark Brown <broonie@kernel.org>
12*4882a593Smuzhiyun
13*4882a593Smuzhiyundescription:
14*4882a593Smuzhiyun  Any property defined as part of the core regulator binding, defined in
15*4882a593Smuzhiyun  regulator.txt, can also be used.
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunallOf:
18*4882a593Smuzhiyun  - $ref: "regulator.yaml#"
19*4882a593Smuzhiyun
20*4882a593Smuzhiyunproperties:
21*4882a593Smuzhiyun  compatible:
22*4882a593Smuzhiyun    const: regulator-gpio
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun  regulator-name: true
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun  enable-gpios:
27*4882a593Smuzhiyun    description: GPIO to use to enable/disable the regulator.
28*4882a593Smuzhiyun      Warning, the GPIO phandle flags are ignored and the GPIO polarity is
29*4882a593Smuzhiyun      controlled solely by the presence of "enable-active-high" DT property.
30*4882a593Smuzhiyun      This is due to compatibility with old DTs.
31*4882a593Smuzhiyun    maxItems: 1
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun  gpios:
34*4882a593Smuzhiyun    description: Array of one or more GPIO pins used to select the regulator
35*4882a593Smuzhiyun      voltage/current listed in "states".
36*4882a593Smuzhiyun    minItems: 1
37*4882a593Smuzhiyun    maxItems: 8  # Should be enough...
38*4882a593Smuzhiyun
39*4882a593Smuzhiyun  gpios-states:
40*4882a593Smuzhiyun    description: |
41*4882a593Smuzhiyun      On operating systems, that don't support reading back gpio values in
42*4882a593Smuzhiyun      output mode (most notably linux), this array provides the state of GPIO
43*4882a593Smuzhiyun      pins set when requesting them from the gpio controller. Systems, that are
44*4882a593Smuzhiyun      capable of preserving state when requesting the lines, are free to ignore
45*4882a593Smuzhiyun      this property.
46*4882a593Smuzhiyun        0: LOW
47*4882a593Smuzhiyun        1: HIGH
48*4882a593Smuzhiyun      Default is LOW if nothing else is specified.
49*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/uint32-array
50*4882a593Smuzhiyun    maxItems: 8
51*4882a593Smuzhiyun    items:
52*4882a593Smuzhiyun      enum: [0, 1]
53*4882a593Smuzhiyun      default: 0
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun  states:
56*4882a593Smuzhiyun    description: Selection of available voltages/currents provided by this
57*4882a593Smuzhiyun      regulator and matching GPIO configurations to achieve them. If there are
58*4882a593Smuzhiyun      no states in the "states" array, use a fixed regulator instead.
59*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/uint32-matrix
60*4882a593Smuzhiyun    maxItems: 8
61*4882a593Smuzhiyun    items:
62*4882a593Smuzhiyun      items:
63*4882a593Smuzhiyun        - description: Voltage in microvolts
64*4882a593Smuzhiyun        - description: GPIO group state value
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun  startup-delay-us:
67*4882a593Smuzhiyun    description: startup time in microseconds
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun  enable-active-high:
70*4882a593Smuzhiyun    description: Polarity of "enable-gpio" GPIO is active HIGH. Default is
71*4882a593Smuzhiyun      active LOW.
72*4882a593Smuzhiyun    type: boolean
73*4882a593Smuzhiyun
74*4882a593Smuzhiyun  gpio-open-drain:
75*4882a593Smuzhiyun    description:
76*4882a593Smuzhiyun      GPIO is open drain type. If this property is missing then default
77*4882a593Smuzhiyun      assumption is false.
78*4882a593Smuzhiyun    type: boolean
79*4882a593Smuzhiyun
80*4882a593Smuzhiyun  regulator-type:
81*4882a593Smuzhiyun    description: Specifies what is being regulated.
82*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/string
83*4882a593Smuzhiyun    enum:
84*4882a593Smuzhiyun      - voltage
85*4882a593Smuzhiyun      - current
86*4882a593Smuzhiyun    default: voltage
87*4882a593Smuzhiyun
88*4882a593Smuzhiyunrequired:
89*4882a593Smuzhiyun  - compatible
90*4882a593Smuzhiyun  - regulator-name
91*4882a593Smuzhiyun  - gpios
92*4882a593Smuzhiyun  - states
93*4882a593Smuzhiyun
94*4882a593SmuzhiyununevaluatedProperties: false
95*4882a593Smuzhiyun
96*4882a593Smuzhiyunexamples:
97*4882a593Smuzhiyun  - |
98*4882a593Smuzhiyun    gpio-regulator {
99*4882a593Smuzhiyun      compatible = "regulator-gpio";
100*4882a593Smuzhiyun
101*4882a593Smuzhiyun      regulator-name = "mmci-gpio-supply";
102*4882a593Smuzhiyun      regulator-min-microvolt = <1800000>;
103*4882a593Smuzhiyun      regulator-max-microvolt = <2600000>;
104*4882a593Smuzhiyun      regulator-boot-on;
105*4882a593Smuzhiyun
106*4882a593Smuzhiyun      enable-gpios = <&gpio0 23 0x4>;
107*4882a593Smuzhiyun      gpios = <&gpio0 24 0x4
108*4882a593Smuzhiyun        &gpio0 25 0x4>;
109*4882a593Smuzhiyun      states = <1800000 0x3>,
110*4882a593Smuzhiyun        <2200000 0x2>,
111*4882a593Smuzhiyun        <2600000 0x1>,
112*4882a593Smuzhiyun        <2900000 0x0>;
113*4882a593Smuzhiyun
114*4882a593Smuzhiyun      startup-delay-us = <100000>;
115*4882a593Smuzhiyun      enable-active-high;
116*4882a593Smuzhiyun    };
117*4882a593Smuzhiyun...
118