Skip to content

Commit

Permalink
Merge remote-tracking branches 'regulator/topic/core', 'regulator/top…
Browse files Browse the repository at this point in the history
…ic/bypass', 'regulator/topic/tol', 'regulator/topic/drivers' and 'regulator/topic/tps6586x' into regulator-next
  • Loading branch information
broonie committed Sep 28, 2012
6 parents 5698bd7 + 52b84da + b8575a1 + 3f19657 + e96961d + 3006b8d commit 6a2027a
Show file tree
Hide file tree
Showing 43 changed files with 1,417 additions and 563 deletions.
21 changes: 21 additions & 0 deletions Documentation/ABI/testing/sysfs-class-regulator
Original file line number Diff line number Diff line change
Expand Up @@ -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.
5 changes: 4 additions & 1 deletion Documentation/devicetree/bindings/regulator/regulator.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
31 changes: 7 additions & 24 deletions Documentation/devicetree/bindings/regulator/tps65217.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
73 changes: 29 additions & 44 deletions Documentation/devicetree/bindings/regulator/tps6586x.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 {
Expand All @@ -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>;
Expand All @@ -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>;
};
Expand Down
12 changes: 10 additions & 2 deletions arch/arm/mach-tegra/board-harmony-power.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,21 @@ 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);
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);
Expand All @@ -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),
Expand Down Expand Up @@ -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()) {
Expand Down
5 changes: 5 additions & 0 deletions drivers/extcon/extcon-arizona.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@ static int __devinit arizona_extcon_probe(struct platform_device *pdev)
regmap_update_bits(arizona->regmap, ARIZONA_JACK_DETECT_ANALOGUE,
ARIZONA_JD1_ENA, ARIZONA_JD1_ENA);

ret = regulator_allow_bypass(info->micvdd, true);
if (ret != 0)
dev_warn(arizona->dev, "Failed to set MICVDD to bypass: %d\n",
ret);

pm_runtime_put(&pdev->dev);

return 0;
Expand Down
13 changes: 13 additions & 0 deletions drivers/mfd/tps6586x.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/i2c.h>
#include <linux/regmap.h>
#include <linux/regulator/of_regulator.h>
#include <linux/regulator/machine.h>

#include <linux/mfd/core.h>
#include <linux/mfd/tps6586x.h>
Expand Down Expand Up @@ -346,6 +347,7 @@ static int __devinit tps6586x_add_subdevs(struct tps6586x *tps6586x,

#ifdef CONFIG_OF
static struct of_regulator_match tps6586x_matches[] = {
{ .name = "sys", .driver_data = (void *)TPS6586X_ID_SYS },
{ .name = "sm0", .driver_data = (void *)TPS6586X_ID_SM_0 },
{ .name = "sm1", .driver_data = (void *)TPS6586X_ID_SM_1 },
{ .name = "sm2", .driver_data = (void *)TPS6586X_ID_SM_2 },
Expand All @@ -369,6 +371,7 @@ static struct tps6586x_platform_data *tps6586x_parse_dt(struct i2c_client *clien
struct tps6586x_platform_data *pdata;
struct tps6586x_subdev_info *devs;
struct device_node *regs;
const char *sys_rail_name = NULL;
unsigned int count;
unsigned int i, j;
int err;
Expand All @@ -391,12 +394,22 @@ static struct tps6586x_platform_data *tps6586x_parse_dt(struct i2c_client *clien
return NULL;

for (i = 0, j = 0; i < num && j < count; i++) {
struct regulator_init_data *reg_idata;

if (!tps6586x_matches[i].init_data)
continue;

reg_idata = tps6586x_matches[i].init_data;
devs[j].name = "tps6586x-regulator";
devs[j].platform_data = tps6586x_matches[i].init_data;
devs[j].id = (int)tps6586x_matches[i].driver_data;
if (devs[j].id == TPS6586X_ID_SYS)
sys_rail_name = reg_idata->constraints.name;

if ((devs[j].id == TPS6586X_ID_LDO_5) ||
(devs[j].id == TPS6586X_ID_LDO_RTC))
reg_idata->supply_regulator = sys_rail_name;

devs[j].of_node = tps6586x_matches[i].of_node;
j++;
}
Expand Down
Loading

0 comments on commit 6a2027a

Please sign in to comment.