On Wed, Mar 2, 2016 at 9:30 AM, Mark Brown broonie@kernel.org wrote:
On Wed, Mar 02, 2016 at 09:26:03AM -0600, Nishanth Menon wrote:
We do have a real need to control multiple regulators around an OPP change. this logic is valid for more than CPU device -> it is valid for devices like DSP, GPU etc in the SoC as well across multiple families in the OMAP generation SoCs. The logic by itself it not too complicated. a voltage plane for a device has two regulators that need to be controlled in tandem for a given target frequency. by allowing dev_pm_opp_set_rate to control "n" regulators it actually does simplify the problem down for a generic solution -> DVFS for devices triggered from cpufreq or via devfreq.
That's n regulators that need to be changed in arbitrary orders (together with some other number of clocks).
I agree, the "n" regulators that control supplies to a device cannot obviously be transitioned in random order and ofcourse we want to describe what supplies are present in the hardware in dts, not how the supplies need to be transitioned. There will be a sequencing required based on platfiorm for these n regulators (and or optimization of voltages) - similar to requirement for voltage Vs frequency scale needs.
One alternative I can think of is to reintroduce voltage domain driver back in (we will get rid of the clock notifier tieups etc).. this voltage domain mechanism will handle all the required sequencing based on platform and any optimizations or quirks needed, then, _set_opp_voltage would see if a voltagedomain is present, if yes, it will invoke that instead of a single regulator. obviously two things take place with this approach: a) dev_pm_opp_set_rate still remain the single entry point for all OPP transition (I think this is a good idea) b) a level of abstraction introduced by complex drivers via the voltage domain framework ( the original proposed framework had ability already to handle 1-n regulators based on platform voltage domain drivers).
What other alternatives can folks suggest we go towards?
--- Regards, Nishanth Menon