linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] regulator: tps6586x: register regulator even if no init data
@ 2012-08-29 15:01 Laxman Dewangan
  2012-08-29 17:38 ` Stephen Warren
  2012-09-04 20:47 ` Stephen Warren
  0 siblings, 2 replies; 6+ messages in thread
From: Laxman Dewangan @ 2012-08-29 15:01 UTC (permalink / raw)
  To: sameo, lrg, broonie; +Cc: linux-kernel, swarren, Laxman Dewangan

Register all TPS6586x regulators even if there is no regulator
init data for platform i.e. without any user-supplied constraints.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
Changes from V1:
Stephen pointed out that the pointer in if should be same what it
is used inside the if statements.
Making the change to address this.

 drivers/mfd/tps6586x.c                 |   16 ++++++++--------
 drivers/regulator/tps6586x-regulator.c |    3 +++
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index 380a3c8..4a91a62 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -396,19 +396,19 @@ static struct tps6586x_platform_data *tps6586x_parse_dt(struct i2c_client *clien
 	for (i = 0, j = 0; i < num && j < count; i++) {
 		struct regulator_init_data *reg_idata;
 
-		if (!tps6586x_matches[i].init_data)
-			continue;
-
 		reg_idata  = tps6586x_matches[i].init_data;
 		devs[j].name = "tps6586x-regulator";
 		devs[j].platform_data = tps6586x_matches[i].init_data;
 		devs[j].id = (int)tps6586x_matches[i].driver_data;
-		if (devs[j].id == TPS6586X_ID_SYS)
-			sys_rail_name = reg_idata->constraints.name;
 
-		if ((devs[j].id == TPS6586X_ID_LDO_5) ||
-			(devs[j].id == TPS6586X_ID_LDO_RTC))
-			reg_idata->supply_regulator = sys_rail_name;
+		if (reg_idata) {
+			if (devs[j].id == TPS6586X_ID_SYS)
+				sys_rail_name = reg_idata->constraints.name;
+
+			if ((devs[j].id == TPS6586X_ID_LDO_5) ||
+				(devs[j].id == TPS6586X_ID_LDO_RTC))
+				reg_idata->supply_regulator = sys_rail_name;
+		}
 
 		devs[j].of_node = tps6586x_matches[i].of_node;
 		j++;
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
index ce1e7cb..4508222 100644
--- a/drivers/regulator/tps6586x-regulator.c
+++ b/drivers/regulator/tps6586x-regulator.c
@@ -332,6 +332,9 @@ static int __devinit tps6586x_regulator_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, rdev);
 
+	if (!pdev->dev.platform_data)
+		return 0;
+
 	return tps6586x_regulator_set_slew_rate(pdev);
 }
 
-- 
1.7.1.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] regulator: tps6586x: register regulator even if no init data
  2012-08-29 15:01 [PATCH V2] regulator: tps6586x: register regulator even if no init data Laxman Dewangan
@ 2012-08-29 17:38 ` Stephen Warren
  2012-09-04 20:47 ` Stephen Warren
  1 sibling, 0 replies; 6+ messages in thread
From: Stephen Warren @ 2012-08-29 17:38 UTC (permalink / raw)
  To: Laxman Dewangan; +Cc: sameo, lrg, broonie, linux-kernel

On 08/29/12 08:01, Laxman Dewangan wrote:
> Register all TPS6586x regulators even if there is no regulator
> init data for platform i.e. without any user-supplied constraints.

I think this looks OK now, although I would like to test it, and check 
for any interactions etc. with the other TPS6586x patches, when I get 
back into the office next Tuesday.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] regulator: tps6586x: register regulator even if no init data
  2012-08-29 15:01 [PATCH V2] regulator: tps6586x: register regulator even if no init data Laxman Dewangan
  2012-08-29 17:38 ` Stephen Warren
@ 2012-09-04 20:47 ` Stephen Warren
  2012-09-05  8:02   ` Laxman Dewangan
  1 sibling, 1 reply; 6+ messages in thread
From: Stephen Warren @ 2012-09-04 20:47 UTC (permalink / raw)
  To: broonie; +Cc: Laxman Dewangan, sameo, lrg, linux-kernel

On 08/29/2012 09:01 AM, Laxman Dewangan wrote:
> Register all TPS6586x regulators even if there is no regulator
> init data for platform i.e. without any user-supplied constraints.
> 
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>

Tested-by: Stephen Warren <swarren@nvidia.com>

Note that this patch depends on the patch I just posted titled
"regulator: tps6586x: add support for SYS rail". I also believe Laxman
will be posting another patch based on these 2 soon (it will move the
regulator DT parsing out of the MFD driver into the regulator driver),
so I guess it makes sense to take them all through the same TPS6586x
topic branch in the regulator tree.

That all said, I only care about merging the first patch, "regulator:
tps6586x: add support for SYS rail", into the Tegra tree, so please
don't wait for the 3rd patch before making any tag for me to pull.

Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] regulator: tps6586x: register regulator even if no init data
  2012-09-04 20:47 ` Stephen Warren
@ 2012-09-05  8:02   ` Laxman Dewangan
  2012-09-05 15:33     ` Stephen Warren
  0 siblings, 1 reply; 6+ messages in thread
From: Laxman Dewangan @ 2012-09-05  8:02 UTC (permalink / raw)
  To: Stephen Warren; +Cc: broonie, sameo, lrg, linux-kernel

