Commit 0a9431fa authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull regulator updates from Mark Brown:
 "This is a relatively busy release for the regulator API, as well as a
  good collection of new drivers we've got a little bit of core work and
  a bunch of cleanup throughout the subsystem:

   - Support for propagating undervoltage events to child regulators

   - Undo enables done on supplies when setting enabling regulators via
     constraints fails

   - Pull in some gpiolib changes adding support for shared GPIOs to the
     gpiolib core, using them to replace the open coded variant of this
     that we've had in the regulator API for a long time

   - Support for Fitipower FP9931 and JD9330, Mediatek MT6316, MT6363
     and MT6373, NXP PF1550 and Qualcomm PMH01XX and PMCX0102

  The PF1550 support was originally going to go via the MFD tree but
  Krzysztof's cleanup work overlapped with it so I pulled in Lee's
  signed tag with support for the device"

* tag 'regulator-v6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (50 commits)
  regulator: fp9931: Fix spelling mistake "failid" -> "failed"
  regulator: core: Protect regulator_supply_alias_list with regulator_list_mutex
  regulator: pf9453: Constify pointers to 'regulator_desc' wrap struct
  regulator: pca9450: Constify pointers to 'regulator_desc' wrap struct
  regulator: mt6358: Constify pointers to 'regulator_desc' wrap struct
  regulator: bd96801: Constify pointers to 'regulator_desc' wrap struct
  regulator: bd718x7: Constify pointers to 'regulator_desc' wrap struct
  regulator: bd71828: Constify pointers to 'regulator_desc' wrap struct
  regulator: bd71815: Constify pointers to 'regulator_desc' wrap struct
  regulator: Use container_of_const() when all types are const
  regulator: pca9450: Fix error code in probe()
  regulator: qcomm-labibb: replace use of system_wq with system_dfl_wq
  regulator: Add FP9931/JD9930 driver
  dt-bindings: regulator: Add Fitipower FP9931/JD9930
  dt-bindings: vendor-prefixes: Add Fitipower
  regulator: make the subsystem aware of shared GPIOs
  regulator: renesas-usb-vbus-regulator: Remove unused headers
  regulator: pca9450: Add support for setting debounce settings
  regulator: dt-bindings: pca9540: add debounce timer configuration
  regulator: core: disable supply if enabling main regulator fails
  ...
parents ba1401f9 81d43113
Loading
Loading
Loading
Loading
+161 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/mfd/nxp,pf1550.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: NXP PF1550 Power Management IC

maintainers:
  - Samuel Kayode <samuel.kayode@savoirfairelinux.com>

description:
  PF1550 PMIC provides battery charging and power supply for low power IoT and
  wearable applications. This device consists of an i2c controlled MFD that
  includes regulators, battery charging and an onkey/power button.

$ref: /schemas/power/supply/power-supply.yaml

properties:
  compatible:
    const: nxp,pf1550

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  wakeup-source: true

  regulators:
    type: object
    additionalProperties: false

    patternProperties:
      "^(ldo[1-3]|sw[1-3]|vrefddr)$":
        type: object
        $ref: /schemas/regulator/regulator.yaml
        description:
          regulator configuration for ldo1-3, buck converters(sw1-3)
          and DDR termination reference voltage (vrefddr)
        unevaluatedProperties: false

  monitored-battery:
    description: |
      A phandle to a monitored battery node that contains a valid value
      for:
      constant-charge-voltage-max-microvolt.

  nxp,thermal-regulation-celsius:
    description:
      Temperature threshold for thermal regulation of charger in celsius.
    enum: [ 80, 95, 110, 125 ]

  nxp,min-system-microvolt:
    description:
      System specific lower limit voltage.
    enum: [ 3500000, 3700000, 4300000 ]

  nxp,disable-key-power:
    type: boolean
    description:
      Disable power-down using a long key-press. The onkey driver will remove
      support for the KEY_POWER key press when triggered using a long press of
      the onkey.

