Skip to content

Commit

Permalink
Merge remote-tracking branches 'regulator/topic/as3711', 'regulator/t…
Browse files Browse the repository at this point in the history
…opic/axp20x', 'regulator/topic/bcm590xx' and 'regulator/topic/da9211' into regulator-next
  • Loading branch information
broonie committed Sep 30, 2014
5 parents 74a0f24 + 192264e + 0d90ecf + e0f6429 + 6a52f56 commit 95528a5
Show file tree
Hide file tree
Showing 8 changed files with 260 additions and 71 deletions.
63 changes: 63 additions & 0 deletions Documentation/devicetree/bindings/regulator/da9211.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
* Dialog Semiconductor DA9211/DA9213 Voltage Regulator

Required properties:
- compatible: "dlg,da9211" or "dlg,da9213".
- reg: I2C slave address, usually 0x68.
- 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.
BUCKA and BUCKB.

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

Example 1) DA9211

pmic: da9211@68 {
compatible = "dlg,da9211";
reg = <0x68>;
interrupts = <3 27>;

regulators {
BUCKA {
regulator-name = "VBUCKA";
regulator-min-microvolt = < 300000>;
regulator-max-microvolt = <1570000>;
regulator-min-microamp = <2000000>;
regulator-max-microamp = <5000000>;
};
BUCKB {
regulator-name = "VBUCKB";
regulator-min-microvolt = < 300000>;
regulator-max-microvolt = <1570000>;
regulator-min-microamp = <2000000>;
regulator-max-microamp = <5000000>;
};
};
};

Example 2) DA92113
pmic: da9213@68 {
compatible = "dlg,da9213";
reg = <0x68>;
interrupts = <3 27>;

regulators {
BUCKA {
regulator-name = "VBUCKA";
regulator-min-microvolt = < 300000>;
regulator-max-microvolt = <1570000>;
regulator-min-microamp = <3000000>;
regulator-max-microamp = <6000000>;
};
BUCKB {
regulator-name = "VBUCKB";
regulator-min-microvolt = < 300000>;
regulator-max-microvolt = <1570000>;
regulator-min-microamp = <3000000>;
regulator-max-microamp = <6000000>;
};
};
};
9 changes: 5 additions & 4 deletions drivers/regulator/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,14 @@ config REGULATOR_DA9210
interface.

config REGULATOR_DA9211
tristate "Dialog Semiconductor DA9211/DA9212 regulator"
tristate "Dialog Semiconductor DA9211/DA9212/DA9213/DA9214 regulator"
depends on I2C
select REGMAP_I2C
help
Say y here to support for the Dialog Semiconductor DA9211/DA9212.
The DA9211/DA9212 is a multi-phase synchronous step down
converter 12A DC-DC Buck controlled through an I2C
Say y here to support for the Dialog Semiconductor DA9211/DA9212
/DA9213/DA9214.
The DA9211/DA9212/DA9213/DA9214 is a multi-phase synchronous
step down converter 12A or 16A DC-DC Buck controlled through an I2C
interface.

config REGULATOR_DBX500_PRCMU
Expand Down
61 changes: 28 additions & 33 deletions drivers/regulator/as3711-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@

struct as3711_regulator_info {
struct regulator_desc desc;
unsigned int max_uV;
};

struct as3711_regulator {
struct as3711_regulator_info *reg_info;
struct regulator_dev *rdev;
};

