diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-08-04 22:09:57 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-08-28 14:00:25 -0400 |
commit | 2c58e2669f197ab0fd5e7552fe82f7bc7d06b15d (patch) | |
tree | 6db6d1abe97eaf4d604badd2e7b127a94fe67b0e | |
parent | 7fee2afb5354f4391cbabba5f377c18d1fe50a83 (diff) |
regulator: max77686: initialize of_node param for regulator register
Initialize config.of_node for regulator before registering.
This is needed for DT based regulator support.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | drivers/regulator/max77686.c | 2 | ||||
-rw-r--r-- | include/linux/mfd/max77686.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/drivers/regulator/max77686.c b/drivers/regulator/max77686.c index c564af6f05a3..87544b34628a 100644 --- a/drivers/regulator/max77686.c +++ b/drivers/regulator/max77686.c | |||
@@ -265,6 +265,7 @@ static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev, | |||
265 | rmatch.of_node = NULL; | 265 | rmatch.of_node = NULL; |
266 | of_regulator_match(iodev->dev, regulators_np, &rmatch, 1); | 266 | of_regulator_match(iodev->dev, regulators_np, &rmatch, 1); |
267 | rdata[i].initdata = rmatch.init_data; | 267 | rdata[i].initdata = rmatch.init_data; |
268 | rdata[i].of_node = rmatch.of_node; | ||
268 | } | 269 | } |
269 | 270 | ||
270 | pdata->regulators = rdata; | 271 | pdata->regulators = rdata; |
@@ -325,6 +326,7 @@ static __devinit int max77686_pmic_probe(struct platform_device *pdev) | |||
325 | 326 | ||
326 | for (i = 0; i < MAX77686_REGULATORS; i++) { | 327 | for (i = 0; i < MAX77686_REGULATORS; i++) { |
327 | config.init_data = pdata->regulators[i].initdata; | 328 | config.init_data = pdata->regulators[i].initdata; |
329 | config.of_node = pdata->regulators[i].of_node; | ||
328 | 330 | ||
329 | rdev[i] = regulator_register(®ulators[i], &config); | 331 | rdev[i] = regulator_register(®ulators[i], &config); |
330 | if (IS_ERR(rdev[i])) { | 332 | if (IS_ERR(rdev[i])) { |
diff --git a/include/linux/mfd/max77686.h b/include/linux/mfd/max77686.h index 3d7ae4d7fd36..46c0f320ed76 100644 --- a/include/linux/mfd/max77686.h +++ b/include/linux/mfd/max77686.h | |||
@@ -74,6 +74,7 @@ enum max77686_regulators { | |||
74 | struct max77686_regulator_data { | 74 | struct max77686_regulator_data { |
75 | int id; | 75 | int id; |
76 | struct regulator_init_data *initdata; | 76 | struct regulator_init_data *initdata; |
77 | struct device_node *of_node; | ||
77 | }; | 78 | }; |
78 | 79 | ||
79 | enum max77686_opmode { | 80 | enum max77686_opmode { |