Skip to content

Commit

Permalink
Merge branch 'regulator-5.7' into regulator-next
Browse files Browse the repository at this point in the history
  • Loading branch information
broonie committed Mar 24, 2020
2 parents bae4cb9 + 86332c3 commit 24bd2af
Show file tree
Hide file tree
Showing 21 changed files with 834 additions and 45 deletions.
4 changes: 4 additions & 0 deletions Documentation/devicetree/bindings/mfd/qcom-rpm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Regulator nodes are identified by their compatible:
"qcom,rpm-pm8901-regulators"
"qcom,rpm-pm8921-regulators"
"qcom,rpm-pm8018-regulators"
"qcom,rpm-smb208-regulators"

- vdd_l0_l1_lvs-supply:
- vdd_l2_l11_l12-supply:
Expand Down Expand Up @@ -171,6 +172,9 @@ pm8018:
s1, s2, s3, s4, s5, , l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
l12, l14, lvs1

smb208:
s1a, s1b, s2a, s2b

The content of each sub-node is defined by the standard binding for regulators -
see regulator.txt - with additional custom properties described below:

Expand Down
27 changes: 27 additions & 0 deletions Documentation/devicetree/bindings/regulator/mp886x.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Monolithic Power Systems MP8867/MP8869 voltage regulator

Required properties:
- compatible: Must be one of the following.
"mps,mp8867"
"mps,mp8869"
- reg: I2C slave address.
- enable-gpios: enable gpios.
- mps,fb-voltage-divider: An array of two integers containing the resistor
values R1 and R2 of the feedback voltage divider in kilo ohms.

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

Example:

vcpu: regulator@62 {
compatible = "mps,mp8869";
regulator-name = "vcpu";
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <850000>;
regulator-always-on;
regulator-boot-on;
enable-gpios = <&porta 1 GPIO_ACTIVE_LOW>;
mps,fb-voltage-divider = <80 240>;
reg = <0x62>;
};
78 changes: 78 additions & 0 deletions Documentation/devicetree/bindings/regulator/mps,mp5416.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/mps,mp5416.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Monolithic Power System MP5416 PMIC

maintainers:
- Saravanan Sekar <[email protected]>

properties:
$nodename:
pattern: "^pmic@[0-9a-f]{1,2}$"
compatible:
enum:
- mps,mp5416

reg:
maxItems: 1

regulators:
type: object
description: |
list of regulators provided by this controller, must be named
after their hardware counterparts BUCK[1-4] and LDO[1-4]
patternProperties:
"^buck[1-4]$":
allOf:
- $ref: "regulator.yaml#"
type: object

"^ldo[1-4]$":
allOf:
- $ref: "regulator.yaml#"
type: object

additionalProperties: false
additionalProperties: false

required:
- compatible
- reg
- regulators

additionalProperties: false

examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
pmic@69 {
compatible = "mps,mp5416";
reg = <0x69>;
regulators {
buck1 {
regulator-name = "buck1";
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <2187500>;
regulator-min-microamp = <3800000>;
regulator-max-microamp = <6800000>;
regulator-boot-on;
};
ldo2 {
regulator-name = "ldo2";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <3975000>;
};
};
};
};
...
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Regulator nodes are identified by their compatible:
"qcom,rpm-pm8994-regulators"
"qcom,rpm-pm8998-regulators"
"qcom,rpm-pma8084-regulators"
"qcom,rpm-pmi8994-regulators"
"qcom,rpm-pmi8998-regulators"
"qcom,rpm-pms405-regulators"

Expand Down Expand Up @@ -143,6 +144,15 @@ Regulator nodes are identified by their compatible:
Definition: reference to regulator supplying the input pin, as
described in the data sheet

- vdd_s1-supply:
- vdd_s2-supply:
- vdd_s3-supply:
- vdd_bst_byp-supply:
Usage: optional (pmi8994 only)
Value type: <phandle>
Definition: reference to regulator supplying the input pin, as
described in the data sheet

- vdd_s1-supply:
- vdd_s2-supply:
- vdd_s3-supply:
Expand Down Expand Up @@ -259,6 +269,9 @@ pma8084:
l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20,
l21, l22, l23, l24, l25, l26, l27, lvs1, lvs2, lvs3, lvs4, 5vs1

pmi8994:
s1, s2, s3, boost-bypass

pmi8998:
bob

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/vqmmc-ipq4019-regulator.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm IPQ4019 VQMMC SD LDO regulator

maintainers:
- Robert Marko <[email protected]>

description: |
Qualcomm IPQ4019 SoC-s feature a built a build SD/EMMC controller,
in order to support both 1.8 and 3V I/O voltage levels an LDO
controller is also embedded.
allOf:
- $ref: "regulator.yaml#"

properties:
compatible:
const: qcom,vqmmc-ipq4019-regulator

reg:
maxItems: 1

required:
- compatible
- reg