/*
Expand Down Expand Up @@ -132,39 +130,37 @@ static const struct regulator_linear_range as3711_dldo_ranges[] = {
REGULATOR_LINEAR_RANGE(1750000, 0x20, 0x3f, 50000),
};

#define AS3711_REG(_id, _en_reg, _en_bit, _vmask, _vshift, _min_uV, _max_uV, _sfx) \
[AS3711_REGULATOR_ ## _id] = { \
.desc = { \
.name = "as3711-regulator-" # _id, \
.id = AS3711_REGULATOR_ ## _id, \
.n_voltages = (_vmask + 1), \
.ops = &as3711_ ## _sfx ## _ops, \
.type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \
.vsel_reg = AS3711_ ## _id ## _VOLTAGE, \
.vsel_mask = _vmask << _vshift, \
.enable_reg = AS3711_ ## _en_reg, \
.enable_mask = BIT(_en_bit), \
.min_uV = _min_uV, \
.linear_ranges = as3711_ ## _sfx ## _ranges, \
.n_linear_ranges = ARRAY_SIZE(as3711_ ## _sfx ## _ranges), \
}, \
.max_uV = _max_uV, \
#define AS3711_REG(_id, _en_reg, _en_bit, _vmask, _sfx) \
[AS3711_REGULATOR_ ## _id] = { \
.desc = { \
.name = "as3711-regulator-" # _id, \
.id = AS3711_REGULATOR_ ## _id, \
.n_voltages = (_vmask + 1), \
.ops = &as3711_ ## _sfx ## _ops, \
.type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \
.vsel_reg = AS3711_ ## _id ## _VOLTAGE, \
.vsel_mask = _vmask, \
.enable_reg = AS3711_ ## _en_reg, \
.enable_mask = BIT(_en_bit), \
.linear_ranges = as3711_ ## _sfx ## _ranges, \
.n_linear_ranges = ARRAY_SIZE(as3711_ ## _sfx ## _ranges), \
}, \
}

static struct as3711_regulator_info as3711_reg_info[] = {
AS3711_REG(SD_1, SD_CONTROL, 0, 0x7f, 0, 612500, 3350000, sd),
AS3711_REG(SD_2, SD_CONTROL, 1, 0x7f, 0, 612500, 3350000, sd),
AS3711_REG(SD_3, SD_CONTROL, 2, 0x7f, 0, 612500, 3350000, sd),
AS3711_REG(SD_4, SD_CONTROL, 3, 0x7f, 0, 612500, 3350000, sd),
AS3711_REG(LDO_1, LDO_1_VOLTAGE, 7, 0x1f, 0, 1200000, 3300000, aldo),
AS3711_REG(LDO_2, LDO_2_VOLTAGE, 7, 0x1f, 0, 1200000, 3300000, aldo),
AS3711_REG(LDO_3, LDO_3_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo),
AS3711_REG(LDO_4, LDO_4_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo),
AS3711_REG(LDO_5, LDO_5_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo),
AS3711_REG(LDO_6, LDO_6_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo),
AS3711_REG(LDO_7, LDO_7_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo),
AS3711_REG(LDO_8, LDO_8_VOLTAGE, 7, 0x3f, 0, 900000, 3300000, dldo),
AS3711_REG(SD_1, SD_CONTROL, 0, 0x7f, sd),
AS3711_REG(SD_2, SD_CONTROL, 1, 0x7f, sd),
AS3711_REG(SD_3, SD_CONTROL, 2, 0x7f, sd),
AS3711_REG(SD_4, SD_CONTROL, 3, 0x7f, sd),
AS3711_REG(LDO_1, LDO_1_VOLTAGE, 7, 0x1f, aldo),
AS3711_REG(LDO_2, LDO_2_VOLTAGE, 7, 0x1f, aldo),
AS3711_REG(LDO_3, LDO_3_VOLTAGE, 7, 0x3f, dldo),
AS3711_REG(LDO_4, LDO_4_VOLTAGE, 7, 0x3f, dldo),
AS3711_REG(LDO_5, LDO_5_VOLTAGE, 7, 0x3f, dldo),
AS3711_REG(LDO_6, LDO_6_VOLTAGE, 7, 0x3f, dldo),
AS3711_REG(LDO_7, LDO_7_VOLTAGE, 7, 0x3f, dldo),
AS3711_REG(LDO_8, LDO_8_VOLTAGE, 7, 0x3f, dldo),
/* StepUp output voltage depends on supplying regulator */
};

Expand Down Expand Up @@ -263,7 +259,6 @@ static int as3711_regulator_probe(struct platform_device *pdev)
ri->desc.name);
return PTR_ERR(rdev);
}
reg->rdev = rdev;
}
platform_set_drvdata(pdev, regs);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/axp20x-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
for (i = 0; i < AXP20X_REG_ID_MAX; i++) {
init_data = axp20x_matches[i].init_data;

config.dev = &pdev->dev;
config.dev = pdev->dev.parent;
config.init_data = init_data;
config.regmap = axp20x->regmap;
config.of_node = axp20x_matches[i].of_node;
Expand Down
8 changes: 0 additions & 8 deletions drivers/regulator/bcm590xx-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ static struct bcm590xx_info bcm590xx_regs[] = {
struct bcm590xx_reg {
struct regulator_desc *desc;
struct bcm590xx *mfd;
struct bcm590xx_info **info;
};

static int bcm590xx_get_vsel_register(int id)
Expand Down Expand Up @@ -389,11 +388,6 @@ static int bcm590xx_probe(struct platform_device *pdev)
if (!pmu->desc)
return -ENOMEM;

pmu->info = devm_kzalloc(&pdev->dev, BCM590XX_NUM_REGS *
sizeof(struct bcm590xx_info *), GFP_KERNEL);
if (!pmu->info)
return -ENOMEM;

info = bcm590xx_regs;

for (i = 0; i < BCM590XX_NUM_REGS; i++, info++) {
Expand All @@ -403,8 +397,6 @@ static int bcm590xx_probe(struct platform_device *pdev)
reg_data = NULL;

/* Register the regulators */
pmu->info[i] = info;

pmu->desc[i].name = info->name;
pmu->desc[i].supply_name = info->vin_name;
pmu->desc[i].id = i;
Expand Down
Loading

0 comments on commit 95528a5

Please sign in to comment.