required:
  - compatible
  - reg
  - interrupts

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/input/linux-event-codes.h>

    battery: battery-cell {
        compatible = "simple-battery";
        constant-charge-voltage-max-microvolt = <4400000>;
    };

    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        pmic@8 {
            compatible = "nxp,pf1550";
            reg = <0x8>;

            interrupt-parent = <&gpio1>;
            interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
            wakeup-source;
            monitored-battery = <&battery>;
            nxp,min-system-microvolt = <4300000>;
            nxp,thermal-regulation-celsius = <80>;

            regulators {
                sw1_reg: sw1 {
                    regulator-name = "sw1";
                    regulator-min-microvolt = <600000>;
                    regulator-max-microvolt = <1387500>;
                    regulator-always-on;
                    regulator-ramp-delay = <6250>;

                    regulator-state-mem {
                        regulator-on-in-suspend;
                        regulator-suspend-min-microvolt = <1270000>;
                    };
                };

                sw2_reg: sw2 {
                    regulator-name = "sw2";
                    regulator-min-microvolt = <600000>;
                    regulator-max-microvolt = <1387500>;
                    regulator-always-on;

                    regulator-state-mem {
                        regulator-on-in-suspend;
                    };
                };

                sw3_reg: sw3 {
                    regulator-name = "sw3";
                    regulator-min-microvolt = <1800000>;
                    regulator-max-microvolt = <3300000>;
                    regulator-always-on;

                    regulator-state-mem {
                        regulator-on-in-suspend;
                    };
                };

                vldo1_reg: ldo1 {
                    regulator-name = "ldo1";
                    regulator-min-microvolt = <750000>;
                    regulator-max-microvolt = <3300000>;
                    regulator-always-on;

                    regulator-state-mem {
                        regulator-off-in-suspend;
                    };
                };

                vldo2_reg: ldo2 {
                    regulator-name = "ldo2";
                    regulator-min-microvolt = <1800000>;
                    regulator-max-microvolt = <3300000>;
                    regulator-always-on;
                };

                vldo3_reg: ldo3 {
                    regulator-name = "ldo3";
                    regulator-min-microvolt = <750000>;
                    regulator-max-microvolt = <3300000>;
                    regulator-always-on;
                };
            };
        };
    };
+0 −205
Original line number Diff line number Diff line
* Dialog Semiconductor DA9211/DA9212/DA9213/DA9223/DA9214/DA9224/DA9215/DA9225
 Voltage Regulator

Required properties:
- compatible: "dlg,da9211" or "dlg,da9212" or "dlg,da9213" or "dlg,da9223"
  or "dlg,da9214" or "dlg,da9224" or "dlg,da9215" or "dlg,da9225"
- reg: I2C slave address, usually 0x68.
- interrupts: the interrupt outputs of the controller
- regulators: A node that houses a sub-node for each regulator within the
  device. Each sub-node is identified using the node's name, with valid
  values listed below. The content of each sub-node is defined by the
  standard binding for regulators; see regulator.txt.
  BUCKA and BUCKB.

Optional properties:
- enable-gpios: platform gpio for control of BUCKA/BUCKB.
- Any optional property defined in regulator.txt
  - regulator-initial-mode and regulator-allowed-modes may be specified using
    mode values from dt-bindings/regulator/dlg,da9211-regulator.h

Example 1) DA9211
	pmic: da9211@68 {
		compatible = "dlg,da9211";
		reg = <0x68>;
		interrupts = <3 27>;

		regulators {
			BUCKA {
				regulator-name = "VBUCKA";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <2000000>;
				regulator-max-microamp 	= <5000000>;
				enable-gpios = <&gpio 27 0>;
				regulator-allowed-modes = <DA9211_BUCK_MODE_SYNC
							   DA9211_BUCK_MODE_AUTO>;
			};
		};
	};

Example 2) DA9212
	pmic: da9212@68 {
		compatible = "dlg,da9212";
		reg = <0x68>;
		interrupts = <3 27>;

		regulators {
			BUCKA {
				regulator-name = "VBUCKA";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <2000000>;
				regulator-max-microamp 	= <5000000>;
				enable-gpios = <&gpio 27 0>;
			};
			BUCKB {
				regulator-name = "VBUCKB";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <2000000>;
				regulator-max-microamp 	= <5000000>;
				enable-gpios = <&gpio 17 0>;
			};
		};
	};

Example 3) DA9213
	pmic: da9213@68 {
		compatible = "dlg,da9213";
		reg = <0x68>;
		interrupts = <3 27>;

		regulators {
			BUCKA {
				regulator-name = "VBUCKA";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <3000000>;
				regulator-max-microamp 	= <6000000>;
				enable-gpios = <&gpio 27 0>;
			};
		};
	};

Example 4) DA9223
	pmic: da9223@68 {
		compatible = "dlg,da9223";
		reg = <0x68>;
		interrupts = <3 27>;

		regulators {
			BUCKA {
				regulator-name = "VBUCKA";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <3000000>;
				regulator-max-microamp 	= <6000000>;
				enable-gpios = <&gpio 27 0>;
			};
		};
	};

