Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aae6f989 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull regulator updates from Mark Brown:
 - Support for putting regulators into bypass mode where they simply
   switch their input to the output (mainly used for low power
   retention).
 - A new API for setting voltages based on a voltage plus tolerance
   rather than an explicit voltage range.
 - Lots of cleanups and API updates from Axel Lin.
 - New driver for MAX8907.

* tag 'regulator-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (71 commits)
  regulator: arizona-ldo: Remove top voltage
  regulator: tps6586x: remove regulator-compatible from DT docs
  regulator: tps65217.txt: remove regulator-compatible from DT docs
  regulator: deprecate regulator-compatible DT property
  regulator: fan53555: remove vsel_max not used
  regulator: aat2870: Don't explicitly initialise the first field
  extcon: arizona: Use bypass mode for MICVDD
  regulator: wm831x-ldo: Add bypass support
  regulator: arizona-micsupp: Support get/set bypass
  regulator: arizona-ldo: Support get/set bypass
  regulator: core: Provide regmap get/set bypass operations
  regulator: core: Support bypass mode
  regulator: Fairchild fan53555 support
  regulator: twl: Remove another unused variable warning
  regulator: core: Try using the parent device for the default regmap
  regulator: core: Fast path non-deferred disables
  regulator: core: Report microvolts in sysfs even with only list_voltage()
  regulator: tps6586x: add support for SYS rail
  regulator: lp872x: remove unnecessary function
  regulator: lp872x: fix NULL pointer access problem
  ...
parents b34e5f55 6a2027ab
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -349,3 +349,24 @@ Description:

		This will be one of the same strings reported by
		the "state" attribute.

What:		/sys/class/regulator/.../bypass
Date:		September 2012
KernelVersion:	3.7
Contact:	Mark Brown <broonie@opensource.wolfsonmicro.com>
Description:
		Some regulator directories will contain a field called
		bypass.  This indicates if the device is in bypass mode.

		This will be one of the following strings:

		'enabled'
		'disabled'
		'unknown'

		'enabled' means the regulator is in bypass mode.

		'disabled' means that the regulator is regulating.

		'unknown' means software cannot determine the state, or
		the reported state is invalid.
+4 −1
Original line number Diff line number Diff line
@@ -11,10 +11,13 @@ Optional properties:
- regulator-boot-on: bootloader/firmware enabled regulator
- <name>-supply: phandle to the parent supply/regulator node
- regulator-ramp-delay: ramp delay for regulator(in uV/uS)

Deprecated properties:
- regulator-compatible: If a regulator chip contains multiple
  regulators, and if the chip's binding contains a child node that
  describes each regulator, then this property indicates which regulator
  this child node is intended to configure.
  this child node is intended to configure. If this property is missing,
  the node's name will be used instead.

Example:

