Skip to content

Commit

Permalink
Merge tag 'regulator-v4.2' 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:
 "Another fairly quiet release, some new drivers with generic handling
  for minor features but nothing that makes a substantial difference
  outside of the subsystem or for most boards:

   - support for a bunch of new parameters which are present on enough
     regulators to be worth having generic handling for in the
     framework.

   - fixes for some issues with printing constraints during boot which
     should probably have gone in for v4.1 but didn't.

   - new drivers for Dialog DA9062, Maxim MAX77621 and Qualcomm SPMI
     regulators"

* tag 'regulator-v4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (45 commits)
  regulator: qcom_spmi: Fix calculating number of voltages
  regulator: qcom_spmi: Add missing braces for aligned code
  regulator: fix simple_return.cocci warnings
  regulator: Add QCOM SPMI regulator driver
  regulator: Add docbook for soft start
  regulator: Add input current limit support
  regulator: Add soft start support
  regulator: Add pull down support
  regulator: Add system_load constraint
  regulator: max8973: Fix up ramp_delay for MAX8973_RAMP_25mV_PER_US case
  regulator: core: replace sprintf with scnprintf
  regulator: core: fix constraints output buffer
  regulator: core: Don't corrupt display when printing uV offsets
  regulator: max8973: add support for MAX77621
  regulator: max8973: configure ramp delay through callback
  regulator: pwm-regulator: Diffientiate between dev (device) and rdev (regulator_dev)
  regulator: pwm-regulator: Remove superfluous is_enabled check
  regulator: pwm-regulator: Remove unnecessary descriptor attribute from ddata
  regulator: core: Don't spew backtraces on duplicate sysfs
  regulator: da9063: Fix up irq leak
  ...
  • Loading branch information
torvalds committed Jun 24, 2015
2 parents 5a602e1 + 733ada0 commit 7fe0bf9
Show file tree
Hide file tree
Showing 28 changed files with 2,897 additions and 295 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,30 @@

Required properties:

- compatible: must be "maxim,max8973"
- compatible: must be one of following:
"maxim,max8973"
"maxim,max77621".
- reg: the i2c slave address of the regulator. It should be 0x1b.

Any standard regulator properties can be used to configure the single max8973
DCDC.

Optional properties:

-maxim,externally-enable: boolean, externally control the regulator output
enable/disable.
-maxim,enable-gpio: GPIO for enable control. If the valid GPIO is provided
then externally enable control will be considered.
-maxim,dvs-gpio: GPIO which is connected to DVS pin of device.
-maxim,dvs-default-state: Default state of GPIO during initialisation.
1 for HIGH and 0 for LOW.
-maxim,enable-remote-sense: boolean, enable reote sense.
-maxim,enable-falling-slew-rate: boolean, enable falling slew rate.
-maxim,enable-active-discharge: boolean: enable active discharge.
-maxim,enable-frequency-shift: boolean, enable 9% frequency shift.
-maxim,enable-bias-control: boolean, enable bias control. By enabling this
startup delay can be reduce to 20us from 220us.

Example:

max8973@1b {
Expand Down
121 changes: 121 additions & 0 deletions Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
Qualcomm SPMI Regulators

- compatible:
Usage: required
Value type: <string>
Definition: must be one of:
"qcom,pm8841-regulators"
"qcom,pm8916-regulators"
"qcom,pm8941-regulators"

- interrupts:
Usage: optional
Value type: <prop-encoded-array>
Definition: List of OCP interrupts.

- interrupt-names:
Usage: required if 'interrupts' property present
Value type: <string-array>
Definition: List of strings defining the names of the
interrupts in the 'interrupts' property 1-to-1.
Supported values are "ocp-<regulator_name>", where
<regulator_name> corresponds to a voltage switch
type regulator.

- vdd_s1-supply:
- vdd_s2-supply:
- vdd_s3-supply:
- vdd_s4-supply:
- vdd_s5-supply:
- vdd_s6-supply:
- vdd_s7-supply:
- vdd_s8-supply:
Usage: optional (pm8841 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:
- vdd_s4-supply:
- vdd_l1_l3-supply:
- vdd_l2-supply:
- vdd_l4_l5_l6-supply:
- vdd_l7-supply:
- vdd_l8_l11_l14_l15_l16-supply:
- vdd_l9_l10_l12_l13_l17_l18-supply:
Usage: optional (pm8916 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:
- vdd_l1_l3-supply:
- vdd_l2_lvs_1_2_3-supply:
- vdd_l4_l11-supply:
- vdd_l5_l7-supply:
- vdd_l6_l12_l14_l15-supply:
- vdd_l8_l16_l18_19-supply:
- vdd_l9_l10_l17_l22-supply:
- vdd_l13_l20_l23_l24-supply:
- vdd_l21-supply:
- vin_5vs-supply:
Usage: optional (pm8941 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
of the PMICs below.

pm8841:
s1, s2, s3, s4, s5, s6, s7, s8

pm8916:
s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13,
l14, l15, l16, l17, l18

pm8941:
s1, s2, s3, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14,
l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, lvs1, lvs2, lvs3,
mvs1, mvs2

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

- regulator-initial-mode:
Usage: optional
Value type: <u32>
Descrption: 1 = Set initial mode to high power mode (HPM), also referred
to as NPM. HPM consumes more ground current than LPM, but
it can source significantly higher load current. HPM is not
available on boost type regulators. For voltage switch type
regulators, HPM implies that over current protection and
soft start are active all the time. 0 = Set initial mode to
low power mode (LPM).

Example:

regulators {
compatible = "qcom,pm8941-regulators";
vdd_l1_l3-supply = <&s1>;

s1: s1 {
regulator-min-microvolt = <1300000>;
regulator-max-microvolt = <1400000>;
};

...

l1: l1 {
regulator-min-microvolt = <1225000>;
regulator-max-microvolt = <1300000>;
};

....
};
7 changes: 6 additions & 1 deletion Documentation/devicetree/bindings/regulator/regulator.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ Optional properties:
- regulator-microvolt-offset: Offset applied to voltages to compensate for voltage drops
- regulator-min-microamp: smallest current consumers may set
- regulator-max-microamp: largest current consumers may set
- regulator-input-current-limit-microamp: maximum input current regulator allows
- regulator-always-on: boolean, regulator should never be disabled
- regulator-boot-on: bootloader/firmware enabled regulator
- regulator-allow-bypass: allow the regulator to go into bypass mode
- <name>-supply: phandle to the parent supply/regulator node
- regulator-ramp-delay: ramp delay for regulator(in uV/uS)
For hardware which supports disabling ramp rate, it should be explicitly
intialised to zero (regulator-ramp-delay = <0>) for disabling ramp delay.
initialised to zero (regulator-ramp-delay = <0>) for disabling ramp delay.
- regulator-enable-ramp-delay: The time taken, in microseconds, for the supply
rail to reach the target voltage, plus/minus whatever tolerance the board
design requires. This property describes the total system ramp time
required due to the combination of internal ramping of the regulator itself,
and board design issues such as trace capacitance and load on the supply.
- regulator-soft-start: Enable soft start so that voltage ramps slowly
- 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.
Expand All @@ -37,6 +39,9 @@ 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-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.

Deprecated properties:
- regulator-compatible: If a regulator chip contains multiple
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/88pm8607.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ static int pm8607_regulator_probe(struct platform_device *pdev)
return 0;
}

static struct platform_device_id pm8607_regulator_driver_ids[] = {
static const struct platform_device_id pm8607_regulator_driver_ids[] = {
{
.name = "88pm860x-regulator",
.driver_data = 0,
Expand Down
23 changes: 22 additions & 1 deletion drivers/regulator/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ config REGULATOR_DA9055
This driver can also be built as a module. If so, the module
will be called da9055-regulator.

config REGULATOR_DA9062
tristate "Dialog Semiconductor DA9062 regulators"
depends on MFD_DA9062
help
Say y here to support the BUCKs and LDOs regulators found on
DA9062 PMICs.

This driver can also be built as a module. If so, the module
will be called da9062-regulator.

config REGULATOR_DA9063
tristate "Dialog Semiconductor DA9063 regulators"
depends on MFD_DA9063
Expand Down Expand Up @@ -233,7 +243,7 @@ config REGULATOR_FAN53555

config REGULATOR_GPIO
tristate "GPIO regulator support"
depends on GPIOLIB
depends on GPIOLIB || COMPILE_TEST
help
This driver provides support for regulators that can be
controlled via gpios.
Expand Down Expand Up @@ -512,6 +522,17 @@ config REGULATOR_QCOM_RPM
Qualcomm RPM as a module. The module will be named
"qcom_rpm-regulator".

config REGULATOR_QCOM_SPMI
tristate "Qualcomm SPMI regulator driver"
depends on SPMI || COMPILE_TEST
help
If you say yes to this option, support will be included for the
regulators found in Qualcomm SPMI PMICs.

Say M here if you want to include support for the regulators on the
Qualcomm SPMI PMICs as a module. The module will be named
"qcom_spmi-regulator".

config REGULATOR_RC5T583
tristate "RICOH RC5T583 Power regulators"
depends on MFD_RC5T583
Expand Down
2 changes: 2 additions & 0 deletions drivers/regulator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ obj-$(CONFIG_REGULATOR_BCM590XX) += bcm590xx-regulator.o
obj-$(CONFIG_REGULATOR_DA903X) += da903x.o
obj-$(CONFIG_REGULATOR_DA9052) += da9052-regulator.o
obj-$(CONFIG_REGULATOR_DA9055) += da9055-regulator.o
obj-$(CONFIG_REGULATOR_DA9062) += da9062-regulator.o
obj-$(CONFIG_REGULATOR_DA9063) += da9063-regulator.o
obj-$(CONFIG_REGULATOR_DA9210) += da9210-regulator.o
obj-$(CONFIG_REGULATOR_DA9211) += da9211-regulator.o
Expand Down Expand Up @@ -61,6 +62,7 @@ obj-$(CONFIG_REGULATOR_MC13892) += mc13892-regulator.o
obj-$(CONFIG_REGULATOR_MC13XXX_CORE) += mc13xxx-regulator-core.o
obj-$(CONFIG_REGULATOR_MT6397) += mt6397-regulator.o
obj-$(CONFIG_REGULATOR_QCOM_RPM) += qcom_rpm-regulator.o
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_PWM) += pwm-regulator.o
Expand Down
15 changes: 15 additions & 0 deletions drivers/regulator/arizona-ldo1.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ static const struct regulator_init_data arizona_ldo1_default = {
.num_consumer_supplies = 1,
};

static const struct regulator_init_data arizona_ldo1_wm5110 = {
.constraints = {
.min_uV = 1175000,
.max_uV = 1200000,
.valid_ops_mask = REGULATOR_CHANGE_STATUS |
REGULATOR_CHANGE_VOLTAGE,
},
.num_consumer_supplies = 1,
};

static int arizona_ldo1_of_get_pdata(struct arizona *arizona,
struct regulator_config *config,
const struct regulator_desc *desc)
Expand Down Expand Up @@ -243,6 +253,11 @@ static int arizona_ldo1_probe(struct platform_device *pdev)
desc = &arizona_ldo1_hc;
ldo1->init_data = arizona_ldo1_dvfs;
break;
case WM5110:
case WM8280:
desc = &arizona_ldo1;
ldo1->init_data = arizona_ldo1_wm5110;
break;
default:
desc = &arizona_ldo1;
ldo1->init_data = arizona_ldo1_default;
Expand Down
Loading

0 comments on commit 7fe0bf9

Please sign in to comment.