examples:
- |
regulator@1948000 {
compatible = "qcom,vqmmc-ipq4019-regulator";
reg = <0x01948000 0x4>;
regulator-name = "vqmmc";
regulator-min-microvolt = <1500000>;
regulator-max-microvolt = <3000000>;
regulator-always-on;
status = "disabled";
};
...
3 changes: 2 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -11256,7 +11256,8 @@ F: drivers/tty/mxser.*
MONOLITHIC POWER SYSTEM PMIC DRIVER
M: Saravanan Sekar <[email protected]>
S: Maintained
F: Documentation/devicetree/bindings/regulator/mpq7920.yaml
F: Documentation/devicetree/bindings/regulator/mps,mp*.yaml
F: drivers/regulator/mp5416.c
F: drivers/regulator/mpq7920.c
F: drivers/regulator/mpq7920.h

Expand Down
18 changes: 18 additions & 0 deletions drivers/regulator/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ config REGULATOR_AD5398

config REGULATOR_ANATOP
tristate "Freescale i.MX on-chip ANATOP LDO regulators"
depends on ARCH_MXC || COMPILE_TEST
depends on MFD_SYSCON
help
Say y here to support Freescale i.MX on-chip ANATOP LDOs
Expand Down Expand Up @@ -613,6 +614,16 @@ config REGULATOR_MCP16502
through the regulator interface. In addition it enables
suspend-to-ram/standby transition.

config REGULATOR_MP5416
tristate "Monolithic MP5416 PMIC"
depends on I2C && OF
select REGMAP_I2C
help
Say y here to support the MP5416 PMIC. This will enable supports
the software controllable 4 buck and 4 LDO regulators.
Say M here if you want to include support for the regulator as a
module.

config REGULATOR_MP8859
tristate "MPS MP8859 regulator driver"
depends on I2C
Expand All @@ -624,6 +635,13 @@ config REGULATOR_MP8859
Say M here if you want to include support for the regulator as a
module. The module will be named "mp8859".

config REGULATOR_MP886X
tristate "MPS MP8869 regulator driver"
depends on I2C && (OF || COMPILE_TEST)
select REGMAP_I2C
help
This driver supports the MP8869 voltage regulator.

config REGULATOR_MPQ7920
tristate "Monolithic MPQ7920 PMIC"
depends on I2C && OF
Expand Down
2 changes: 2 additions & 0 deletions drivers/regulator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ obj-$(CONFIG_REGULATOR_MC13783) += mc13783-regulator.o
obj-$(CONFIG_REGULATOR_MC13892) += mc13892-regulator.o
obj-$(CONFIG_REGULATOR_MC13XXX_CORE) += mc13xxx-regulator-core.o
obj-$(CONFIG_REGULATOR_MCP16502) += mcp16502.o
obj-$(CONFIG_REGULATOR_MP5416) += mp5416.o
obj-$(CONFIG_REGULATOR_MP8859) += mp8859.o
obj-$(CONFIG_REGULATOR_MP886X) += mp886x.o
obj-$(CONFIG_REGULATOR_MPQ7920) += mpq7920.o
obj-$(CONFIG_REGULATOR_MT6311) += mt6311-regulator.o
obj-$(CONFIG_REGULATOR_MT6323) += mt6323-regulator.o
Expand Down
10 changes: 7 additions & 3 deletions drivers/regulator/anatop-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,13 @@ static int anatop_regulator_probe(struct platform_device *pdev)
/* register regulator */
rdev = devm_regulator_register(dev, rdesc, &config);
if (IS_ERR(rdev)) {
dev_err(dev, "failed to register %s\n",
rdesc->name);
return PTR_ERR(rdev);
ret = PTR_ERR(rdev);
if (ret == -EPROBE_DEFER)
dev_dbg(dev, "failed to register %s, deferring...\n",
rdesc->name);
else
dev_err(dev, "failed to register %s\n", rdesc->name);
return ret;
}

platform_set_drvdata(pdev, rdev);
Expand Down
6 changes: 2 additions & 4 deletions drivers/regulator/axp20x-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,7 @@ static int axp20x_set_ramp_delay(struct regulator_dev *rdev, int ramp)
mask = AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_RATE_MASK |
AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN_MASK;
enable = (ramp > 0) ?
AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN :
!AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN;
AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN : 0;
break;
}

Expand All @@ -393,8 +392,7 @@ static int axp20x_set_ramp_delay(struct regulator_dev *rdev, int ramp)
mask = AXP20X_DCDC2_LDO3_V_RAMP_LDO3_RATE_MASK |
AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN_MASK;
enable = (ramp > 0) ?
AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN :
!AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN;
AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN : 0;
break;
}

Expand Down
5 changes: 1 addition & 4 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1849,7 +1849,6 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
{
struct regulator_dev *rdev;
struct regulator *regulator;
const char *devname = dev ? dev_name(dev) : "deviceless";
struct device_link *link;
int ret;

Expand Down Expand Up @@ -1887,9 +1886,7 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
* enabled, even if it isn't hooked up, and just
* provide a dummy.
*/
dev_warn(dev,
"%s supply %s not found, using dummy regulator\n",
devname, id);
dev_warn(dev, "supply %s not found, using dummy regulator\n", id);
rdev = dummy_regulator_rdev;
get_device(&rdev->dev);
break;
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/da9062-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct da9062_regulators {
int irq_ldo_lim;
unsigned n_regulators;
/* Array size to be defined during init. Keep at end. */
struct da9062_regulator regulator[0];
struct da9062_regulator regulator[];
};

/* Regulator operations */
Expand Down
Loading

0 comments on commit 24bd2af

Please sign in to comment.