GPIO controlled regulators

Schema identifier ($id): "http://devicetree.org/schemas/regulator/gpio-regulator.yaml#"

Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"

Maintainers (maintainers): "Liam Girdwood <lgirdwood@gmail.com>", "Mark Brown <broonie@kernel.org>"

Any property defined as part of the core regulator binding, defined in regulator.txt, can also be used.

All of these rules must match (allOf) #

Rule 1 #

Shared schema rule ($ref): regulator.yaml#

Properties and child nodes (properties) #

compatible — required here #

Exact value (const): "regulator-gpio"

regulator-name — required here #

true — No constraints added by this property rule.

enable-gpios — not listed as required here #

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.

Maximum number of items (maxItems): 1

gpios — required here #

Array of one or more GPIO pins used to select the regulator voltage/current listed in "states".

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 8

gpios-states — not listed as required here #

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.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32-array

Minimum number of items (minItems): 1

Maximum number of items (maxItems): 8

Array item rules (items) #

Allowed values (enum): 0, 1

Default value (default): 0

states — required here #

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.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/uint32-matrix

Minimum number of items (minItems): 2

Maximum number of items (maxItems): 256

Array item rules (items) #

Array item rules (items)

Item 1

Voltage in microvolts

Item 2

GPIO group state value

startup-delay-us — not listed as required here #

startup time in microseconds

enable-active-high — not listed as required here #

Polarity of "enable-gpio" GPIO is active HIGH. Default is active LOW.

Value type (type): "boolean"

gpio-open-drain — not listed as required here #

GPIO is open drain type. If this property is missing then default assumption is false.

Value type (type): "boolean"

regulator-type — not listed as required here #

Specifies what is being regulated.

Shared schema rule ($ref): /schemas/types.yaml#/definitions/string

Allowed values (enum): "voltage", "current"

Default value (default): "voltage"

vin-supply — not listed as required here #

Input supply phandle.

Required in this object (required): "compatible", "regulator-name", "gpios", "states"

Properties not evaluated by applicable rules (unevaluatedProperties) #

false

Not allowed by this rule.

Examples (examples) #

gpio-regulator {
  compatible = "regulator-gpio";

  regulator-name = "mmci-gpio-supply";
  regulator-min-microvolt = <1800000>;
  regulator-max-microvolt = <2600000>;
  regulator-boot-on;

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

  startup-delay-us = <100000>;
  enable-active-high;
};

Source notes #

Annotations retained from the schema source

Line 1: SPDX-License-Identifier: GPL-2.0

Line 37: Should be enough...

Edit this page