On Wednesday 05 September 2012 02:17 AM, Stephen Warren wrote:
> On 08/29/2012 09:01 AM, Laxman Dewangan wrote:
>> Register all TPS6586x regulators even if there is no regulator
>> init data for platform i.e. without any user-supplied constraints.
>>
>> Signed-off-by: Laxman Dewangan<ldewangan@nvidia.com>
> Tested-by: Stephen Warren<swarren@nvidia.com>
>
> Note that this patch depends on the patch I just posted titled
> "regulator: tps6586x: add support for SYS rail". I also believe Laxman
> will be posting another patch based on these 2 soon (it will move the
> regulator DT parsing out of the MFD driver into the regulator driver),
> so I guess it makes sense to take them all through the same TPS6586x
> topic branch in the regulator tree.

About next patch (moving regulator dt parsing out of mfd), do you want 
to support the Harmony also?
If yes then same change should also contain the board-harmony-power.c 
changes.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] regulator: tps6586x: register regulator even if no init data
  2012-09-05  8:02   ` Laxman Dewangan
@ 2012-09-05 15:33     ` Stephen Warren
  2012-09-06 11:31       ` Laxman Dewangan
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Warren @ 2012-09-05 15:33 UTC (permalink / raw)
  To: Laxman Dewangan; +Cc: broonie, sameo, lrg, linux-kernel

On 09/05/2012 02:02 AM, Laxman Dewangan wrote:
> On Wednesday 05 September 2012 02:17 AM, Stephen Warren wrote:
>> On 08/29/2012 09:01 AM, Laxman Dewangan wrote:
>>> Register all TPS6586x regulators even if there is no regulator
>>> init data for platform i.e. without any user-supplied constraints.
>>>
>>> Signed-off-by: Laxman Dewangan<ldewangan@nvidia.com>
>> Tested-by: Stephen Warren<swarren@nvidia.com>
>>
>> Note that this patch depends on the patch I just posted titled
>> "regulator: tps6586x: add support for SYS rail". I also believe Laxman
>> will be posting another patch based on these 2 soon (it will move the
>> regulator DT parsing out of the MFD driver into the regulator driver),
>> so I guess it makes sense to take them all through the same TPS6586x
>> topic branch in the regulator tree.
> 
> About next patch (moving regulator dt parsing out of mfd), do you want
> to support the Harmony also?
> If yes then same change should also contain the board-harmony-power.c
> changes.

Yes, Harmony needs to continue working.

We can either:

a) Add your third patch to the TPS6586x topic branch in the regulator
tree, and I'll merge all 3 into the Tegra tree in order to build on it
and switch the regulators to DT.

b) You can wait to submit your third patch until after the 3.7 merge
window (i.e. send if for 3.8) since then all the dependencies will have
appeared in Linus's tree as a baseline. This is probably the simplest.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] regulator: tps6586x: register regulator even if no init data
  2012-09-05 15:33     ` Stephen Warren
@ 2012-09-06 11:31       ` Laxman Dewangan
  0 siblings, 0 replies; 6+ messages in thread
From: Laxman Dewangan @ 2012-09-06 11:31 UTC (permalink / raw)
  To: Stephen Warren; +Cc: broonie, sameo, lrg, linux-kernel

On Wednesday 05 September 2012 09:03 PM, Stephen Warren wrote:
> On 09/05/2012 02:02 AM, Laxman Dewangan wrote:
>> On Wednesday 05 September 2012 02:17 AM, Stephen Warren wrote:
>>> On 08/29/2012 09:01 AM, Laxman Dewangan wrote:
>>>> Register all TPS6586x regulators even if there is no regulator
>>>> init data for platform i.e. without any user-supplied constraints.
>>>>
>>>> Signed-off-by: Laxman Dewangan<ldewangan@nvidia.com>
>>> Tested-by: Stephen Warren<swarren@nvidia.com>
>>>
>>> Note that this patch depends on the patch I just posted titled
>>> "regulator: tps6586x: add support for SYS rail". I also believe Laxman
>>> will be posting another patch based on these 2 soon (it will move the
>>> regulator DT parsing out of the MFD driver into the regulator driver),
>>> so I guess it makes sense to take them all through the same TPS6586x
>>> topic branch in the regulator tree.
>> About next patch (moving regulator dt parsing out of mfd), do you want
>> to support the Harmony also?
>> If yes then same change should also contain the board-harmony-power.c
>> changes.
> Yes, Harmony needs to continue working.
>
> We can either:
>
> a) Add your third patch to the TPS6586x topic branch in the regulator
> tree, and I'll merge all 3 into the Tegra tree in order to build on it
> and switch the regulators to DT.
>
> b) You can wait to submit your third patch until after the 3.7 merge
> window (i.e. send if for 3.8) since then all the dependencies will have
> appeared in Linus's tree as a baseline. This is probably the simplest.

I will go with option (b) as this is just enhancement and not any 
critical bug fixes.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-09-06 11:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-29 15:01 [PATCH V2] regulator: tps6586x: register regulator even if no init data Laxman Dewangan
2012-08-29 17:38 ` Stephen Warren
2012-09-04 20:47 ` Stephen Warren
2012-09-05  8:02   ` Laxman Dewangan
2012-09-05 15:33     ` Stephen Warren
2012-09-06 11:31       ` Laxman Dewangan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).