Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302207
b: refs/heads/master
c: 88c84c1
h: refs/heads/master
i:
  302205: 3fa0da2
  302203: 051c50b
  302199: 8357fd2
  302191: fb7af3c
  302175: 9e7a0b4
  302143: 04905db
  302079: efcea51
v: v3
  • Loading branch information
Ying-Chun Liu (PaulLiu) authored and Mark Brown committed Apr 13, 2012
1 parent beae4f4 commit 66c22af
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4d26f7d581b7cff8e5efd0bf9c1867caa09a1e90
refs/heads/master: 88c84c14cca44d9409f1733dfdecc1f473463f20
29 changes: 28 additions & 1 deletion trunk/drivers/regulator/da9052-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#ifdef CONFIG_OF
#include <linux/regulator/of_regulator.h>
#endif

#include <linux/mfd/da9052/da9052.h>
#include <linux/mfd/da9052/reg.h>
Expand Down Expand Up @@ -425,8 +428,32 @@ static int __devinit da9052_regulator_probe(struct platform_device *pdev)
}

config.dev = &pdev->dev;
config.init_data = pdata->regulators[pdev->id];
config.driver_data = regulator;
if (pdata && pdata->regulators) {
config.init_data = pdata->regulators[pdev->id];
} else {
#ifdef CONFIG_OF
struct device_node *nproot = da9052->dev->of_node;
struct device_node *np;

if (!nproot)
return -ENODEV;

nproot = of_find_node_by_name(nproot, "regulators");
if (!nproot)
return -ENODEV;

for (np = of_get_next_child(nproot, NULL); !np;
np = of_get_next_child(nproot, np)) {
if (!of_node_cmp(np->name,
regulator->info->reg_desc.name)) {
config.init_data = of_get_regulator_init_data(
&pdev->dev, np);
break;
}
}
#endif
}

regulator->rdev = regulator_register(&regulator->info->reg_desc,
&config);
Expand Down

0 comments on commit 66c22af

Please sign in to comment.