>>-----Original Message-----
>>From: Kevin Hilman [mailto:[email protected]]
>>Sent: Thursday, September 16, 2010 8:52 PM
>>To: Gopinath, Thara
>>Cc: [email protected]; [email protected]; Sripathy, Vishwanath; Sawant, 
>>Anand; Cousson, Benoit
>>Subject: Re: [PATCH 04/13] OMAP: Introduce API to return a device list 
>>associated with a voltage
>>domain
>>
>>"Gopinath, Thara" <[email protected]> writes:
>>
>>[...]
>>
>>>>>> +struct device **opp_init_voltage_params(struct voltagedomain *voltdm,
>>>>>> +                                        int *dev_count)
>>>>>> +{
>>>>>> +        struct device_opp *dev_opp;
>>>>>> +        struct device **dev_list;
>>>>>> +        int count = 0, i = 0;
>>>>>> +
>>>>>> +        list_for_each_entry(dev_opp, &dev_opp_list, node) {
>>>>>> +                if (!dev_opp->oh->vdd_name)
>>>>>> +                        continue;
>>>>>> +
>>>>>> +                if (!strcmp(dev_opp->oh->vdd_name, voltdm->name)) {
>>>>>> +                        dev_opp->oh->voltdm = voltdm;
>>>>>
>>>>>Couldn't we assign the voltdm at opp_add() time since you added it as
>>>>>part of the hwmod?
>>>
>>> We cannot as the voltage layer is not initialized at the point of opp_add.
>>> Having said this, today voltage layer is dependent on opp layer only to 
>>> figure out
>>> the current nominal voltage from the opp table. If that can be some how 
>>> decoupled we
>>> can initialize voltage layer early on and implement this.
>>
>>We could decouple the voltage init into and early init and late init to
>>handle this.

Hello Kevin,

Yes we could. In fact I do not like the idea of voltage layer dependent
on opp layer itself. So here is my proposal. Maintain a variable in the main
per vdd structure omap_vdd_info curr_volt which will get updated each time a
voltage scale is attempted. Now the only issue is during boot up how does the 
voltage
layer know what voltage each vdd should be put into ? A piece of code can be
implemented in pm34xx.c/pm44xx.c init functions to read the clock rate 
associated
with each vdd , call into the opp layer to get the corresponding
voltage ( basically the sequence we do today everytime in voltage layer
when the API to get  nominal voltage is called) and call omap_voltage_scale_vdd 
with
the corresponding voltage. This way we can fully decouple voltage laye from opp 
layer
and make voltage init an early_initcall. We might still need a late_initcall to 
register
debugfs entries though.
What is your take on this ?

Regards
Thara

>>
>>Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to