Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 65244e5b authored by Mark Brown's avatar Mark Brown
Browse files

Merge branch 'regulator-5.3' into regulator-next

parents f0386617 3c7577d4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5,7 +5,8 @@ of analogue I/O.

This document lists regulator specific bindings, see the primary binding
document:
  ../mfd/arizona.txt
  For Wolfson Microelectronic Arizona codecs: ../mfd/arizona.txt
  For Cirrus Logic Madera codecs: ../mfd/madera.txt

Optional properties:
  - wlf,ldoena : GPIO specifier for the GPIO controlling LDOENA
+4 −1
Original line number Diff line number Diff line
@@ -12,10 +12,13 @@ maintainers:

description:
  Any property defined as part of the core regulator binding, defined in
  regulator.txt, can also be used. However a fixed voltage regulator is
  regulator.yaml, can also be used. However a fixed voltage regulator is
  expected to have the regulator-min-microvolt and regulator-max-microvolt
  to be the same.

allOf:
  - $ref: "regulator.yaml#"

properties:
  compatible:
    const: regulator-fixed
+0 −57
Original line number Diff line number Diff line
GPIO controlled regulators

Required properties:
- compatible		: Must be "regulator-gpio".
- regulator-name	: Defined in regulator.txt as optional, but required
			  here.
- gpios			: Array of one or more GPIO pins used to select the
			  regulator voltage/current listed in "states".
- states		: 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.

Optional properties:
- enable-gpios		: GPIO used 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.
- enable-active-high	: Polarity of "enable-gpio" GPIO is active HIGH.
			  Default is active LOW.
- gpios-states		: 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.
- startup-delay-us	: Startup time in microseconds.
- regulator-type	: Specifies what is being regulated, must be either
			  "voltage" or "current", defaults to voltage.

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

Example:

	mmciv: 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;
	};
+118 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/gpio-regulator.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: GPIO controlled regulators

maintainers:
  - Liam Girdwood <lgirdwood@gmail.com>
  - Mark Brown <broonie@kernel.org>

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

allOf:
  - $ref: "regulator.yaml#"

properties:
  compatible:
    const: regulator-gpio

  regulator-name: true

  enable-gpios:
    description: 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.
    maxItems: 1

  gpios:
    description: Array of one or more GPIO pins used to select the regulator
      voltage/current listed in "states".
    minItems: 1
    maxItems: 8  # Should be enough...

  gpios-states:
    description: |
      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.
    allOf:
      - $ref: /schemas/types.yaml#/definitions/uint32-array
      - maxItems: 8
        items:
          enum: [ 0, 1 ]
          default: 0

  states:
    description: 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.
    allOf:
      - $ref: /schemas/types.yaml#/definitions/uint32-matrix
      - maxItems: 8
        items:
          items:
            - description: Voltage in microvolts
            - description: GPIO group state value

  startup-delay-us:
    description: startup time in microseconds

  enable-active-high:
    description: Polarity of "enable-gpio" GPIO is active HIGH. Default is
      active LOW.
    type: boolean

  gpio-open-drain:
    description:
      GPIO is open drain type. If this property is missing then default
      assumption is false.
    type: boolean

  regulator-type:
    description: Specifies what is being regulated.
    allOf:
      - $ref: /schemas/types.yaml#/definitions/string
      - enum:
          - voltage
          - current
        default: voltage

required:
  - compatible
  - regulator-name
  - gpios
  - states

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;
    };
...
+0 −47
Original line number Diff line number Diff line
Maxim MAX8660 voltage regulator

Required properties:
- compatible: must be one of "maxim,max8660", "maxim,max8661"
- reg: I2C slave address, usually 0x34
- any required generic properties defined in regulator.txt

Example:

	i2c_master {
		max8660@34 {
			compatible = "maxim,max8660";
			reg = <0x34>;

			regulators {
				regulator@0 {
					regulator-compatible= "V3(DCDC)";
					regulator-min-microvolt = <725000>;
					regulator-max-microvolt = <1800000>;
				};

				regulator@1 {
					regulator-compatible= "V4(DCDC)";
					regulator-min-microvolt = <725000>;
					regulator-max-microvolt = <1800000>;
				};

				regulator@2 {
					regulator-compatible= "V5(LDO)";
					regulator-min-microvolt = <1700000>;
					regulator-max-microvolt = <2000000>;
				};

				regulator@3 {
					regulator-compatible= "V6(LDO)";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <3300000>;
				};

				regulator@4 {
					regulator-compatible= "V7(LDO)";
					regulator-min-microvolt = <1800000>;
					regulator-max-microvolt = <3300000>;
				};
			};
		};
	};
Loading