Skip to content

Commit

Permalink
Merge tag 'regulator-v4.21' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/broonie/regulator

Pull regulator updates from Mark Brown:
 "This has been a very busy release for the core, some fixes, one large
  new feature and a big bit of refactoring to update the GPIO API:

   - Support for coupled regulators from Dmitry Osipenko based on a
     prior attempt by Maciej Purski, allowing us to handle situations
     where the voltages on two regulators can't be too far apart from
     each other.

   - Conversion of the GPIO support in both drivers and the core to use
     GPIO descriptors rather than numbers, part of the overall project
     to remove GPIO numbers.

   - Support for standby mode suspend states from Andrei Stefanescu.

   - New drivers for Allwinner AXP209, Cirrus Logic Lochnagar and
     Microchip MPC16502"

* tag 'regulator-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (90 commits)
  regulator: tps65910: fix a missing check of return value
  regulator: mcp16502: Select REGMAP_I2C to fix build error
  regulator: convert to DEFINE_SHOW_ATTRIBUTE
  regulator: mcp16502: Fix missing n_voltages setting
  regulator: mcp16502: Use #ifdef CONFIG_PM_SLEEP around mcp16502_suspend/resume_noirq
  regulator: mcp16502: code cleanup
  regulator: act8945a-regulator: make symbol act8945a_pm static
  drivers/regulator: fix a missing check of return value
  regulator: act8945a-regulator: fix 'defined but not used' compiler warning
  regulator: axp20x: fix set_ramp_delay for AXP209/dcdc2
  regulator: mcp16502: add support for suspend
  mfd: axp20x: use explicit bit defines
  mfd: axp20x: Clean up included headers
  regulator: dts: enable soft-start and ramp delay for the OLinuXino Lime2
  dt-bindings: mfd: axp20x: Add software based soft_start for AXP209 LDO3
  regulator: axp20x: add software based soft_start for AXP209 LDO3
  dt-bindings: mfd: axp20x: add support for regulator-ramp-delay for AXP209
  regulator: axp20x: add support for set_ramp_delay for AXP209
  mfd: axp20x: name voltage ramping define properly
  regulator: mcp16502: add regulator driver for MCP16502
  ...
  • Loading branch information
Linus Torvalds committed Dec 25, 2018
2 parents d923fd6 + c3b5725 commit 79f2077
Show file tree
Hide file tree
Showing 59 changed files with 3,141 additions and 635 deletions.
9 changes: 9 additions & 0 deletions Documentation/devicetree/bindings/mfd/axp20x.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ Required properties:
- interrupt-controller: The PMIC has its own internal IRQs
- #interrupt-cells: Should be set to 1

Supported common regulator properties, see ../regulator/regulator.txt for
more information:
- regulator-ramp-delay: sets the ramp up delay in uV/us
AXP20x/DCDC2: 1600, 800
AXP20x/LDO3: 1600, 800
- regulator-soft-start: enable the output at the lowest possible voltage and
only then set the desired voltage
AXP20x/LDO3: software-based implementation

Optional properties:
- x-powers,dcdc-freq: defines the work frequency of DC-DC in KHz
AXP152/20X: range: 750-1875, Default: 1.5 MHz
Expand Down
34 changes: 34 additions & 0 deletions Documentation/devicetree/bindings/regulator/act8945a-regulator.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@ Optional input supply properties:
- inl67-supply: The input supply for REG_LDO3 and REG_LDO4

Any standard regulator properties can be used to configure the single regulator.
regulator-initial-mode, regulator-allowed-modes and regulator-mode could be
specified using mode values from dt-bindings/regulator/active-semi,8945a-regulator.h
file.

The valid names for regulators are:
REG_DCDC1, REG_DCDC2, REG_DCDC3, REG_LDO1, REG_LDO2, REG_LDO3, REG_LDO4.

Example:

#include <dt-bindings/regulator/active-semi,8945a-regulator.h>

pmic@5b {
compatible = "active-semi,act8945a";
reg = <0x5b>;
Expand All @@ -32,13 +38,33 @@ Example:
regulator-min-microvolt = <1350000>;
regulator-max-microvolt = <1350000>;
regulator-always-on;

regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_FIXED>,
<ACT8945A_REGULATOR_MODE_LOWPOWER>;
regulator-initial-mode = <ACT8945A_REGULATOR_MODE_FIXED>;

regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-min-microvolt=<1400000>;
regulator-suspend-max-microvolt=<1400000>;
regulator-changeable-in-suspend;
regulator-mode=<ACT8945A_REGULATOR_MODE_LOWPOWER>;
};
};

