* [PATCH V1] regulator: Enable supply regulator if child rail is enabled.
@ 2012-01-02 7:38 ` Laxman Dewangan
0 siblings, 0 replies; 7+ messages in thread
From: Laxman Dewangan @ 2012-01-02 7:38 UTC (permalink / raw)
To: lrg-l0cyMroinI0,
broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA,
ldewangan-DDmLM1+adcrQT0dZR+AlfA
During regulator_register, the rail is set on the provided
machine constraints and if it is enabled then it is also
require to enable the supply regulator. This will make sure
that:
1. Proper reference count for supply regulator to be maintain.
2. Supply regulator should be enable when given rail is enabled.
Signed-off-by: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
When given rail is registered and if it has machine constratins to
enable the rail then it is also require to enable the supply rail for
a given rail. This will make sure that given rail is enabled and
proper reference count is maintained for the supply rail to avoid
disable of supply rail even child rail is enabled.
drivers/regulator/core.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index dbdebed..6e7a4f1 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2801,6 +2801,14 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
ret = set_supply(rdev, r);
if (ret < 0)
goto scrub;
+
+ /* Enable supply if rail is enabled */
+ if (rdev->desc->ops->is_enabled &&
+ rdev->desc->ops->is_enabled(rdev)) {
+ ret = regulator_enable(rdev->supply);
+ if (ret < 0)
+ goto scrub;
+ }
}
/* add consumers devices */
--
1.7.1.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH V1] regulator: Enable supply regulator if child rail is enabled.
@ 2012-01-02 7:38 ` Laxman Dewangan
0 siblings, 0 replies; 7+ messages in thread
From: Laxman Dewangan @ 2012-01-02 7:38 UTC (permalink / raw)
To: lrg, broonie, linux-kernel; +Cc: linux-tegra, ldewangan
During regulator_register, the rail is set on the provided
machine constraints and if it is enabled then it is also
require to enable the supply regulator. This will make sure
that:
1. Proper reference count for supply regulator to be maintain.
2. Supply regulator should be enable when given rail is enabled.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
When given rail is registered and if it has machine constratins to
enable the rail then it is also require to enable the supply rail for
a given rail. This will make sure that given rail is enabled and
proper reference count is maintained for the supply rail to avoid
disable of supply rail even child rail is enabled.
drivers/regulator/core.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index dbdebed..6e7a4f1 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2801,6 +2801,14 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
ret = set_supply(rdev, r);
if (ret < 0)
goto scrub;
+
+ /* Enable supply if rail is enabled */
+ if (rdev->desc->ops->is_enabled &&
+ rdev->desc->ops->is_enabled(rdev)) {
+ ret = regulator_enable(rdev->supply);
+ if (ret < 0)
+ goto scrub;
+ }
}
/* add consumers devices */
--
1.7.1.1
^ permalink raw reply related [flat|nested] 7+ messages in thread[parent not found: <1325489925-5148-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH V1] regulator: Enable supply regulator if child rail is enabled.
2012-01-02 7:38 ` Laxman Dewangan
@ 2012-01-02 11:36 ` Mark Brown
-1 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2012-01-02 11:36 UTC (permalink / raw)
To: Laxman Dewangan
Cc: lrg-l0cyMroinI0, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA
On Mon, Jan 02, 2012 at 01:08:45PM +0530, Laxman Dewangan wrote:
> During regulator_register, the rail is set on the provided
> machine constraints and if it is enabled then it is also
> require to enable the supply regulator. This will make sure
> that:
> 1. Proper reference count for supply regulator to be maintain.
> 2. Supply regulator should be enable when given rail is enabled.
>
> Signed-off-by: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Applied, thanks.
> When given rail is registered and if it has machine constratins to
> enable the rail then it is also require to enable the supply rail for
> a given rail. This will make sure that given rail is enabled and
> proper reference count is maintained for the supply rail to avoid
> disable of supply rail even child rail is enabled.
Why is this not in the changelog?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V1] regulator: Enable supply regulator if child rail is enabled.
@ 2012-01-02 11:36 ` Mark Brown
0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2012-01-02 11:36 UTC (permalink / raw)
To: Laxman Dewangan; +Cc: lrg, linux-kernel, linux-tegra
On Mon, Jan 02, 2012 at 01:08:45PM +0530, Laxman Dewangan wrote:
> During regulator_register, the rail is set on the provided
> machine constraints and if it is enabled then it is also
> require to enable the supply regulator. This will make sure
> that:
> 1. Proper reference count for supply regulator to be maintain.
> 2. Supply regulator should be enable when given rail is enabled.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Applied, thanks.
> When given rail is registered and if it has machine constratins to
> enable the rail then it is also require to enable the supply rail for
> a given rail. This will make sure that given rail is enabled and
> proper reference count is maintained for the supply rail to avoid
> disable of supply rail even child rail is enabled.
Why is this not in the changelog?
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH V1] regulator: Enable supply regulator if child rail is enabled.
2012-01-02 11:36 ` Mark Brown
(?)
@ 2012-01-02 12:07 ` Laxman Dewangan
[not found] ` <96C9D994977DD0439FB6D3FE3B13DD907DBD3A9A78-kdsAE/FnitNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
-1 siblings, 1 reply; 7+ messages in thread
From: Laxman Dewangan @ 2012-01-02 12:07 UTC (permalink / raw)
To: Mark Brown
Cc: lrg@ti.com, linux-kernel@vger.kernel.org,
linux-tegra@vger.kernel.org
> From: Mark Brown [mailto:broonie@opensource.wolfsonmicro.com]
> Sent: Monday, January 02, 2012 5:06 PM
> > During regulator_register, the rail is set on the provided
> > machine constraints and if it is enabled then it is also
> > require to enable the supply regulator. This will make sure
> > that:
> > 1. Proper reference count for supply regulator to be maintain.
> > 2. Supply regulator should be enable when given rail is enabled.
> >
> > Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
>
> Applied, thanks.
>
> > When given rail is registered and if it has machine constratins to
> > enable the rail then it is also require to enable the supply rail for
> > a given rail. This will make sure that given rail is enabled and
> > proper reference count is maintained for the supply rail to avoid
> > disable of supply rail even child rail is enabled.
>
> Why is this not in the changelog?
I think this is in just different wording for explaining the change.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-01-02 13:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-02 7:38 [PATCH V1] regulator: Enable supply regulator if child rail is enabled Laxman Dewangan
2012-01-02 7:38 ` Laxman Dewangan
[not found] ` <1325489925-5148-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-01-02 11:36 ` Mark Brown
2012-01-02 11:36 ` Mark Brown
2012-01-02 12:07 ` Laxman Dewangan
[not found] ` <96C9D994977DD0439FB6D3FE3B13DD907DBD3A9A78-kdsAE/FnitNDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-01-02 13:24 ` Mark Brown
2012-01-02 13:24 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.