Skip to content

Commit

Permalink
Merge tag 'regulator-v4.18' 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:
 "Quite a lot of core work this time around, though not 100% successful.

  We gained support for runtime mode changes thanks to David Collins and
  improved support for write only regulators (ones where we can't read
  back the configuration) from Douglas Anderson.

  There's been quite a bit of work from Linus Walleij on converting from
  specfying GPIOs by numbers to descriptors. Sadly the testing turned
  out to be less good than we had hoped and so a lot of this had to be
  reverted.

  We also have the start of updates to use coupled regulators from
  Maciej Purski, unfortunately there are further problems there so the
  last couple of patches have been reverted.

  We also have new drivers for BD71837 and SY8106A devices, SAW
  regulators on Qualcomm SPMI and dropped support for some preproduction
  chips that never made it to market from the AB8500 driver"

* tag 'regulator-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (57 commits)
  regulator: gpio: Revert
  ARM: pxa, regulator: fix building ezx e680
  regulator: Revert coupled regulator support again
  regulator: wm8994: Fix shared GPIOs
  regulator: max77686: Fix shared GPIOs
  regulator: bd71837: BD71837 PMIC regulator driver
  regulator: bd71837: Devicetree bindings for BD71837 regulators
  regulator: gpio: Get enable GPIO using GPIO descriptor
  regulator: fixed: Convert to use GPIO descriptor only
  regulator: s2mps11: Fix boot on Odroid XU3
  dt-bindings: qcom_spmi: Document SAW support
  regulator: qcom_spmi: Add support for SAW
  regulator: tps65090: Pass descriptor instead of GPIO number
  regulator: s5m8767: Pass descriptor instead of GPIO number
  regulator: pfuze100: Delete reference to ena_gpio
  regulator: max8952: Pass descriptor instead of GPIO number
  regulator: lp8788-ldo: Pass descriptor instead of GPIO number
  regulator: lm363x: Pass descriptor instead of GPIO number
  regulator: max8973: Pass descriptor instead of GPIO number
  regulator: mc13xxx-core: Switch to SPDX identifier
  ...
  • Loading branch information
torvalds committed Jun 8, 2018
2 parents 410feb7 + 13ed496 commit 68cc38f
Show file tree
Hide file tree
Showing 51 changed files with 2,196 additions and 2,035 deletions.
3 changes: 2 additions & 1 deletion Documentation/devicetree/bindings/mfd/axp20x.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Optional properties:
regulator to drive the OTG VBus, rather then
as an input pin which signals whether the
board is driving OTG VBus or not.
(axp221 / axp223 / axp813 only)
(axp221 / axp223 / axp803/ axp813 only)

- x-powers,master-mode: Boolean (axp806 only). Set this when the PMIC is
wired for master mode. The default is slave mode.
Expand Down Expand Up @@ -132,6 +132,7 @@ FLDO2 : LDO : fldoin-supply : shared supply
LDO_IO0 : LDO : ips-supply : GPIO 0
LDO_IO1 : LDO : ips-supply : GPIO 1
RTC_LDO : LDO : ips-supply : always on
DRIVEVBUS : Enable output : drivevbus-supply : external regulator

AXP806 regulators, type, and corresponding input supply names:

Expand Down
21 changes: 21 additions & 0 deletions Documentation/devicetree/bindings/mfd/bd9571mwv.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ Required properties:
Each child node is defined using the standard
binding for regulators.

Optional properties:
- rohm,ddr-backup-power : Value to use for DDR-Backup Power (default 0).
This is a bitmask that specifies which DDR power
rails need to be kept powered when backup mode is
entered, for system suspend:
- bit 0: DDR0
- bit 1: DDR1
- bit 2: DDR0C
- bit 3: DDR1C
These bits match the KEEPON_DDR* bits in the
documentation for the "BKUP Mode Cnt" register.
- rohm,rstbmode-level: The RSTB signal is configured for level mode, to
accommodate a toggle power switch (the RSTBMODE pin is
strapped low).
- rohm,rstbmode-pulse: The RSTB signal is configured for pulse mode, to
accommodate a momentary power switch (the RSTBMODE pin
is strapped high).
The two properties above are mutually exclusive.

Example:

pmic: pmic@30 {
Expand All @@ -36,6 +55,8 @@ Example:
#interrupt-cells = <2>;
gpio-controller;
#gpio-cells = <2>;
rohm,ddr-backup-power = <0xf>;
rohm,rstbmode-pulse;

regulators {
dvfs: dvfs {
Expand Down
6 changes: 3 additions & 3 deletions Documentation/devicetree/bindings/regulator/pfuze100.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Each regulator is defined using the standard binding for regulators.

Example 1: PFUZE100

pmic: pfuze100@8 {
pfuze100: pmic@8 {
compatible = "fsl,pfuze100";
reg = <0x08>;

Expand Down Expand Up @@ -122,7 +122,7 @@ Example 1: PFUZE100

Example 2: PFUZE200

pmic: pfuze200@8 {
pfuze200: pmic@8 {
compatible = "fsl,pfuze200";
reg = <0x08>;

Expand Down Expand Up @@ -216,7 +216,7 @@ Example 2: PFUZE200

Example 3: PFUZE3000

pmic: pfuze3000@8 {
pfuze3000: pmic@8 {
compatible = "fsl,pfuze3000";
reg = <0x08>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ Qualcomm SPMI Regulators
Definition: Reference to regulator supplying the input pin, as
described in the data sheet.

- qcom,saw-reg:
Usage: optional
Value type: <phandle>
Description: Reference to syscon node defining the SAW registers.


The regulator node houses sub-nodes for each regulator within the device. Each
sub-node is identified using the node's name, with valid values listed for each
Expand Down Expand Up @@ -201,6 +206,17 @@ see regulator.txt - with additional custom properties described below:
2 = 0.55 uA
3 = 0.75 uA

- qcom,saw-slave:
Usage: optional
Value type: <boo>
Description: SAW controlled gang slave. Will not be configured.

- qcom,saw-leader:
Usage: optional
Value type: <boo>
Description: SAW controlled gang leader. Will be configured as
SAW regulator.

Example:

regulators {
Expand All @@ -221,3 +237,32 @@ Example:

....
};

Example 2:

saw3: syscon@9A10000 {
compatible = "syscon";
reg = <0x9A10000 0x1000>;
};

...

spm-regulators {
compatible = "qcom,pm8994-regulators";
qcom,saw-reg = <&saw3>;
s8 {
qcom,saw-slave;
};
s9 {
qcom,saw-slave;
};
s10 {
qcom,saw-slave;
};
pm8994_s11_saw: s11 {
qcom,saw-leader;
regulator-always-on;
regulator-min-microvolt = <900000>;
regulator-max-microvolt = <1140000>;
};
};
10 changes: 10 additions & 0 deletions Documentation/devicetree/bindings/regulator/regulator.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ Optional properties:
- regulator-initial-mode: initial operating mode. The set of possible operating
modes depends on the capabilities of every hardware so each device binding
documentation explains which values the regulator supports.
- regulator-allowed-modes: list of operating modes that software is allowed to
configure for the regulator at run-time. Elements may be specified in any
order. The set of possible operating modes depends on the capabilities of
every hardware so each device binding document explains which values the
regulator supports.
- regulator-system-load: Load in uA present on regulator that is not captured by
any consumer request.
- regulator-pull-down: Enable pull down resistor when the regulator is disabled.
Expand All @@ -68,6 +73,11 @@ Optional properties:
0: Disable active discharge.
1: Enable active discharge.
Absence of this property will leave configuration to default.
- 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.

Deprecated properties:
- regulator-compatible: If a regulator chip contains multiple
Expand Down
126 changes: 126 additions & 0 deletions Documentation/devicetree/bindings/regulator/rohm,bd71837-regulator.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
ROHM BD71837 Power Management Integrated Circuit (PMIC) regulator bindings

BD71837MWV is a programmable Power Management
IC (PMIC) for powering single-core, dual-core, and
quad-core SoC’s such as NXP-i.MX 8M. It is optimized
for low BOM cost and compact solution footprint. It
integrates 8 Buck regulators and 7 LDO’s to provide all
the power rails required by the SoC and the commonly
used peripherals.

Required properties:
- regulator-name: should be "buck1", ..., "buck8" and "ldo1", ..., "ldo7"

List of regulators provided by this controller. BD71837 regulators node
should be sub node of the BD71837 MFD node. See BD71837 MFD bindings at
Documentation/devicetree/bindings/mfd/rohm,bd71837-pmic.txt
Regulator nodes should be named to BUCK_<number> and LDO_<number>. The
definition for each of these nodes is defined using the standard
binding for regulators at
Documentation/devicetree/bindings/regulator/regulator.txt.
Note that if BD71837 starts at RUN state you probably want to use
regulator-boot-on at least for BUCK6 and BUCK7 so that those are not
disabled by driver at startup. LDO5 and LDO6 are supplied by those and
if they are disabled at startup the voltage monitoring for LDO5/LDO6 will
cause PMIC to reset.

The valid names for regulator nodes are:
BUCK1, BUCK2, BUCK3, BUCK4, BUCK5, BUCK6, BUCK7, BUCK8
LDO1, LDO2, LDO3, LDO4, LDO5, LDO6, LDO7

Optional properties:
- Any optional property defined in bindings/regulator/regulator.txt

Example:
regulators {
buck1: BUCK1 {
regulator-name = "buck1";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1300000>;
regulator-boot-on;
regulator-ramp-delay = <1250>;
};
buck2: BUCK2 {
regulator-name = "buck2";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1300000>;
regulator-boot-on;
regulator-always-on;
regulator-ramp-delay = <1250>;
};
buck3: BUCK3 {
regulator-name = "buck3";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1300000>;
regulator-boot-on;
};
buck4: BUCK4 {
regulator-name = "buck4";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1300000>;
regulator-boot-on;
};
buck5: BUCK5 {
regulator-name = "buck5";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <1350000>;
regulator-boot-on;
};
buck6: BUCK6 {
regulator-name = "buck6";
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
};
buck7: BUCK7 {
regulator-name = "buck7";
regulator-min-microvolt = <1605000>;
regulator-max-microvolt = <1995000>;
regulator-boot-on;
};
buck8: BUCK8 {
regulator-name = "buck8";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <1400000>;
};

ldo1: LDO1 {
regulator-name = "ldo1";
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
};
ldo2: LDO2 {
regulator-name = "ldo2";
regulator-min-microvolt = <900000>;
regulator-max-microvolt = <900000>;
regulator-boot-on;
};
ldo3: LDO3 {
regulator-name = "ldo3";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
};
ldo4: LDO4 {
regulator-name = "ldo4";
regulator-min-microvolt = <900000>;
regulator-max-microvolt = <1800000>;
};
ldo5: LDO5 {
regulator-name = "ldo5";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
};
ldo6: LDO6 {
regulator-name = "ldo6";
regulator-min-microvolt = <900000>;
regulator-max-microvolt = <1800000>;
};
ldo7_reg: LDO7 {
regulator-name = "ldo7";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
};
};


23 changes: 23 additions & 0 deletions Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
SY8106A Voltage regulator

Required properties:
- compatible: Must be "silergy,sy8106a"
- reg: I2C slave address - must be <0x65>
- silergy,fixed-microvolt - the voltage when I2C regulating is disabled (set
by external resistor like a fixed voltage)

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

Example:

sy8106a {
compatible = "silergy,sy8106a";
reg = <0x65>;
regulator-name = "sy8106a-vdd";
silergy,fixed-microvolt = <1200000>;
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <1400000>;
regulator-boot-on;
regulator-always-on;
};
6 changes: 6 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -13609,6 +13609,12 @@ S: Supported
F: net/switchdev/
F: include/net/switchdev.h

SY8106A REGULATOR DRIVER
M: Icenowy Zheng <icenowy@aosc.io>
S: Maintained
F: drivers/regulator/sy8106a-regulator.c
F: Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt

SYNC FILE FRAMEWORK
M: Sumit Semwal <sumit.semwal@linaro.org>
R: Gustavo Padovan <gustavo@padovan.org>
Expand Down
28 changes: 22 additions & 6 deletions arch/arm/mach-s3c64xx/mach-crag6410-module.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/spi/spi.h>
#include <linux/gpio/machine.h>

#include <linux/mfd/wm831x/irq.h>
#include <linux/mfd/wm831x/gpio.h>
Expand Down Expand Up @@ -206,9 +207,6 @@ static const struct i2c_board_info wm1277_devs[] = {
};

static struct arizona_pdata wm5102_reva_pdata = {
.ldo1 = {
.ldoena = S3C64XX_GPN(7),
},
.gpio_base = CODEC_GPIO_BASE,
.irq_flags = IRQF_TRIGGER_HIGH,
.micd_pol_gpio = CODEC_GPIO_BASE + 4,
Expand Down Expand Up @@ -237,10 +235,16 @@ static struct spi_board_info wm5102_reva_spi_devs[] = {
},
};

static struct arizona_pdata wm5102_pdata = {
.ldo1 = {
.ldoena = S3C64XX_GPN(7),
static struct gpiod_lookup_table wm5102_reva_gpiod_table = {
.dev_id = "spi0.1", /* SPI device name */
.table = {
GPIO_LOOKUP("GPION", 7,
"wlf,ldoena", GPIO_ACTIVE_HIGH),
{ },
},
};

static struct arizona_pdata wm5102_pdata = {
.gpio_base = CODEC_GPIO_BASE,
.irq_flags = IRQF_TRIGGER_HIGH,
.micd_pol_gpio = CODEC_GPIO_BASE + 2,
Expand All @@ -264,6 +268,15 @@ static struct spi_board_info wm5102_spi_devs[] = {
},
};

static struct gpiod_lookup_table wm5102_gpiod_table = {
.dev_id = "spi0.1", /* SPI device name */
.table = {
GPIO_LOOKUP("GPION", 7,
"wlf,ldo1ena", GPIO_ACTIVE_HIGH),
{ },
},
};

static struct spi_board_info wm5110_spi_devs[] = {
[0] = {
.modalias = "wm5110",
Expand Down Expand Up @@ -366,6 +379,9 @@ static int wlf_gf_module_probe(struct i2c_client *i2c,
rev == gf_mods[i].rev))
break;

gpiod_add_lookup_table(&wm5102_reva_gpiod_table);
gpiod_add_lookup_table(&wm5102_gpiod_table);

if (i < ARRAY_SIZE(gf_mods)) {
dev_info(&i2c->dev, "%s revision %d\n",
gf_mods[i].name, rev + 1);
Expand Down
Loading

0 comments on commit 68cc38f

Please sign in to comment.