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

Doug Anderson dianders at chromium.org
Wed Oct 8 09:12:59 PDT 2014


Mark,

On Wed, Oct 8, 2014 at 5:49 AM, Mark Brown <broonie at kernel.org> wrote:
>> One point of curiosity (maybe this is a question for Chanwoo and
>> Javier): I'd expect that if someone didn't explicitly setup a "suspend
>> voltage" that their voltage would just be left alone at suspend time.
>
> 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?


>> 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.

To make it concrete, imagine that no "sleep voltage" was specified for
DCDC4 and it's setup to stay enabled during sleep.  Let's say that a
kernel driver makes a decision at runtime time to set this to 1.8V or
1.9V.

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.

The above is a fictitious example since really we don't vary BUCK4 at
runtime in our system.  ...and really my concern only matters for
regulators that vary at runtime, so maybe we can ignore my comments.
To me, it does seem unexpected, though.

-Doug



More information about the Linux-rockchip mailing list