+7 −24
Original line number Diff line number Diff line
@@ -22,66 +22,49 @@ Example:
		compatible = "ti,tps65217";

		regulators {
			#address-cells = <1>;
			#size-cells = <0>;

			dcdc1_reg: regulator@0 {
				reg = <0>;
				regulator-compatible = "dcdc1";
			dcdc1_reg: dcdc1 {
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1800000>;
				regulator-boot-on;
				regulator-always-on;
			};

			dcdc2_reg: regulator@1 {
				reg = <1>;
				regulator-compatible = "dcdc2";
			dcdc2_reg: dcdc2 {
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};

			dcdc3_reg: regulator@2 {
				reg = <2>;
				regulator-compatible = "dcdc3";
			dcdc3_reg: dcc3 {
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1500000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo1_reg: regulator@3 {
				reg = <3>;
				regulator-compatible = "ldo1";
			ldo1_reg: ldo1 {
				regulator-min-microvolt = <1000000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo2_reg: regulator@4 {
				reg = <4>;
				regulator-compatible = "ldo2";
			ldo2_reg: ldo2 {
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo3_reg: regulator@5 {
				reg = <5>;
				regulator-compatible = "ldo3";
			ldo3_reg: ldo3 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo4_reg: regulator@6 {
				reg = <6>;
				regulator-compatible = "ldo4";
			ldo4_reg: ldo4 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
				regulator-boot-on;
+29 −44
Original line number Diff line number Diff line
@@ -6,9 +6,13 @@ Required properties:
- interrupts: the interrupt outputs of the controller
- #gpio-cells: number of cells to describe a GPIO
- gpio-controller: mark the device as a GPIO controller
- regulators: list of regulators provided by this controller, must have
  property "regulator-compatible" to match their hardware counterparts:
  sm[0-2], ldo[0-9] and ldo_rtc
- regulators: A node that houses a sub-node for each regulator within the
  device. Each sub-node is identified using the node's name (or the deprecated
  regulator-compatible property if present), with valid values listed below.
  The content of each sub-node is defined by the standard binding for
  regulators; see regulator.txt.
  sys, sm[0-2], ldo[0-9] and ldo_rtc
- sys-supply: The input supply for SYS.
- vin-sm0-supply: The input supply for the SM0.
- vin-sm1-supply: The input supply for the SM1.
- vin-sm2-supply: The input supply for the SM2.
@@ -20,6 +24,9 @@ Required properties:

Each regulator is defined using the standard binding for regulators.

Note: LDO5 and LDO_RTC is supplied by SYS regulator internally and driver
      take care of making proper parent child relationship.

Example:

	pmu: tps6586x@34 {
@@ -30,6 +37,7 @@ Example:
		#gpio-cells = <2>;
		gpio-controller;

		sys-supply = <&some_reg>;
		vin-sm0-supply = <&some_reg>;
		vin-sm1-supply = <&some_reg>;
		vin-sm2-supply = <&some_reg>;
@@ -40,103 +48,80 @@ Example:
		vinldo9-supply = <...>;

		regulators {
			#address-cells = <1>;
			#size-cells = <0>;
			sys_reg: sys {
				regulator-name = "vdd_sys";
				regulator-boot-on;
				regulator-always-on;
			};

			sm0_reg: regulator@0 {
				reg = <0>;
				regulator-compatible = "sm0";
			sm0_reg: sm0 {
				regulator-min-microvolt = < 725000>;
				regulator-max-microvolt = <1500000>;
				regulator-boot-on;
				regulator-always-on;
			};

			sm1_reg: regulator@1 {
				reg = <1>;
				regulator-compatible = "sm1";
			sm1_reg: sm1 {
				regulator-min-microvolt = < 725000>;
				regulator-max-microvolt = <1500000>;
				regulator-boot-on;
				regulator-always-on;
			};

			sm2_reg: regulator@2 {
				reg = <2>;
				regulator-compatible = "sm2";
			sm2_reg: sm2 {
				regulator-min-microvolt = <3000000>;
				regulator-max-microvolt = <4550000>;
				regulator-boot-on;
				regulator-always-on;
			};

			ldo0_reg: regulator@3 {
				reg = <3>;
				regulator-compatible = "ldo0";
			ldo0_reg: ldo0 {
				regulator-name = "PCIE CLK";
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
			};

			ldo1_reg: regulator@4 {
				reg = <4>;
				regulator-compatible = "ldo1";
			ldo1_reg: ldo1 {
				regulator-min-microvolt = < 725000>;
				regulator-max-microvolt = <1500000>;
			};

			ldo2_reg: regulator@5 {
				reg = <5>;
				regulator-compatible = "ldo2";
			ldo2_reg: ldo2 {
				regulator-min-microvolt = < 725000>;
				regulator-max-microvolt = <1500000>;
			};

			ldo3_reg: regulator@6 {
				reg = <6>;
				regulator-compatible = "ldo3";
			ldo3_reg: ldo3 {
				regulator-min-microvolt = <1250000>;
				regulator-max-microvolt = <3300000>;
			};

			ldo4_reg: regulator@7 {
				reg = <7>;
				regulator-compatible = "ldo4";
			ldo4_reg: ldo4 {
				regulator-min-microvolt = <1700000>;
				regulator-max-microvolt = <2475000>;
			};

			ldo5_reg: regulator@8 {
				reg = <8>;
				regulator-compatible = "ldo5";
			ldo5_reg: ldo5 {
				regulator-min-microvolt = <1250000>;
				regulator-max-microvolt = <3300000>;
			};

			ldo6_reg: regulator@9 {
				reg = <9>;
				regulator-compatible = "ldo6";
			ldo6_reg: ldo6 {
				regulator-min-microvolt = <1250000>;
				regulator-max-microvolt = <3300000>;
			};

			ldo7_reg: regulator@10 {
				reg = <10>;
				regulator-compatible = "ldo7";
			ldo7_reg: ldo7 {
				regulator-min-microvolt = <1250000>;
				regulator-max-microvolt = <3300000>;
			};

			ldo8_reg: regulator@11 {
				reg = <11>;
				regulator-compatible = "ldo8";
			ldo8_reg: ldo8 {
				regulator-min-microvolt = <1250000>;
				regulator-max-microvolt = <3300000>;
			};

			ldo9_reg: regulator@12 {
				reg = <12>;
				regulator-compatible = "ldo9";
			ldo9_reg: ldo9 {
				regulator-min-microvolt = <1250000>;
				regulator-max-microvolt = <3300000>;
			};
+10 −2
Original line number Diff line number Diff line
@@ -67,6 +67,13 @@ static struct regulator_init_data ldo0_data = {
		},							\
	}

static struct regulator_init_data sys_data = {
	.supply_regulator = "vdd_5v0",
	.constraints = {
		.name = "vdd_sys",
	},
};

HARMONY_REGULATOR_INIT(sm0,  "vdd_sm0",  "vdd_sys", 725, 1500, 1);
HARMONY_REGULATOR_INIT(sm1,  "vdd_sm1",  "vdd_sys", 725, 1500, 1);
HARMONY_REGULATOR_INIT(sm2,  "vdd_sm2",  "vdd_sys", 3000, 4550, 1);
@@ -74,7 +81,7 @@ HARMONY_REGULATOR_INIT(ldo1, "vdd_ldo1", "vdd_sm2", 725, 1500, 1);
HARMONY_REGULATOR_INIT(ldo2, "vdd_ldo2", "vdd_sm2", 725, 1500, 0);
HARMONY_REGULATOR_INIT(ldo3, "vdd_ldo3", "vdd_sm2", 1250, 3300, 1);
HARMONY_REGULATOR_INIT(ldo4, "vdd_ldo4", "vdd_sm2", 1700, 2475, 1);
HARMONY_REGULATOR_INIT(ldo5, "vdd_ldo5", NULL,	    1250, 3300, 1);
HARMONY_REGULATOR_INIT(ldo5, "vdd_ldo5", "vdd_sys", 1250, 3300, 1);
HARMONY_REGULATOR_INIT(ldo6, "vdd_ldo6", "vdd_sm2", 1250, 3300, 0);
HARMONY_REGULATOR_INIT(ldo7, "vdd_ldo7", "vdd_sm2", 1250, 3300, 0);
HARMONY_REGULATOR_INIT(ldo8, "vdd_ldo8", "vdd_sm2", 1250, 3300, 0);
@@ -88,6 +95,7 @@ HARMONY_REGULATOR_INIT(ldo9, "vdd_ldo9", "vdd_sm2", 1250, 3300, 1);
	}

static struct tps6586x_subdev_info tps_devs[] = {
	TPS_REG(SYS, &sys_data),
	TPS_REG(SM_0, &sm0_data),
	TPS_REG(SM_1, &sm1_data),
	TPS_REG(SM_2, &sm2_data),
@@ -120,7 +128,7 @@ static struct i2c_board_info __initdata harmony_regulators[] = {

int __init harmony_regulator_init(void)
{
	regulator_register_always_on(0, "vdd_sys",
	regulator_register_always_on(0, "vdd_5v0",
		NULL, 0, 5000000);

	if (machine_is_harmony()) {
Loading