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

Mark Brown
2014-06-02T12:24:03Z

[-- Attachment #1: Type: text/plain, Size: 967 bytes --]

On Mon, Jun 02, 2014 at 03:45:37PM +0530, Viresh Kumar wrote:
> On 2 June 2014 15:32, Mark Brown <broonie@kernel.org> wrote:
> > No, think about what you're changing here. You're changing the stub -
> > the stub has a regulator_get() which always succeeeds.

> Now, why do we want to return -EINVAL from set_voltage here ? Similar
> routines in clk-API are returning 0 and even clk_get_rate() returns zero,
> unlike in regulators, as we return -EINVAL..

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.

> Not sure which of these frameworks is doing the right thing.

I don't think the clock API should have clk_set_rate() report success if
it was ignored.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]