# GPIO controlled regulators

_Peios Kernel / Hardware and drivers / Device-tree binding reference / Regulator bindings_

> Device-tree binding reference for GPIO controlled regulators.

<!-- SPDX-License-Identifier: GPL-2.0 -->


<a id="dt-root"></a>

**Schema identifier (<code>&#36;id</code>):** <span id="dt-09f478f44eb202ea573e"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;schemas&#47;regulator&#47;gpio&#45;regulator&#46;yaml&#35;&#34;</code></span>

**Schema dialect (<code>&#36;schema</code>):** <span id="dt-dcb375baab6014763a68"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;meta&#45;schemas&#47;core&#46;yaml&#35;&#34;</code></span>

<a id="dt-e46b5a5dd81dbd751c9f"></a>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;Liam Girdwood &#60;lgirdwood&#64;gmail&#46;com&#62;&#34;</code></span>, <span id="dt-0f999bb9185dbf6b58d8"><code>&#34;Mark Brown &#60;broonie&#64;kernel&#46;org&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">Any property defined as part of the core regulator binding, defined in regulator.txt, can also be used.</p>
</div>

<a id="dt-935ee547587f3e75de61"></a>

## All of these rules must match (<code>allOf</code>)

<a id="dt-d33de94ac1d3652cd22a"></a>

### Rule 1

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-95c8874f25311f4b1ab1">[<code>regulator&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-regulator/regulator.md#dt-root>)</span>

<a id="dt-e1f655ed0ff4d595dadc"></a>

## Properties and child nodes (<code>properties</code>)

<a id="dt-5c1d81699dcbe840de83"></a>

### <code>compatible</code> — required here

**Exact value (<code>const</code>):** <span id="dt-1765195bf8e86c3ccec6"><code>&#34;regulator&#45;gpio&#34;</code></span>

<a id="dt-844ed0b0534e495c9740"></a>

### <code>regulator&#45;name</code> — required here

<code>true</code> — No constraints added by this property rule.

<a id="dt-0d068058a6f4b36b1505"></a>

### <code>enable&#45;gpios</code> — not listed as required here

<div id="dt-2169b15d9fc9d03c1e0f">
<p style="white-space: pre-wrap">GPIO to use to enable/disable the regulator. Warning, the GPIO phandle flags are ignored and the GPIO polarity is controlled solely by the presence of "enable-active-high" DT property. This is due to compatibility with old DTs.</p>
</div>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-3ea466d5c9323bd58f62"><code>1</code></span>

<a id="dt-6423357510c4f559d9df"></a>

### <code>gpios</code> — required here

<div id="dt-e9a56736b9784e1b506e">
<p style="white-space: pre-wrap">Array of one or more GPIO pins used to select the regulator voltage/current listed in "states".</p>
</div>

**Minimum number of items (<code>minItems</code>):** <span id="dt-aa7577d23b35bf762b02"><code>1</code></span>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-6e02d6c73a4125d32798"><code>8</code></span>

<a id="dt-803b29e5744b93633d99"></a>

### <code>gpios&#45;states</code> — not listed as required here

<div id="dt-4782bf4b5897ad7f318d">
<pre><code>On operating systems, that don't support reading back gpio values in
output mode (most notably linux), this array provides the state of GPIO
pins set when requesting them from the gpio controller. Systems, that are
capable of preserving state when requesting the lines, are free to ignore
this property.
  0: LOW
  1: HIGH
Default is LOW if nothing else is specified.</code></pre>
</div>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-9a2f4794d3c0ddcfa251">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32&#45;array</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-03a03f95a666fe4b033c>)</span>

**Minimum number of items (<code>minItems</code>):** <span id="dt-c36eb9350db9ca964f5c"><code>1</code></span>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-c801f02abf575d2e4b1b"><code>8</code></span>

<a id="dt-4c6063b6014a21fbf43d"></a>

#### Array item rules (<code>items</code>)

> **Allowed values (<code>enum</code>):** <a id="dt-1aed5f31c2175f2631a5"></a> <span id="dt-ff2da35267a911be3f44"><code>0</code></span>, <span id="dt-a55c758781924274e616"><code>1</code></span>
>
> **Default value (<code>default</code>):** <span id="dt-669b634dd10fc658a801"><code>0</code></span>

<a id="dt-a43d88077f5ed11fcbbd"></a>

### <code>states</code> — required here

<div id="dt-8ab8fec2bee3afa2811b">
<p style="white-space: pre-wrap">Selection of available voltages/currents provided by this regulator and matching GPIO configurations to achieve them. If there are no states in the "states" array, use a fixed regulator instead.</p>
</div>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-bfeb724a14708e6240cb">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32&#45;matrix</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d948f2945b497d9aa3c7>)</span>

**Minimum number of items (<code>minItems</code>):** <span id="dt-77e7408fc12399d5877d"><code>2</code></span>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-c6fe9ed5efca0264a405"><code>256</code></span>

<a id="dt-886c6d43c7237527caf8"></a>

#### Array item rules (<code>items</code>)

> <a id="dt-52f2be50475ccb66a096"></a>
>
> **Array item rules (<code>items</code>)**
>
> <a id="dt-2ad734dbbd10fe15ea1d"></a>
>
> **Item 1**
>
> > <div id="dt-dd821f00033008e60f3f">
> > <p style="white-space: pre-wrap">Voltage in microvolts</p>
> > </div>
>
> <a id="dt-18fa1f7830049a9f3507"></a>
>
> **Item 2**
>
> > <div id="dt-d7e756e2d5063f50ae08">
> > <p style="white-space: pre-wrap">GPIO group state value</p>
> > </div>

<a id="dt-db9ad283f5033f02094f"></a>

### <code>startup&#45;delay&#45;us</code> — not listed as required here

<div id="dt-2353b8ad16acbca5d731">
<p style="white-space: pre-wrap">startup time in microseconds</p>
</div>

<a id="dt-b9533df67fd4defa5df3"></a>

### <code>enable&#45;active&#45;high</code> — not listed as required here

<div id="dt-7019373b3824ba5b7aed">
<p style="white-space: pre-wrap">Polarity of "enable-gpio" GPIO is active HIGH. Default is active LOW.</p>
</div>

**Value type (<code>type</code>):** <span id="dt-add3c04baf707daa3ff6"><code>&#34;boolean&#34;</code></span>

<a id="dt-d32cfba37af2f1be8367"></a>

### <code>gpio&#45;open&#45;drain</code> — not listed as required here

<div id="dt-3c7e9410732c932c76a2">
<p style="white-space: pre-wrap">GPIO is open drain type. If this property is missing then default assumption is false.</p>
</div>

**Value type (<code>type</code>):** <span id="dt-eec75da1e9d98a9736c6"><code>&#34;boolean&#34;</code></span>

<a id="dt-e02b3c952160b2c20194"></a>

### <code>regulator&#45;type</code> — not listed as required here

<div id="dt-390e207dd0cc5e9435d4">
<p style="white-space: pre-wrap">Specifies what is being regulated.</p>
</div>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-d2398c53a05e346656da">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;string</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-2c695d502852c3a1e1b7>)</span>

**Allowed values (<code>enum</code>):** <a id="dt-97889ad2e6973fe5223e"></a> <span id="dt-cbcb1a5e08a8f1f77290"><code>&#34;voltage&#34;</code></span>, <span id="dt-65763c0b3b9ff489384a"><code>&#34;current&#34;</code></span>

**Default value (<code>default</code>):** <span id="dt-a44b3032905b36504bf9"><code>&#34;voltage&#34;</code></span>

<a id="dt-51a959e83f4922242a97"></a>

### <code>vin&#45;supply</code> — not listed as required here

<div id="dt-7b21b67ede244c89b73f">
<p style="white-space: pre-wrap">Input supply phandle.</p>
</div>

**Required in this object (<code>required</code>):** <a id="dt-8313173ff1c9b300d560"></a> <span id="dt-048b70ee865d6847aa3d"><code>&#34;compatible&#34;</code></span>, <span id="dt-ee7433925c1528c16b99"><code>&#34;regulator&#45;name&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;gpios&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;states&#34;</code></span>

<a id="dt-63ab525a9812ac23c446"></a>

## Properties not evaluated by applicable rules (<code>unevaluatedProperties</code>)

<code>false</code>

Not allowed by this rule.

<a id="dt-1a130cabaa8a47b058bf"></a>

## Examples (<code>examples</code>)

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">gpio-regulator {
  compatible = "regulator-gpio";

  regulator-name = "mmci-gpio-supply";
  regulator-min-microvolt = &lt;1800000&gt;;
  regulator-max-microvolt = &lt;2600000&gt;;
  regulator-boot-on;

  enable-gpios = &lt;&amp;gpio0 23 0x4&gt;;
  gpios = &lt;&amp;gpio0 24 0x4
    &amp;gpio0 25 0x4&gt;;
  states = &lt;1800000 0x3&gt;,
    &lt;2200000 0x2&gt;,
    &lt;2600000 0x1&gt;,
    &lt;2900000 0x0&gt;;

  startup-delay-us = &lt;100000&gt;;
  enable-active-high;
};
</code></pre>

## Source notes

<details>
<summary>Annotations retained from the schema source</summary>

<p id="dt-comment-0"><strong>Line 1:</strong> <span> SPDX-License-Identifier: GPL-2.0</span></p>

<p id="dt-comment-1"><strong>Line 37:</strong> <span> Should be enough...</span></p>

</details>