Example 5) DA9214
	pmic: da9214@68 {
		compatible = "dlg,da9214";
		reg = <0x68>;
		interrupts = <3 27>;

		regulators {
			BUCKA {
				regulator-name = "VBUCKA";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <3000000>;
				regulator-max-microamp 	= <6000000>;
				enable-gpios = <&gpio 27 0>;
			};
			BUCKB {
				regulator-name = "VBUCKB";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <3000000>;
				regulator-max-microamp 	= <6000000>;
				enable-gpios = <&gpio 17 0>;
			};
		};
	};

Example 6) DA9224
	pmic: da9224@68 {
		compatible = "dlg,da9224";
		reg = <0x68>;
		interrupts = <3 27>;

		regulators {
			BUCKA {
				regulator-name = "VBUCKA";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <3000000>;
				regulator-max-microamp 	= <6000000>;
				enable-gpios = <&gpio 27 0>;
			};
			BUCKB {
				regulator-name = "VBUCKB";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <3000000>;
				regulator-max-microamp 	= <6000000>;
				enable-gpios = <&gpio 17 0>;
			};
		};
	};

Example 7) DA9215
	pmic: da9215@68 {
		compatible = "dlg,da9215";
		reg = <0x68>;
		interrupts = <3 27>;

		regulators {
			BUCKA {
				regulator-name = "VBUCKA";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <4000000>;
				regulator-max-microamp 	= <7000000>;
				enable-gpios = <&gpio 27 0>;
			};
			BUCKB {
				regulator-name = "VBUCKB";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <4000000>;
				regulator-max-microamp 	= <7000000>;
				enable-gpios = <&gpio 17 0>;
			};
		};
	};

Example 8) DA9225
	pmic: da9225@68 {
		compatible = "dlg,da9225";
		reg = <0x68>;
		interrupts = <3 27>;

		regulators {
			BUCKA {
				regulator-name = "VBUCKA";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <4000000>;
				regulator-max-microamp 	= <7000000>;
				enable-gpios = <&gpio 27 0>;
			};
			BUCKB {
				regulator-name = "VBUCKB";
				regulator-min-microvolt = < 300000>;
				regulator-max-microvolt = <1570000>;
				regulator-min-microamp 	= <4000000>;
				regulator-max-microamp 	= <7000000>;
				enable-gpios = <&gpio 17 0>;
			};
		};
	};
+103 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/dlg,da9211.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title:
  Dialog Semiconductor DA9211-9215, DA9223-9225 Voltage Regulators

maintainers:
  - Ariel D'Alessandro <ariel.dalessandro@collabora.com>

properties:
  compatible:
    enum:
      - dlg,da9211
      - dlg,da9212
      - dlg,da9213
      - dlg,da9214
      - dlg,da9215
      - dlg,da9223
      - dlg,da9224
      - dlg,da9225

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  regulators:
    type: object
    additionalProperties: false
    description:
      List of regulators provided by the device

    patternProperties:
      "^BUCK([AB])$":
        type: object
        $ref: regulator.yaml#
        unevaluatedProperties: false
        description:
          Properties for a single BUCK regulator

        properties:
          regulator-initial-mode:
            items:
              enum: [ 1, 2, 3 ]
            description:
              Defined in include/dt-bindings/regulator/dlg,da9211-regulator.h

          regulator-allowed-modes:
            items:
              enum: [ 1, 2, 3 ]
            description:
              Defined in include/dt-bindings/regulator/dlg,da9211-regulator.h

          enable-gpios:
            maxItems: 1

required:
  - compatible
  - reg
  - interrupts
  - regulators

additionalProperties: false

examples:
  - |
    #include <dt-bindings/regulator/dlg,da9211-regulator.h>

    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        regulator@68 {
            compatible = "dlg,da9212";
            reg = <0x68>;
            interrupts = <3 27>;

            regulators {
                BUCKA {
                    regulator-name = "VBUCKA";
                    regulator-min-microvolt = < 300000>;
                    regulator-max-microvolt = <1570000>;
                    regulator-min-microamp = <2000000>;
                    regulator-max-microamp = <5000000>;
                    enable-gpios = <&gpio 27 0>;
                };
                BUCKB {
                    regulator-name = "VBUCKB";
                    regulator-min-microvolt = < 300000>;
                    regulator-max-microvolt = <1570000>;
                    regulator-min-microamp = <2000000>;
                    regulator-max-microamp = <5000000>;
                    enable-gpios = <&gpio 17 0>;
                };
            };
        };
    };

