Re: [PATCH] regulator: rk808: Add support setting suspend voltage

From: Mark Brown
Date: Wed Oct 08 2014 - 14:20:47 EST

On Wed, Oct 08, 2014 at 09:12:59AM -0700, Doug Anderson wrote:
> On Wed, Oct 8, 2014 at 5:49 AM, Mark Brown <broonie@xxxxxxxxxx> wrote:

> > No, this is not the case. The suspend mode settings are a completely
> > different set of settings activated when the system goes into suspend
> > with explicit hardware support. If no configuration for this mode is
> > provided then

> I think maybe you missed finishing your sentence?

nothing will be changed.

> >> I believe that won't be the case for your driver. The rk808 will (I
> >> think) automatically transition to the "suspend voltage" settings for
> >> ALL regulators at suspend time. If you didn't explicitly set the
> >> suspend voltage then you'll move to whatever the default voltage is,
> >> right?

> > As ever the hardware configuration won't be touched by the kernel unless
> > it's explicitly told to do something.

> I guess my point is that the kernel's inaction is actually causing
> something unexpected to happen. Robots can't let humans come to harm
> by inaction any more than they can harm them by action.

> Specifically I would expect that voltages would stay constant when the
> rk808 "sleep" pin is asserted if I didn't explicitly say to disable
> this regulator at sleep time and I didn't explicitly specify a voltage
> at sleep time. As Chris's patch stands right now this isn't the case.

The assumption has to be that the configuration that the device has is
essential to bringing the system into and out of suspend, if we went and
overrode everything with the current runtime configuration I'd expect
we'd break a whole bunch of systems and severely impact the power
consumption in suspend of more. What you're asking for is just not how
these systems are designed, complain to your electrical engineers. With
this model for doing things suspend entry and exit is defined and
sequenced at system design time (often with limited configuration so
really at tapeout time).

> When the kernel driver sets it to 1.9V, it will go through
> regulator_set_voltage_sel_regmap() which will set the BUCK4_ON_VSEL
> register and we'll be at 1.9V. Great, we're at 1.9V. Now we're ready
> to go to sleep. I'd expect that the voltage would stay at 1.9V, but
> it won't. BUCK4_SLP_VSEL was never programmed so it's at whatever the
> default is (1.8V) and we will transition there.

No, if the driver needs a particular state during suspend it needs to
explicitly set the suspend mode, that's what those APIs are there for.
Remember that a suspended device is supposed to not be doing anything
anyway most of the time...

Attachment: signature.asc
Description: Digital signature