Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-10-04 Thread Mark Brown
On Tue, Oct 04, 2011 at 10:58:40AM +0530, Rajendra Nayak wrote: 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

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-10-04 Thread Rajendra Nayak
On Tuesday 04 October 2011 03:48 PM, Mark Brown wrote: On Tue, Oct 04, 2011 at 10:58:40AM +0530, Rajendra Nayak wrote: 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

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-10-04 Thread Mark Brown
On Tue, Oct 04, 2011 at 05:10:00PM +0530, Rajendra Nayak wrote: On Tuesday 04 October 2011 03:48 PM, Mark Brown wrote: This seems fairly straightforward though it will require some changes within Linux, all we have to do is have the regulators name their supplies. through dt? thats what the

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-10-04 Thread Rajendra Nayak
On Tuesday 04 October 2011 05:21 PM, Mark Brown wrote: On Tue, Oct 04, 2011 at 05:10:00PM +0530, Rajendra Nayak wrote: On Tuesday 04 October 2011 03:48 PM, Mark Brown wrote: This seems fairly straightforward though it will require some changes within Linux, all we have to do is have the

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-10-04 Thread Mark Brown
On Tue, Oct 04, 2011 at 05:32:47PM +0530, Rajendra Nayak wrote: On Tuesday 04 October 2011 05:21 PM, Mark Brown wrote: I wouldn't expect it done through DT (except for things like the fixed voltage regulator) - the driver should just know. something like a int regulator_set_supply(struct

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-10-04 Thread Nayak, Rajendra
On Tue, Oct 4, 2011 at 5:41 PM, Mark Brown broo...@opensource.wolfsonmicro.com wrote: On Tue, Oct 04, 2011 at 05:32:47PM +0530, Rajendra Nayak wrote: On Tuesday 04 October 2011 05:21 PM, Mark Brown wrote: I wouldn't expect it done through DT (except for things like the fixed voltage

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-10-04 Thread Russell King - ARM Linux
On Tue, Sep 27, 2011 at 01:10:04PM +0100, Mark Brown wrote: On Tue, Sep 27, 2011 at 03:42:45PM +0530, Rajendra Nayak wrote: + init_data = devm_kzalloc(dev, sizeof(struct regulator_init_data), +GFP_KERNEL); + if (!init_data) +

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-10-04 Thread Grant Likely
On Wed, Oct 05, 2011 at 12:01:27AM +0100, Russell King - ARM Linux wrote: On Tue, Sep 27, 2011 at 01:10:04PM +0100, Mark Brown wrote: On Tue, Sep 27, 2011 at 03:42:45PM +0530, Rajendra Nayak wrote: + init_data = devm_kzalloc(dev, sizeof(struct regulator_init_data), +

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-10-03 Thread Rajendra Nayak
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

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-09-30 Thread Cousson, Benoit
On 9/30/2011 6:27 AM, Nayak, Rajendra wrote: [...] They need both. We need to reference the device that provides the supply and use a name to say which of the potentially multiple supplies on the consumer device is which. Mark, I still seem to be a little confused with this one as to why we

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-09-30 Thread Mark Brown
On Fri, Sep 30, 2011 at 09:57:30AM +0530, Rajendra Nayak wrote: Mark, I still seem to be a little confused with this one as to why we would need a phandle *and* a supply-name to reference a parent regulator/supply. The phandle would point to a regulator dt node and that node internally would

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-09-30 Thread Mark Brown
On Fri, Sep 30, 2011 at 11:28:49AM +0100, Mark Brown wrote: On Fri, Sep 30, 2011 at 09:57:30AM +0530, Rajendra Nayak wrote: + init_data-supply_regulator = (char *)of_get_property(dev-of_node, + regulator-supplies, NULL); Mark, I still seem to be a

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-09-30 Thread Mark Brown
On Fri, Sep 30, 2011 at 09:58:04AM +0200, Cousson, Benoit wrote: I think as well that we should avoid considering a regulator with several outputs. I saw the same pattern used for the clock binding in DT as well. This binding is for the consumer side, not the producer side. A binding which

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-09-30 Thread Rajendra Nayak
On Friday 30 September 2011 04:18 PM, Mark Brown wrote: On Fri, Sep 30, 2011 at 11:28:49AM +0100, Mark Brown wrote: On Fri, Sep 30, 2011 at 09:57:30AM +0530, Rajendra Nayak wrote: + init_data-supply_regulator = (char *)of_get_property(dev-of_node, +

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-09-30 Thread Cousson, Benoit
On 9/30/2011 1:09 PM, Nayak, Rajendra wrote: On Friday 30 September 2011 04:18 PM, Mark Brown wrote: On Fri, Sep 30, 2011 at 11:28:49AM +0100, Mark Brown wrote: On Fri, Sep 30, 2011 at 09:57:30AM +0530, Rajendra Nayak wrote: + init_data-supply_regulator = (char

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-09-30 Thread Mark Brown
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

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-09-29 Thread Rajendra Nayak
[]... + init_data-supply_regulator = (char *)of_get_property(dev-of_node, + regulator-supplies, NULL); I'd expect that in the device tree world the supply regulator would reference the node for that regulator. You mean using phandles?

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-09-29 Thread Grant Likely
On Tue, Sep 27, 2011 at 01:10:04PM +0100, Mark Brown wrote: On Tue, Sep 27, 2011 at 03:42:45PM +0530, Rajendra Nayak wrote: + init_data = devm_kzalloc(dev, sizeof(struct regulator_init_data), +GFP_KERNEL); + if (!init_data) +

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-09-28 Thread Cousson, Benoit
On 9/27/2011 5:05 PM, Mark Brown wrote: On Tue, Sep 27, 2011 at 08:18:04PM +0530, Rajendra Nayak wrote: On Tuesday 27 September 2011 05:40 PM, Mark Brown wrote: On Tue, Sep 27, 2011 at 03:42:45PM +0530, Rajendra Nayak wrote: + init_data = devm_kzalloc(dev, sizeof(struct

[PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-09-27 Thread Rajendra Nayak
The helper routine is meant to be used by regulator drivers to extract the regulator_init_data structure from the data that is passed from device tree. 'consumer_supplies' which is part of regulator_init_data is not extracted as the regulator consumer mappings are passed through DT differently,

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-09-27 Thread Mark Brown
On Tue, Sep 27, 2011 at 03:42:45PM +0530, Rajendra Nayak wrote: + init_data = devm_kzalloc(dev, sizeof(struct regulator_init_data), + GFP_KERNEL); + if (!init_data) + return NULL; /* Out of memory? */ This means that the init

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-09-27 Thread Rajendra Nayak
On Tuesday 27 September 2011 05:40 PM, Mark Brown wrote: On Tue, Sep 27, 2011 at 03:42:45PM +0530, Rajendra Nayak wrote: + init_data = devm_kzalloc(dev, sizeof(struct regulator_init_data), +GFP_KERNEL); + if (!init_data) +

Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data

2011-09-27 Thread Mark Brown
On Tue, Sep 27, 2011 at 08:18:04PM +0530, Rajendra Nayak wrote: On Tuesday 27 September 2011 05:40 PM, Mark Brown wrote: On Tue, Sep 27, 2011 at 03:42:45PM +0530, Rajendra Nayak wrote: + init_data = devm_kzalloc(dev, sizeof(struct regulator_init_data), +