...
+110 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/fitipower,fp9931.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: FitiPower FP9931/JD9930 Power Management Integrated Circuit

maintainers:
  - Andreas Kemnade <andreas@kemnade.info>

description:
  FP9931 is a Power Management IC to provide Power for EPDs with one 3.3V
  switch, 2 symmetric LDOs behind 2 DC/DC converters, and one unsymmetric
  regulator for a compensation voltage.
  JD9930 has in addition some kind of night mode.

properties:
  compatible:
    oneOf:
      - const: fitipower,fp9931

      - items:
          - const: fitipower,jd9930
          - const: fitipower,fp9931

  reg:
    maxItems: 1

  enable-gpios:
    maxItems: 1

  pg-gpios:
    maxItems: 1

  en-ts-gpios:
    maxItems: 1

  xon-gpios:
    maxItems: 1

  vin-supply:
    description:
      Supply for the whole chip. Some vendor kernels and devicetrees
      declare this as a non-existing GPIO named "pwrall".

  fitipower,tdly-ms:
    description:
      Power up soft start delay settings tDLY1-4 bitfields in the
      POWERON_DELAY register
    items:
      - enum: [0, 1, 2, 4]
      - enum: [0, 1, 2, 4]
      - enum: [0, 1, 2, 4]
      - enum: [0, 1, 2, 4]

  regulators:
    type: object
    additionalProperties: false
    patternProperties:
      "^(vcom|vposneg|v3p3)$":
        unevaluatedProperties: false
        type: object
        $ref: /schemas/regulator/regulator.yaml

required:
  - compatible
  - reg
  - pg-gpios
  - enable-gpios

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        pmic@18 {
            compatible = "fitipower,fp9931";
            reg = <0x18>;
            pinctrl-names = "default";
            pinctrl-0 = <&pinctrl_fp9931_gpio>;
            vin-supply = <&epd_pmic_supply>;
            pg-gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>;
            en-ts-gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>;
            enable-gpios = <&gpio2 8 GPIO_ACTIVE_HIGH>;
            fitipower,tdly-ms = <2 2 4 4>;

            regulators {
                vcom {
                    regulator-name = "vcom";
                    regulator-min-microvolt = <2352840>;
                    regulator-max-microvolt = <2352840>;
                };

                vposneg {
                    regulator-name = "vposneg";
                    regulator-min-microvolt = <15060000>;
                    regulator-max-microvolt = <15060000>;
                };

                v3p3 {
                    regulator-name = "v3p3";
                };
            };
        };
    };
+76 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/mediatek,mt6316b-regulator.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: MediaTek MT6316 BP/VP SPMI PMIC Regulators

maintainers:
  - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

description:
  The MediaTek MT6316BP/VP PMICs are fully controlled by SPMI interface, both
  feature four step-down DC/DC (buck) converters, and provides 2+2 Phases,
  joining Buck 1+2 for the first phase, and Buck 3+4 for the second phase.

properties:
  compatible:
    const: mediatek,mt6316b-regulator

  reg:
    maxItems: 1

patternProperties:
  "^vbuck(12|34)$":
    type: object
    $ref: regulator.yaml#
    unevaluatedProperties: false
    properties:
      regulator-allowed-modes:
        description: |
          Allowed Buck regulator operating modes allowed. Valid values below.
            0 - Normal mode with automatic power saving, reducing the switching
                frequency when light load conditions are detected
            1 - Forced Continuous Conduction mode (FCCM) for improved voltage
                regulation accuracy with constant switching frequency but lower
                regulator efficiency
            2 - Forced Low Power mode for improved regulator efficiency, used
                when no heavy load is expected, will shut down unnecessary IP
                blocks and secondary phases to reduce quiescent current.
                This mode does not limit the maximum output current but unless
                only a light load is applied, there will be regulation accuracy
                and efficiency losses.
        minItems: 1
        maxItems: 3
        items:
          enum: [ 0, 1, 2 ]

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    #include <dt-bindings/spmi/spmi.h>

    spmi {
      #address-cells = <2>;
      #size-cells = <0>;

      pmic@8 {
        compatible = "mediatek,mt6316b-regulator";
        reg = <0x8 SPMI_USID>;

        vbuck12 {
          regulator-name = "dvdd_core";
          regulator-min-microvolt = <450000>;
          regulator-max-microvolt = <965000>;
          regulator-allowed-modes = <0 1 2>;
          regulator-enable-ramp-delay = <256>;
        };
      };
    };
...
Loading