2012-08-28 11:25:32

by Joonyoung Shim

[permalink] [raw]
Subject: [PATCH] regulator: max77686: add of_node assignment

Consumer nodes can reference regulators using <name>-supply from dts
file with this patch.

Signed-off-by: Joonyoung Shim <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
---
drivers/regulator/max77686.c | 2 ++
include/linux/mfd/max77686.h | 1 +
2 files changed, 3 insertions(+)

diff --git a/drivers/regulator/max77686.c b/drivers/regulator/max77686.c
index c564af6..87544b3 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,
rmatch.of_node = NULL;
of_regulator_match(iodev->dev, regulators_np, &rmatch, 1);
rdata[i].initdata = rmatch.init_data;
+ rdata[i].of_node = rmatch.of_node;
}

pdata->regulators = rdata;
@@ -325,6 +326,7 @@ static __devinit int max77686_pmic_probe(struct platform_device *pdev)

for (i = 0; i < MAX77686_REGULATORS; i++) {
config.init_data = pdata->regulators[i].initdata;
+ config.of_node = pdata->regulators[i].of_node;

rdev[i] = regulator_register(&regulators[i], &config);
if (IS_ERR(rdev[i])) {
diff --git a/include/linux/mfd/max77686.h b/include/linux/mfd/max77686.h
index 3d7ae4d..46c0f32 100644
--- a/include/linux/mfd/max77686.h
+++ b/include/linux/mfd/max77686.h
@@ -74,6 +74,7 @@ enum max77686_regulators {
struct max77686_regulator_data {
int id;
struct regulator_init_data *initdata;
+ struct device_node *of_node;
};

enum max77686_opmode {
--
1.7.9.5


2012-08-28 17:16:25

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] regulator: max77686: add of_node assignment

On Tue, Aug 28, 2012 at 08:25:30PM +0900, Joonyoung Shim wrote:
> Consumer nodes can reference regulators using <name>-supply from dts
> file with this patch.
>
> Signed-off-by: Joonyoung Shim <[email protected]>
> Signed-off-by: Kyungmin Park <[email protected]>

This doesn't apply against current code, the changes already appear to
be there...

2012-08-28 23:31:35

by Joonyoung Shim

[permalink] [raw]
Subject: Re: [PATCH] regulator: max77686: add of_node assignment

On 08/29/2012 02:16 AM, Mark Brown wrote:
> On Tue, Aug 28, 2012 at 08:25:30PM +0900, Joonyoung Shim wrote:
>> Consumer nodes can reference regulators using <name>-supply from dts
>> file with this patch.
>>
>> Signed-off-by: Joonyoung Shim <[email protected]>
>> Signed-off-by: Kyungmin Park <[email protected]>
> This doesn't apply against current code, the changes already appear to
> be there...
>

OK. I checked it from regulator git for-next branch now.

Thanks.