Skip to content

Commit

Permalink
Merge remote-tracking branches 'regulator/topic/s2mpa01', 'regulator/…
Browse files Browse the repository at this point in the history
…topic/supplies' and 'regulator/topic/tps65217' into regulator-next
  • Loading branch information
Mark Brown committed Feb 19, 2017
4 parents 0755fad + 33f0698 + 66d228a + b4c2e15 commit fad9cd4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
13 changes: 13 additions & 0 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1556,6 +1556,19 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
}
}

/*
* If the supply's parent device is not the same as the
* regulator's parent device, then ensure the parent device
* is bound before we resolve the supply, in case the parent
* device get probe deferred and unregisters the supply.
*/
if (r->dev.parent && r->dev.parent != rdev->dev.parent) {
if (!device_is_bound(r->dev.parent)) {
put_device(&r->dev);
return -EPROBE_DEFER;
}
}

/* Recursively resolve the supply of the supply */
ret = regulator_resolve_supply(r);
if (ret < 0) {
Expand Down
4 changes: 3 additions & 1 deletion drivers/regulator/s2mpa01.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define S2MPA01_REGULATOR_CNT ARRAY_SIZE(regulators)

struct s2mpa01_info {
struct of_regulator_match rdata[S2MPA01_REGULATOR_MAX];
int ramp_delay24;
int ramp_delay3;
int ramp_delay5;
Expand Down Expand Up @@ -341,16 +342,17 @@ static int s2mpa01_pmic_probe(struct platform_device *pdev)
{
struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
struct sec_platform_data *pdata = dev_get_platdata(iodev->dev);
struct of_regulator_match rdata[S2MPA01_REGULATOR_MAX] = { };
struct device_node *reg_np = NULL;
struct regulator_config config = { };
struct of_regulator_match *rdata;
struct s2mpa01_info *s2mpa01;
int i;

s2mpa01 = devm_kzalloc(&pdev->dev, sizeof(*s2mpa01), GFP_KERNEL);
if (!s2mpa01)
return -ENOMEM;

rdata = s2mpa01->rdata;
for (i = 0; i < S2MPA01_REGULATOR_CNT; i++)
rdata[i].name = regulators[i].name;

Expand Down
6 changes: 4 additions & 2 deletions drivers/regulator/tps65217-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ static const struct regulator_desc regulators[] = {
TPS65217_REGULATOR("DCDC1", TPS65217_DCDC_1, "dcdc1",
tps65217_pmic_ops, 64, TPS65217_REG_DEFDCDC1,
TPS65217_DEFDCDCX_DCDC_MASK, TPS65217_ENABLE_DC1_EN,
NULL, tps65217_uv1_ranges, 2, TPS65217_REG_SEQ1,
NULL, tps65217_uv1_ranges,
ARRAY_SIZE(tps65217_uv1_ranges), TPS65217_REG_SEQ1,
TPS65217_SEQ1_DC1_SEQ_MASK),
TPS65217_REGULATOR("DCDC2", TPS65217_DCDC_2, "dcdc2",
tps65217_pmic_ops, 64, TPS65217_REG_DEFDCDC2,
Expand All @@ -190,7 +191,8 @@ static const struct regulator_desc regulators[] = {
TPS65217_REGULATOR("DCDC3", TPS65217_DCDC_3, "dcdc3",
tps65217_pmic_ops, 64, TPS65217_REG_DEFDCDC3,
TPS65217_DEFDCDCX_DCDC_MASK, TPS65217_ENABLE_DC3_EN,
NULL, tps65217_uv1_ranges, 1, TPS65217_REG_SEQ2,
NULL, tps65217_uv1_ranges,
ARRAY_SIZE(tps65217_uv1_ranges), TPS65217_REG_SEQ2,
TPS65217_SEQ2_DC3_SEQ_MASK),
TPS65217_REGULATOR("LDO1", TPS65217_LDO_1, "ldo1",
tps65217_pmic_ldo1_ops, 16, TPS65217_REG_DEFLDO1,
Expand Down

0 comments on commit fad9cd4

Please sign in to comment.