Skip to content

Commit

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

Pull regulator updates from Mark Brown:
 "A few core enhancements to deal with some of the slightly more
  complicated edge cases that have started cropping up in systems, both
  new ones and old ones that people started worrying about upstream, but
  otherwise a quiet release for the regulator API:

   - When applying constraints at system image if we have a voltage
     range specified and the regulator is currently configured outside
     the bounds of that range bring the regulator to the nearest end of
     the range.

   - When regulators are in non-regulating bypass modes make sure that
     we always use the voltage from the parent regulator.

   - Support for LP873x, PV88080, PM8894 and FAN53555 chips"

* tag 'regulator-v4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (71 commits)
  regulator: rk808: Migrate to regulator core's simplified DT parsing code
  regulator: lp873x: Add support for lp873x PMIC regulators
  regulator: tps65917/palmas: Simplify multiple dereference of match->of_node
  regulator: tps65917/palmas: Handle possible memory allocation failure
  regulator: tps65917/palmas: Simplify multiple dereference of pdata->reg_init[idx]
  regulator: tps65917/palmas: Simplify multiple dereference of ddata->palmas_matches[idx]
  regulator: pwm: Use pwm_get_args() where appropriate
  pwm: Introduce the pwm_args concept
  regulator: max77686: Configure enable time to properly handle regulator enable
  regulator: rk808: Add rk808_reg_ops_ranges for LDO3
  regulator: core: Add early supply resolution for regulators
  regulator: axp20x: Fix axp22x ldo_io voltage ranges
  regulator: tps65917/palmas: Add bypass "On" value
  regulator: rk808: remove unused rk808_reg_ops_ranges
  regulator: refactor valid_ops_mask checking code
  regulator: rk808: remove linear range definitions with a single range
  regulator: max77620: Add support for device specific ramp rate setting
  regulator: max77620: Add details of device specific ramp rate setting
  regulator: helpers: Ensure bypass register field matches ON value
  regulator: core: Move registration of regulator device
  ...
  • Loading branch information
Linus Torvalds committed May 17, 2016
2 parents e2ca542 + 4f38c56 commit d9dce51
Show file tree
Hide file tree
Showing 45 changed files with 1,960 additions and 580 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ Optional properties:

Enhanced transient response (ETR) will affect the configuration of CKADV.

-junction-warn-millicelsius: u32, junction warning temperature threshold
in millicelsius. If die temperature crosses this level then
device generates the warning interrupts.

Please note that thermal functionality is only supported on MAX77621. The
supported threshold warning temperature for MAX77621 are 120 degC and 140 degC.

Example:

max8973@1b {
Expand Down
49 changes: 49 additions & 0 deletions Documentation/devicetree/bindings/regulator/pv88080.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
* Powerventure Semiconductor PV88080 Voltage Regulator

Required properties:
- compatible: "pvs,pv88080".
- reg: I2C slave address, usually 0x49.
- 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.
BUCK1, BUCK2, and BUCK3.

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

Example

pmic: pv88080@49 {
compatible = "pvs,pv88080";
reg = <0x49>;
interrupt-parent = <&gpio>;
interrupts = <24 24>;

regulators {
BUCK1 {
regulator-name = "buck1";
regulator-min-microvolt = < 600000>;
regulator-max-microvolt = <1393750>;
regulator-min-microamp = < 220000>;
regulator-max-microamp = <7040000>;
};

BUCK2 {
regulator-name = "buck2";
regulator-min-microvolt = < 600000>;
regulator-max-microvolt = <1393750>;
regulator-min-microamp = <1496000>;
regulator-max-microamp = <4189000>;
};

BUCK3 {
regulator-name = "buck3";
regulator-min-microvolt = <1400000>;
regulator-max-microvolt = <2193750>;
regulator-min-microamp = <1496000>;
regulator-max-microamp = <4189000>;
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Qualcomm SPMI Regulators
"qcom,pm8841-regulators"
"qcom,pm8916-regulators"
"qcom,pm8941-regulators"
"qcom,pm8994-regulators"

- interrupts:
Usage: optional
Expand Down Expand Up @@ -68,6 +69,37 @@ Qualcomm SPMI Regulators
Definition: Reference to regulator supplying the input pin, as
described in the data sheet.

- vdd_s1-supply:
- vdd_s2-supply:
- vdd_s3-supply:
- vdd_s4-supply:
- vdd_s5-supply:
- vdd_s6-supply:
- vdd_s7-supply:
- vdd_s8-supply:
- vdd_s9-supply:
- vdd_s10-supply:
- vdd_s11-supply:
- vdd_s12-supply:
- vdd_l1-supply:
- vdd_l2_l26_l28-supply:
- vdd_l3_l11-supply:
- vdd_l4_l27_l31-supply:
- vdd_l5_l7-supply:
- vdd_l6_l12_l32-supply:
- vdd_l8_l16_l30-supply:
- vdd_l9_l10_l18_l22-supply:
- vdd_l13_l19_l23_l24-supply:
- vdd_l14_l15-supply:
- vdd_l17_l29-supply:
- vdd_l20_l21-supply:
- vdd_l25-supply:
- vdd_lvs_1_2-supply:
Usage: optional (pm8994 only)
Value type: <phandle>
Definition: Reference to regulator supplying the input pin, as
described in the data sheet.


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 All @@ -85,6 +117,11 @@ pm8941:
l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, lvs1, lvs2, lvs3,
mvs1, mvs2

pm8994:
s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, l1, l2, l3, l4, l5,
l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20,
l21, l22, l23, l24, l25, l26, l27, l28, l29, l30, l31, l32, lvs1, lvs2

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
22 changes: 22 additions & 0 deletions Documentation/devicetree/bindings/regulator/regulator-max77620.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,28 @@ Following are additional properties:
This is applicable if suspend state
FPS source is selected as FPS0, FPS1 or
FPS2.
- maxim,ramp-rate-setting: integer, ramp rate(uV/us) setting to be
configured to the device.
The platform may have different ramp
rate than advertised ramp rate if it has
design variation from Maxim's
recommended. On this case, platform
specific ramp rate is used for ramp time
calculation and this property is used
for device register configurations.
The measured ramp rate of platform is
provided by the regulator-ramp-delay
as described in <devicetree/bindings/
regulator/regulator.txt>.
Maxim Max77620 supports following ramp
delay:
SD: 13.75mV/us, 27.5mV/us, 55mV/us
LDOs: 5mV/us, 100mV/us

Note: If the measured ramp delay is same as advertised ramp delay then it is not
required to provide the ramp delay with property "maxim,ramp-rate-setting". The
ramp rate can be provided by the regulator-ramp-delay which will be used for
ramp time calculation for voltage change as well as for device configuration.

Example:
--------
Expand Down
10 changes: 5 additions & 5 deletions Documentation/devicetree/bindings/regulator/ti-abb-regulator.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Required Properties:
- "setup-address" - contains setup register address of ABB module (ti,abb-v3)
- "int-address" - contains address of interrupt register for ABB module
(also see Optional properties)
- #address-cell: should be 0
- #size-cell: should be 0
- #address-cells: should be 0
- #size-cells: should be 0
- clocks: should point to the clock node used by ABB module
- ti,settling-time: Settling time in uSecs from SoC documentation for ABB module
to settle down(target time for SR2_WTCNT_VALUE).
Expand Down Expand Up @@ -69,7 +69,7 @@ Example #1: Simplest configuration (no efuse data, hard coded ABB table):
abb_x: regulator-abb-x {
compatible = "ti,abb-v1";
regulator-name = "abb_x";
#address-cell = <0>;
#address-cells = <0>;
#size-cells = <0>;
reg = <0x483072f0 0x8>, <0x48306818 0x4>;
reg-names = "base-address", "int-address";
Expand All @@ -89,7 +89,7 @@ Example #2: Efuse bits contain ABB mode setting (no LDO override capability)
abb_y: regulator-abb-y {
compatible = "ti,abb-v2";
regulator-name = "abb_y";
#address-cell = <0>;
#address-cells = <0>;
#size-cells = <0>;
reg = <0x4a307bd0 0x8>, <0x4a306014 0x4>, <0x4A002268 0x8>;
reg-names = "base-address", "int-address", "efuse-address";
Expand All @@ -110,7 +110,7 @@ Example #3: Efuse bits contain ABB mode setting and LDO override capability
abb_z: regulator-abb-z {
compatible = "ti,abb-v2";
regulator-name = "abb_z";
#address-cell = <0>;
#address-cells = <0>;
#size-cells = <0>;
reg = <0x4ae07ce4 0x8>, <0x4ae06010 0x4>,
<0x4a002194 0x8>, <0x4ae0C314 0x4>;
Expand Down
6 changes: 6 additions & 0 deletions Documentation/devicetree/bindings/regulator/twl-regulator.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ For twl4030 regulators/LDOs

Optional properties:
- Any optional property defined in bindings/regulator/regulator.txt
For twl4030 regulators/LDOs:
- regulator-initial-mode:
- 0x08 - Sleep mode, the nominal output voltage is maintained with low power
consumption with low load current capability.
- 0x0e - Active mode, the regulator can deliver its nominal output voltage
with full-load current capability.

Example:

Expand Down
6 changes: 4 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -7020,9 +7020,9 @@ M: Chanwoo Choi <cw00.choi@samsung.com>
M: Krzysztof Kozlowski <k.kozlowski@samsung.com>
L: linux-kernel@vger.kernel.org
S: Supported
F: drivers/*/max14577.c
F: drivers/*/max14577*.c
F: drivers/*/max77686*.c
F: drivers/*/max77693.c
F: drivers/*/max77693*.c
F: drivers/extcon/extcon-max14577.c
F: drivers/extcon/extcon-max77693.c
F: drivers/rtc/rtc-max77686.c
Expand Down Expand Up @@ -12011,7 +12011,9 @@ L: linux-kernel@vger.kernel.org
W: http://www.slimlogic.co.uk/?p=48
T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
S: Supported
F: Documentation/devicetree/bindings/regulator/
F: drivers/regulator/
F: include/dt-bindings/regulator/
F: include/linux/regulator/

VRF
Expand Down
21 changes: 14 additions & 7 deletions drivers/pwm/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ static int pwm_device_request(struct pwm_device *pwm, const char *label)
set_bit(PWMF_REQUESTED, &pwm->flags);
pwm->label = label;

/*
* FIXME: This should be removed once all PWM users properly make use
* of struct pwm_args to initialize the PWM device. As long as this is
* here, the PWM state and hardware state can get out of sync.
*/
pwm_apply_args(pwm);

return 0;
}

Expand All @@ -146,12 +153,12 @@ of_pwm_xlate_with_flags(struct pwm_chip *pc, const struct of_phandle_args *args)
if (IS_ERR(pwm))
return pwm;

pwm_set_period(pwm, args->args[1]);
pwm->args.period = args->args[1];

if (args->args[2] & PWM_POLARITY_INVERTED)
pwm_set_polarity(pwm, PWM_POLARITY_INVERSED);
pwm->args.polarity = PWM_POLARITY_INVERSED;
else
pwm_set_polarity(pwm, PWM_POLARITY_NORMAL);
pwm->args.polarity = PWM_POLARITY_NORMAL;

return pwm;
}
Expand All @@ -172,7 +179,7 @@ of_pwm_simple_xlate(struct pwm_chip *pc, const struct of_phandle_args *args)
if (IS_ERR(pwm))
return pwm;

pwm_set_period(pwm, args->args[1]);
pwm->args.period = args->args[1];

return pwm;
}
Expand Down Expand Up @@ -747,13 +754,13 @@ struct pwm_device *pwm_get(struct device *dev, const char *con_id)
if (!chip)
goto out;

pwm->args.period = chosen->period;
pwm->args.polarity = chosen->polarity;

pwm = pwm_request_from_chip(chip, chosen->index, con_id ?: dev_id);
if (IS_ERR(pwm))
goto out;

pwm_set_period(pwm, chosen->period);
pwm_set_polarity(pwm, chosen->polarity);

out:
mutex_unlock(&pwm_lookup_lock);
return pwm;
Expand Down
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-clps711x.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static int clps711x_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
return -EINVAL;

/* Store constant period value */
pwm_set_period(pwm, DIV_ROUND_CLOSEST(NSEC_PER_SEC, freq));
pwm->args.period = DIV_ROUND_CLOSEST(NSEC_PER_SEC, freq);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/pwm/pwm-pxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pxa_pwm_of_xlate(struct pwm_chip *pc, const struct of_phandle_args *args)
if (IS_ERR(pwm))
return pwm;

pwm_set_period(pwm, args->args[0]);
pwm->args.period = args->args[0];

return pwm;
}
Expand Down
17 changes: 17 additions & 0 deletions drivers/regulator/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,15 @@ config REGULATOR_LP872X
help
This driver supports LP8720/LP8725 PMIC

config REGULATOR_LP873X
tristate "TI LP873X Power regulators"
depends on MFD_LP873X && OF
help
This driver supports LP873X voltage regulator chips. LP873X
provides two step-down converters and two general-purpose LDO
voltage regulators. It supports software based voltage control
for different voltage domains

config REGULATOR_LP8755
tristate "TI LP8755 High Performance PMU driver"
depends on I2C
Expand Down Expand Up @@ -409,6 +418,7 @@ config REGULATOR_MAX8952
config REGULATOR_MAX8973
tristate "Maxim MAX8973 voltage regulator "
depends on I2C
depends on THERMAL && THERMAL_OF
select REGMAP_I2C
help
The MAXIM MAX8973 high-efficiency. three phase, DC-DC step-down
Expand Down Expand Up @@ -548,6 +558,13 @@ config REGULATOR_PV88060
Say y here to support the voltage regulators and convertors
PV88060

config REGULATOR_PV88080
tristate "Powerventure Semiconductor PV88080 regulator"
depends on I2C
select REGMAP_I2C
help
Say y here to support the buck convertors on PV88080

config REGULATOR_PV88090
tristate "Powerventure Semiconductor PV88090 regulator"
depends on I2C
Expand Down
8 changes: 5 additions & 3 deletions drivers/regulator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ obj-$(CONFIG_REGULATOR_LM363X) += lm363x-regulator.o
obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o
obj-$(CONFIG_REGULATOR_LP3972) += lp3972.o
obj-$(CONFIG_REGULATOR_LP872X) += lp872x.o
obj-$(CONFIG_REGULATOR_LP873X) += lp873x-regulator.o
obj-$(CONFIG_REGULATOR_LP8788) += lp8788-buck.o
obj-$(CONFIG_REGULATOR_LP8788) += lp8788-ldo.o
obj-$(CONFIG_REGULATOR_LP8755) += lp8755.o
obj-$(CONFIG_REGULATOR_LTC3589) += ltc3589.o
obj-$(CONFIG_REGULATOR_MAX14577) += max14577.o
obj-$(CONFIG_REGULATOR_MAX14577) += max14577-regulator.o
obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o
obj-$(CONFIG_REGULATOR_MAX77620) += max77620-regulator.o
obj-$(CONFIG_REGULATOR_MAX8649) += max8649.o
Expand All @@ -55,10 +56,10 @@ obj-$(CONFIG_REGULATOR_MAX8907) += max8907-regulator.o
obj-$(CONFIG_REGULATOR_MAX8925) += max8925-regulator.o
obj-$(CONFIG_REGULATOR_MAX8952) += max8952.o
obj-$(CONFIG_REGULATOR_MAX8973) += max8973-regulator.o
obj-$(CONFIG_REGULATOR_MAX8997) += max8997.o
obj-$(CONFIG_REGULATOR_MAX8997) += max8997-regulator.o
obj-$(CONFIG_REGULATOR_MAX8998) += max8998.o
obj-$(CONFIG_REGULATOR_MAX77686) += max77686-regulator.o
obj-$(CONFIG_REGULATOR_MAX77693) += max77693.o
obj-$(CONFIG_REGULATOR_MAX77693) += max77693-regulator.o
obj-$(CONFIG_REGULATOR_MAX77802) += max77802-regulator.o
obj-$(CONFIG_REGULATOR_MC13783) += mc13783-regulator.o
obj-$(CONFIG_REGULATOR_MC13892) += mc13892-regulator.o
Expand All @@ -71,6 +72,7 @@ obj-$(CONFIG_REGULATOR_QCOM_SPMI) += qcom_spmi-regulator.o
obj-$(CONFIG_REGULATOR_PALMAS) += palmas-regulator.o
obj-$(CONFIG_REGULATOR_PFUZE100) += pfuze100-regulator.o
obj-$(CONFIG_REGULATOR_PV88060) += pv88060-regulator.o
obj-$(CONFIG_REGULATOR_PV88080) += pv88080-regulator.o
obj-$(CONFIG_REGULATOR_PV88090) += pv88090-regulator.o
obj-$(CONFIG_REGULATOR_PWM) += pwm-regulator.o
obj-$(CONFIG_REGULATOR_TPS51632) += tps51632-regulator.o
Expand Down
Loading

0 comments on commit d9dce51

Please sign in to comment.