* [PATCH V2] regulator: dt: fix the name of regulator supply
@ 2012-05-18 19:34 Laxman Dewangan
2012-05-19 10:43 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Laxman Dewangan @ 2012-05-18 19:34 UTC (permalink / raw)
To: broonie, grant.likely, rob.herring, lrg
Cc: devicetree-discuss, linux-doc, Laxman Dewangan
If there is any input supply for regulator then the name
of supply need to provided by init_data->supply_regulator.
In dt case, the input supply is searched by the <name>-supply
and here it is require to fix the name so that correct device
node can be identified at the time of regulator registration.
Fixing the name for input supply as "regulator-supply".
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
Change from V1:
Correction of typo in changelog.
.../devicetree/bindings/regulator/regulator.txt | 4 ++--
drivers/regulator/of_regulator.c | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/regulator/regulator.txt b/Documentation/devicetree/bindings/regulator/regulator.txt
index 5b7a408..6c8de69 100644
--- a/Documentation/devicetree/bindings/regulator/regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/regulator.txt
@@ -9,7 +9,7 @@ Optional properties:
- regulator-max-microamp: largest current consumers may set
- regulator-always-on: boolean, regulator should never be disabled
- regulator-boot-on: bootloader/firmware enabled regulator
-- <name>-supply: phandle to the parent supply/regulator node
+- regulator-supply: phandle to the parent supply/regulator node
Example:
@@ -17,7 +17,7 @@ Example:
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <2500000>;
regulator-always-on;
- vin-supply = <&vin>;
+ regulator-supply = <&vin>;
};
Regulator Consumers:
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index 56593b7..48d6449 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -60,6 +60,9 @@ static void of_get_regulation_constraints(struct device_node *np,
constraints->always_on = true;
else /* status change should be possible if not always on. */
constraints->valid_ops_mask |= REGULATOR_CHANGE_STATUS;
+
+ if (of_find_property(np, "regulator-supply", NULL))
+ (*init_data)->supply_regulator = "regulator";
}
/**
--
1.7.1.1
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH V2] regulator: dt: fix the name of regulator supply
2012-05-18 19:34 [PATCH V2] regulator: dt: fix the name of regulator supply Laxman Dewangan
@ 2012-05-19 10:43 ` Mark Brown
2012-05-19 12:38 ` Laxman Dewangan
0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2012-05-19 10:43 UTC (permalink / raw)
To: Laxman Dewangan
Cc: grant.likely, rob.herring, lrg, devicetree-discuss, linux-doc
[-- Attachment #1: Type: text/plain, Size: 680 bytes --]
On Sat, May 19, 2012 at 01:04:12AM +0530, Laxman Dewangan wrote:
> If there is any input supply for regulator then the name
> of supply need to provided by init_data->supply_regulator.
> In dt case, the input supply is searched by the <name>-supply
> and here it is require to fix the name so that correct device
> node can be identified at the time of regulator registration.
> Fixing the name for input supply as "regulator-supply".
No, supply_regulator is a legacy thing. Regulators should set
supply_name in their regulator_desc to tell the framework what name
the parent has, allowing these supplies to behave in the same way
as other supplies as far as the binding goes.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V2] regulator: dt: fix the name of regulator supply
2012-05-19 10:43 ` Mark Brown
@ 2012-05-19 12:38 ` Laxman Dewangan
2012-05-19 13:10 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Laxman Dewangan @ 2012-05-19 12:38 UTC (permalink / raw)
To: Mark Brown
Cc: grant.likely@secretlab.ca, rob.herring@calxeda.com, lrg@ti.com,
devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org
On Saturday 19 May 2012 04:13 PM, Mark Brown wrote:
> * PGP Signed by an unknown key
>
> On Sat, May 19, 2012 at 01:04:12AM +0530, Laxman Dewangan wrote:
>> If there is any input supply for regulator then the name
>> of supply need to provided by init_data->supply_regulator.
>> In dt case, the input supply is searched by the<name>-supply
>> and here it is require to fix the name so that correct device
>> node can be identified at the time of regulator registration.
>> Fixing the name for input supply as "regulator-supply".
> No, supply_regulator is a legacy thing. Regulators should set
> supply_name in their regulator_desc to tell the framework what name
> the parent has, allowing these supplies to behave in the same way
> as other supplies as far as the binding goes.
So if there is two regulator ldo1 and ldo2 where ldo1 is supply for ldo2
then
ldo1: ldo1 {
:::::::
:::::::
};
ldo2: ldo2 {
:::::::
ldo2-supply = <&ldo1>;
};
and when we parse the regulator node, we should see the property name as
the <name>-supply i.e. ldo1-supply or ldo2-supply and when it found then
we set the
regulator_desc->supply_name = "ldo2"?
The descriptor is set on the regulator driver and hence it need to be
parse this in the regulator driver.
We need to set the name regulator_desc->supply_name and hence it needs
to be in dt binding documentation of that device/regulators.
Is this what you recommend?
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V2] regulator: dt: fix the name of regulator supply
2012-05-19 12:38 ` Laxman Dewangan
@ 2012-05-19 13:10 ` Mark Brown
2012-05-19 14:21 ` Laxman Dewangan
0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2012-05-19 13:10 UTC (permalink / raw)
To: Laxman Dewangan
Cc: grant.likely@secretlab.ca, rob.herring@calxeda.com, lrg@ti.com,
devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 569 bytes --]
On Sat, May 19, 2012 at 06:08:28PM +0530, Laxman Dewangan wrote:
> The descriptor is set on the regulator driver and hence it need to
> be parse this in the regulator driver.
> We need to set the name regulator_desc->supply_name and hence it
> needs to be in dt binding documentation of that device/regulators.
> Is this what you recommend?
I'm sorry, I still can't understand what you're trying to say here
especially the first sentance. Listing the name of the supply in the
binding documentation doesn't seem like a bad idea if that's what you're
trying to say.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH V2] regulator: dt: fix the name of regulator supply
2012-05-19 13:10 ` Mark Brown
@ 2012-05-19 14:21 ` Laxman Dewangan
0 siblings, 0 replies; 5+ messages in thread
From: Laxman Dewangan @ 2012-05-19 14:21 UTC (permalink / raw)
To: Mark Brown
Cc: grant.likely@secretlab.ca, rob.herring@calxeda.com, lrg@ti.com,
devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org
On Saturday 19 May 2012 06:40 PM, Mark Brown wrote:
> * PGP Signed by an unknown key
>
> On Sat, May 19, 2012 at 06:08:28PM +0530, Laxman Dewangan wrote:
>
>> The descriptor is set on the regulator driver and hence it need to
>> be parse this in the regulator driver.
>> We need to set the name regulator_desc->supply_name and hence it
>> needs to be in dt binding documentation of that device/regulators.
>> Is this what you recommend?
> I'm sorry, I still can't understand what you're trying to say here
> especially the first sentance. Listing the name of the supply in the
> binding documentation doesn't seem like a bad idea if that's what you're
> trying to say.
Sorry for not explaining this in well.
In dts file for regulator, I want to specify the supply name same as the
regulator name i.e.
more generic
my_reg1: abc {
:::::::::::
};
my_reg2: xyz {
::::::::::::::;
xyz-supply = <&my_reg1>;
};
other way:
my_regname: <name> {
:::::::::;
<name>-supply = <&supply_reg>
};
This will be parsed in regulator driver file, not in core files.
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-05-19 14:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-18 19:34 [PATCH V2] regulator: dt: fix the name of regulator supply Laxman Dewangan
2012-05-19 10:43 ` Mark Brown
2012-05-19 12:38 ` Laxman Dewangan
2012-05-19 13:10 ` Mark Brown
2012-05-19 14:21 ` 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).