vdd_1v2_reg: REG_DCDC2 {
regulator-name = "VDD_1V2";
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <1300000>;
regulator-always-on;

regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_FIXED>,
<ACT8945A_REGULATOR_MODE_LOWPOWER>;
regulator-initial-mode = <ACT8945A_REGULATOR_MODE_FIXED>;

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

vdd_3v3_reg: REG_DCDC3 {
Expand All @@ -53,6 +79,14 @@ Example:
regulator-min-microvolt = <2500000>;
regulator-max-microvolt = <2500000>;
regulator-always-on;

regulator-allowed-modes = <ACT8945A_REGULATOR_MODE_NORMAL>,
<ACT8945A_REGULATOR_MODE_LOWPOWER>;
regulator-initial-mode = <ACT8945A_REGULATOR_MODE_NORMAL>;

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

vdd_3v3_lp_reg: REG_LDO2 {
Expand Down
82 changes: 82 additions & 0 deletions Documentation/devicetree/bindings/regulator/cirrus,lochnagar.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
Cirrus Logic Lochnagar Audio Development Board

Lochnagar is an evaluation and development board for Cirrus Logic
Smart CODEC and Amp devices. It allows the connection of most Cirrus
Logic devices on mini-cards, as well as allowing connection of
various application processor systems to provide a full evaluation
platform. Audio system topology, clocking and power can all be
controlled through the Lochnagar, allowing the device under test
to be used in a variety of possible use cases.

This binding document describes the binding for the regulator portion
of the driver.

Also see these documents for generic binding information:
[1] Regulator: ../regulator/regulator.txt

This binding must be part of the Lochnagar MFD binding:
[2] ../mfd/cirrus,lochnagar.txt

Optional sub-nodes:

- VDDCORE : Initialisation data for the VDDCORE regulator, which
supplies the CODECs digital core if it has no build regulator for that
purpose.
Required Properties:
- compatible : One of the following strings:
"cirrus,lochnagar2-vddcore"
- SYSVDD-supply: Primary power supply for the Lochnagar.

- MICVDD : Initialisation data for the MICVDD regulator, which
supplies the CODECs MICVDD.
Required Properties:
- compatible : One of the following strings:
"cirrus,lochnagar2-micvdd"
- SYSVDD-supply: Primary power supply for the Lochnagar.

- MIC1VDD, MIC2VDD : Initialisation data for the MICxVDD supplies.
Required Properties:
- compatible : One of the following strings:
"cirrus,lochnagar2-mic1vdd", "cirrus,lochnagar2-mic2vdd"
Optional Properties:
- cirrus,micbias-input : A property selecting which of the CODEC
minicard micbias outputs should be used, valid values are 1 - 4.
- MICBIAS1-supply, MICBIAS2-supply: Regulator supplies for the
MICxVDD outputs, supplying the digital microphones, normally
supplied from the attached CODEC.

- VDD1V8 : Recommended fixed regulator for the VDD1V8 regulator, which supplies the
CODECs analog and 1.8V digital supplies.
Required Properties:
- compatible : Should be set to "regulator-fixed"
- regulator-min-microvolt : Should be set to 1.8V
- regulator-max-microvolt : Should be set to 1.8V
- regulator-boot-on
- regulator-always-on
- vin-supply : Should be set to same supply as SYSVDD

Example:

lochnagar {
lochnagar-micvdd: MICVDD {
compatible = "cirrus,lochnagar2-micvdd";

SYSVDD-supply = <&wallvdd>;

regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};

lochnagar-vdd1v8: VDD1V8 {
compatible = "regulator-fixed";

regulator-name = "VDD1V8";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-boot-on;
regulator-always-on;

vin-supply = <&wallvdd>;
};
};

143 changes: 143 additions & 0 deletions Documentation/devicetree/bindings/regulator/mcp16502-regulator.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
MCP16502 PMIC

Required properties:
- compatible: "microchip,mcp16502"
- reg: I2C slave address
- lpm-gpios: GPIO for LPM pin. Note that this GPIO *must* remain high during
suspend-to-ram, keeping the PMIC into HIBERNATE mode.
- regulators: A node that houses a sub-node for each regulator within
the device. Each sub-node is identified using the node's
name. The content of each sub-node is defined by the
standard binding for regulators; see regulator.txt.

Regualtors of MCP16502 PMIC:
1) VDD_IO - Buck (1.2 - 3.7 V)
2) VDD_DDR - Buck (0.6 - 1.85 V)
3) VDD_CORE - Buck (0.6 - 1.85 V)
4) VDD_OTHER - BUCK (0.6 - 1.85 V)
5) LDO1 - LDO (1.2 - 3.7 V)
6) LDO2 - LDO (1.2 - 3.7 V)

Regulator modes:
2 - FPWM: higher precision, higher consumption
4 - AutoPFM: lower precision, lower consumption

Each regulator is defined using the standard binding for regulators.

Example:

mcp16502@5b {
compatible = "microchip,mcp16502";
reg = <0x5b>;
status = "okay";
lpm-gpios = <&pioBU 7 GPIO_ACTIVE_HIGH>;

regulators {
VDD_IO {
regulator-name = "VDD_IO";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <3700000>;
regulator-initial-mode = <2>;
regulator-allowed-modes = <2>, <4>;
regulator-always-on;

regulator-state-standby {
regulator-on-in-suspend;
regulator-mode = <4>;
};

regulator-state-mem {
regulator-off-in-suspend;
regulator-mode = <4>;
};
};

VDD_DDR {
regulator-name = "VDD_DDR";
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <1850000>;
regulator-initial-mode = <2>;
regulator-allowed-modes = <2>, <4>;
regulator-always-on;

regulator-state-standby {
regulator-on-in-suspend;
regulator-mode = <4>;
};

regulator-state-mem {
regulator-on-in-suspend;
regulator-mode = <4>;
};
};

VDD_CORE {
regulator-name = "VDD_CORE";
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <1850000>;
regulator-initial-mode = <2>;
regulator-allowed-modes = <2>, <4>;
regulator-always-on;

regulator-state-standby {
regulator-on-in-suspend;
regulator-mode = <4>;
};

regulator-state-mem {
regulator-off-in-suspend;
regulator-mode = <4>;
};
};

VDD_OTHER {
regulator-name = "VDD_OTHER";
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <1850000>;
regulator-initial-mode = <2>;
regulator-allowed-modes = <2>, <4>;
regulator-always-on;

regulator-state-standby {
regulator-on-in-suspend;
regulator-mode = <4>;
};

regulator-state-mem {
regulator-off-in-suspend;
regulator-mode = <4>;
};
};

LDO1 {
regulator-name = "LDO1";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <3700000>;
regulator-always-on;

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

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

LDO2 {
regulator-name = "LDO2";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <3700000>;
regulator-always-on;

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

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

};
};
12 changes: 9 additions & 3 deletions Documentation/devicetree/bindings/regulator/regulator.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@ Optional properties:
decreases of any level. This is useful for regulators with exponential
voltage changes.
- regulator-soft-start: Enable soft start so that voltage ramps slowly
- regulator-state-standby sub-root node for Standby mode
: equivalent with standby Linux sleep state, which provides energy savings
with a relatively quick transition back time.
- regulator-state-mem sub-root node for Suspend-to-RAM mode
: suspend to memory, the device goes to sleep, but all data stored in memory,
only some external interrupt can wake the device.
- regulator-state-disk sub-root node for Suspend-to-DISK mode
: suspend to disk, this state operates similarly to Suspend-to-RAM,
but includes a final step of writing memory contents to disk.
- regulator-state-[mem/disk] node has following common properties:
- regulator-state-[mem/disk/standby] node has following common properties:
- regulator-on-in-suspend: regulator should be on in suspend state.
- regulator-off-in-suspend: regulator should be off in suspend state.
- regulator-suspend-min-microvolt: minimum voltage may be set in
Expand Down Expand Up @@ -76,8 +79,11 @@ Optional properties:
- regulator-coupled-with: Regulators with which the regulator
is coupled. The linkage is 2-way - all coupled regulators should be linked
with each other. A regulator should not be coupled with its supplier.
- regulator-coupled-max-spread: Max spread between voltages of coupled regulators
in microvolts.
- regulator-coupled-max-spread: Array of maximum spread between voltages of
coupled regulators in microvolts, each value in the array relates to the
corresponding couple specified by the regulator-coupled-with property.
- regulator-max-step-microvolt: Maximum difference between current and target
voltages that can be changed safely in a single step.

Deprecated properties:
- regulator-compatible: If a regulator chip contains multiple
Expand Down
1 change: 1 addition & 0 deletions Documentation/driver-model/devres.txt
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ GPIO
devm_gpiod_get_index_optional()
devm_gpiod_get_optional()
devm_gpiod_put()
devm_gpiod_unhinge()
devm_gpiochip_add_data()
devm_gpiochip_remove()
devm_gpio_request()
Expand Down
7 changes: 7 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -9891,6 +9891,13 @@ M: Ludovic Desroches <ludovic.desroches@microchip.com>
S: Maintained
F: drivers/mmc/host/atmel-mci.c

MICROCHIP MCP16502 PMIC DRIVER
M: Andrei Stefanescu <andrei.stefanescu@microchip.com>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S: Maintained
F: Documentation/devicetree/bindings/regulator/mcp16502-regulator.txt
F: drivers/regulator/mcp16502.c

MICROCHIP MCP3911 ADC DRIVER
M: Marcus Folkesson <marcus.folkesson@gmail.com>
M: Kent Gustavsson <kent@minoris.se>
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
regulator-name = "vddio-csi0";
regulator-soft-start;
regulator-ramp-delay = <1600>;
};

&reg_ldo4 {
Expand Down
Loading

0 comments on commit 79f2077

Please sign in to comment.