Re: [PATCH 1/2] regulators: Add definition of regulator_set_voltage_time() for !CONFIG_REGULATOR

Viresh Kumar
2014-06-02T13:14:39Z

On 2 June 2014 17:53, Mark Brown <broonie@kernel.org> wrote:
> If the consumer tried to set a voltage presumably it cares if that
> voltage was set - for example if your cpufreq driver tries to increase
> the voltage of a core supply so that it can then raise the frequency the
> user is going to be upset if the voltage was not actually raised and it
> goes off and raises the clock rate causing the system to become unstable.

If the driver continued despite getting regulator as NULL, it means that
regulator isn't a MUST for it. For example a CPUFreq driver may work
with or without a regulator.

Now if the dummy calls return *error* for some cases then these driver
will have to do
if(xyz)
API-call()..

And so dummy APIs like clk_set_rate(), clk_get_rate(),
regulator_set_voltage() must return zero..

To get rid of this in drivers these dummy routines *must* behave as
they passed, if the drivers really care about them then they must
quit as soon as regulator_get() returned NULL.

This is why we have such implementations in clk framework which are
very well thought earlier.

Does this make sense?