From: Rajendra Nayak <rnayak@ti.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: b-cousson@ti.com, patches@linaro.org, tony@atomide.com,
devicetree-discuss@lists.ozlabs.org, grant.likely@secretlab.ca,
linux-omap@vger.kernel.org, lrg@ti.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data
Date: Tue, 04 Oct 2011 10:58:40 +0530 [thread overview]
Message-ID: <4E8A9988.3080907@ti.com> (raw)
In-Reply-To: <20110930121844.GI5366@opensource.wolfsonmicro.com>
On Friday 30 September 2011 05:48 PM, Mark Brown wrote:
> On Fri, Sep 30, 2011 at 04:39:02PM +0530, Rajendra Nayak wrote:
>
>> The "regulator-supplies" is used to specific the regulator *parent*.
>> Same as what was earlier passed by using the
>> "supply_regulator" field of regulator_init_data structure.
>> Grant wanted the bindings to support specifying multiple parents
>> and hence I was thinking of either a list of names *or*
>> a list of phandles to specify multiple parents to a regulator.
>
> So, as I'm fairly sure I said last time these are just standard
> supplies. It just happens to be that the consumer is a regulator. The
> fact that Linux chooses to have core framework handling for this is an
> implementation detail of Linux (and indeed many devices ignore this for
> their on board regulators).
Yes, the implementation details of linux is what is making me using
these bindings difficult, and maybe you can help me how I can work
around the framework. The binding themselves, I agree should not care
if the consumer is a device/IP or a regulator itself.
So here's my problem:
I use the <name-supply> = <®_phandle> binding to define
a device/IP using one/more regulators on one/more rails.
device mmc {
...
...
vmmc-supply = <&vmmc>;
vpll-supply = <&vpll>;
};
The parsing of the "vmmc-supply" or the "vpll-supply" property
happens only when a mmc drivers makes a call to
regulator_get() passing the supply-name as "vmmc" or "vpll".
For ex:
regulator_get(dev, "vmmc"); or regulator_get(dev, "vpll");
Its easy to just append the "-supply" to a "vmmc" or "vpll"
and derive a property name like "vmm-supply" or "vpll-supply".
Now lets take the case of a regulator as a consumer:
regulator vmmc {
...
...
vin-supply = <&vin>;
};
Now I need to parse the "vin-supply" property during a
regulator_register(), so I could do a set_supply() and
create the parent/child relationship between a vin and
vmmc.
The problem is I don't know if the property in the regulator dt
node is called "vin-supply" or "vxyz-supply" and hence I
can parse the property based on a substring alone, which is
"-supply" because all I know is the property name is expected
to end with a "-supply".
I can always add a new of_find_property_substr() which finds
me property based on a substring value passed rather than the
exact property-name string.
However I don;t know if this is the best way to handle it.
Any thoughts?
WARNING: multiple messages have this Message-ID (diff)
From: rnayak@ti.com (Rajendra Nayak)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/9] regulator: helper routine to extract regulator_init_data
Date: Tue, 04 Oct 2011 10:58:40 +0530 [thread overview]
Message-ID: <4E8A9988.3080907@ti.com> (raw)
In-Reply-To: <20110930121844.GI5366@opensource.wolfsonmicro.com>
On Friday 30 September 2011 05:48 PM, Mark Brown wrote:
> On Fri, Sep 30, 2011 at 04:39:02PM +0530, Rajendra Nayak wrote:
>
>> The "regulator-supplies" is used to specific the regulator *parent*.
>> Same as what was earlier passed by using the
>> "supply_regulator" field of regulator_init_data structure.
>> Grant wanted the bindings to support specifying multiple parents
>> and hence I was thinking of either a list of names *or*
>> a list of phandles to specify multiple parents to a regulator.
>
> So, as I'm fairly sure I said last time these are just standard
> supplies. It just happens to be that the consumer is a regulator. The
> fact that Linux chooses to have core framework handling for this is an
> implementation detail of Linux (and indeed many devices ignore this for
> their on board regulators).
Yes, the implementation details of linux is what is making me using
these bindings difficult, and maybe you can help me how I can work
around the framework. The binding themselves, I agree should not care
if the consumer is a device/IP or a regulator itself.
So here's my problem:
I use the <name-supply> = <®_phandle> binding to define
a device/IP using one/more regulators on one/more rails.
device mmc {
...
...
vmmc-supply = <&vmmc>;
vpll-supply = <&vpll>;
};
The parsing of the "vmmc-supply" or the "vpll-supply" property
happens only when a mmc drivers makes a call to
regulator_get() passing the supply-name as "vmmc" or "vpll".
For ex:
regulator_get(dev, "vmmc"); or regulator_get(dev, "vpll");
Its easy to just append the "-supply" to a "vmmc" or "vpll"
and derive a property name like "vmm-supply" or "vpll-supply".
Now lets take the case of a regulator as a consumer:
regulator vmmc {
...
...
vin-supply = <&vin>;
};
Now I need to parse the "vin-supply" property during a
regulator_register(), so I could do a set_supply() and
create the parent/child relationship between a vin and
vmmc.
The problem is I don't know if the property in the regulator dt
node is called "vin-supply" or "vxyz-supply" and hence I
can parse the property based on a substring alone, which is
"-supply" because all I know is the property name is expected
to end with a "-supply".
I can always add a new of_find_property_substr() which finds
me property based on a substring value passed rather than the
exact property-name string.
However I don;t know if this is the best way to handle it.
Any thoughts?
next prev parent reply other threads:[~2011-10-04 5:28 UTC|newest]
Thread overview: 114+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-27 10:12 [PATCH 0/9] Device tree support for regulators Rajendra Nayak
2011-09-27 10:12 ` Rajendra Nayak
2011-09-27 10:12 ` [PATCH 1/9] regulator: twl: Remove hardcoded board constraints from driver Rajendra Nayak
2011-09-27 10:12 ` Rajendra Nayak
2011-09-27 11:37 ` Mark Brown
2011-09-27 11:37 ` Mark Brown
2011-09-27 14:47 ` Rajendra Nayak
2011-09-27 14:47 ` Rajendra Nayak
2011-09-27 10:12 ` [PATCH 2/9] regulator: helper routine to extract regulator_init_data Rajendra Nayak
2011-09-27 10:12 ` Rajendra Nayak
2011-09-27 12:10 ` Mark Brown
2011-09-27 12:10 ` Mark Brown
2011-09-27 14:48 ` Rajendra Nayak
2011-09-27 14:48 ` Rajendra Nayak
[not found] ` <4E81E224.2070408-l0cyMroinI0@public.gmane.org>
2011-09-27 15:05 ` Mark Brown
2011-09-27 15:05 ` Mark Brown
2011-09-28 8:06 ` Cousson, Benoit
2011-09-28 8:06 ` Cousson, Benoit
2011-09-30 4:27 ` Rajendra Nayak
2011-09-30 4:27 ` Rajendra Nayak
2011-09-30 7:58 ` Cousson, Benoit
2011-09-30 7:58 ` Cousson, Benoit
2011-09-30 10:49 ` Mark Brown
2011-09-30 10:49 ` Mark Brown
2011-09-30 10:28 ` Mark Brown
2011-09-30 10:28 ` Mark Brown
2011-09-30 10:48 ` Mark Brown
2011-09-30 10:48 ` Mark Brown
2011-09-30 11:09 ` Rajendra Nayak
2011-09-30 11:09 ` Rajendra Nayak
2011-09-30 11:35 ` Cousson, Benoit
2011-09-30 11:35 ` Cousson, Benoit
2011-09-30 12:18 ` Mark Brown
2011-09-30 12:18 ` Mark Brown
2011-10-04 5:28 ` Rajendra Nayak [this message]
2011-10-04 5:28 ` Rajendra Nayak
2011-10-04 10:18 ` Mark Brown
2011-10-04 10:18 ` Mark Brown
2011-10-04 11:40 ` Rajendra Nayak
2011-10-04 11:40 ` Rajendra Nayak
2011-10-04 11:51 ` Mark Brown
2011-10-04 11:51 ` Mark Brown
2011-10-04 12:02 ` Rajendra Nayak
2011-10-04 12:02 ` Rajendra Nayak
2011-10-04 12:11 ` Mark Brown
2011-10-04 12:11 ` Mark Brown
2011-10-04 12:40 ` Nayak, Rajendra
2011-10-04 12:40 ` Nayak, Rajendra
[not found] ` <20110927121003.GB4289-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-09-30 1:24 ` Grant Likely
2011-09-30 1:24 ` Grant Likely
2011-10-04 23:01 ` Russell King - ARM Linux
2011-10-04 23:01 ` Russell King - ARM Linux
2011-10-04 23:48 ` Grant Likely
2011-10-04 23:48 ` Grant Likely
2011-09-27 10:12 ` [PATCH 3/9] omap4: sdp: Pass regulator data from dt Rajendra Nayak
2011-09-27 10:12 ` Rajendra Nayak
2011-09-27 10:12 ` [PATCH 4/9] regulator: twl: Make twl-regulator driver extract data from DT Rajendra Nayak
2011-09-27 10:12 ` Rajendra Nayak
2011-09-27 12:14 ` Mark Brown
2011-09-27 12:14 ` Mark Brown
2011-09-27 14:48 ` Rajendra Nayak
2011-09-27 14:48 ` Rajendra Nayak
2011-09-27 10:12 ` [PATCH 5/9] regulator: helper routine to extract fixed_voltage_config Rajendra Nayak
2011-09-27 10:12 ` Rajendra Nayak
2011-09-27 12:16 ` Mark Brown
2011-09-27 12:16 ` Mark Brown
2011-09-27 14:49 ` Rajendra Nayak
2011-09-27 14:49 ` Rajendra Nayak
2011-09-27 16:13 ` Mark Brown
2011-09-27 16:13 ` Mark Brown
[not found] ` <1317118372-17052-6-git-send-email-rnayak-l0cyMroinI0@public.gmane.org>
2011-09-30 1:26 ` Grant Likely
2011-09-30 1:26 ` Grant Likely
2011-09-27 10:12 ` [PATCH 6/9] regulator: make fixed regulator driver extract data from dt Rajendra Nayak
2011-09-27 10:12 ` Rajendra Nayak
2011-09-30 1:34 ` Grant Likely
2011-09-30 1:34 ` Grant Likely
2011-09-27 10:12 ` [PATCH 7/9] omap4: panda: Pass regulator data from DT Rajendra Nayak
2011-09-27 10:12 ` Rajendra Nayak
2011-09-27 10:12 ` [PATCH 8/9] regulator: helper to extract regulator node based on supply name Rajendra Nayak
2011-09-27 10:12 ` Rajendra Nayak
2011-09-27 12:21 ` Mark Brown
2011-09-27 12:21 ` Mark Brown
2011-09-27 14:49 ` Rajendra Nayak
2011-09-27 14:49 ` Rajendra Nayak
2011-09-27 18:59 ` Mark Brown
2011-09-27 18:59 ` Mark Brown
2011-09-28 8:09 ` Cousson, Benoit
2011-09-28 8:09 ` Cousson, Benoit
2011-09-28 8:18 ` Rajendra Nayak
2011-09-28 8:18 ` Rajendra Nayak
2011-09-28 12:26 ` Mark Brown
2011-09-28 12:26 ` Mark Brown
2011-09-30 9:34 ` Rajendra Nayak
2011-09-30 9:34 ` Rajendra Nayak
2011-09-30 10:35 ` Mark Brown
2011-09-30 10:35 ` Mark Brown
2011-10-04 17:00 ` Grant Likely
2011-10-04 17:00 ` Grant Likely
2011-09-28 10:56 ` Rajendra Nayak
2011-09-28 10:56 ` Rajendra Nayak
2011-09-30 1:36 ` Grant Likely
2011-09-30 1:36 ` Grant Likely
2011-09-27 10:12 ` [PATCH 9/9] regulator: map consumer regulator based on device tree Rajendra Nayak
2011-09-27 10:12 ` Rajendra Nayak
2011-09-27 12:23 ` Mark Brown
2011-09-27 12:23 ` Mark Brown
2011-09-27 14:49 ` Rajendra Nayak
2011-09-27 14:49 ` Rajendra Nayak
[not found] ` <1317118372-17052-10-git-send-email-rnayak-l0cyMroinI0@public.gmane.org>
2011-09-30 1:38 ` Grant Likely
2011-09-30 1:38 ` Grant Likely
2011-09-30 9:29 ` Rajendra Nayak
2011-09-30 9:29 ` Rajendra Nayak
2011-09-30 1:39 ` [PATCH 0/9] Device tree support for regulators Grant Likely
2011-09-30 1:39 ` Grant Likely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E8A9988.3080907@ti.com \
--to=rnayak@ti.com \
--cc=b-cousson@ti.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=lrg@ti.com \
--cc=patches@linaro.org \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.