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

From: Javier Martinez Canillas
Date: Wed Oct 08 2014 - 04:46:43 EST


Hello Doug,

On 10/07/2014 07:48 PM, Doug Anderson wrote:
>
> I don't have all the right patches to test this right now. Hopefully
> you can point me at what we're using right now. I'd expect that this
> will need the patches that Chanwoo and Javier are working on, so I've
> added them to this.
>

Yes, you will need Chanwoo's series in order to use this. If also the
driver needs to set a default initial regulator operating mode, it will
need the series I'll post today but in that case also a .set_mode handler
is needed.

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

On system suspend, the regulator core only calls the .set_suspend_voltage
handler if struct regulator_state *rstate->uV > 0 for the given suspend
state (mem,disk,standby) and only calls .set_suspend_{enable,disable} if
struct regulator_state *rstate->{enabled,disable} are set for that state.

Chanwoo's series have different DT properties that are used to set the
suspend state uV (regulator-volt) and disabled (regulator-off-in-suspend):

ldoX_reg: LDOx {
...
regulator-state-mem {
regulator-volt = <1200000>;
regulator-off-in-suspend;
};
...
};

So answering your question, the transition to the "suspend voltage" setting
will only happen if uV is set (regulator-volt), otherwise it will be left
alone at suspend time just like is left alone on disable.

However, Chanwoo said that he will drop the regulator-volt DT property from
v5 [0]. It seems that is a useful use case for others to set the regulator
voltage on suspend, so maybe Chanwoo can address the issues pointed out by
Mark about renaming it to regulator-uV [1] and revise the check for the
voltage range [2] but kept the DT property on v5?

> -Doug
>

Thanks a lot and best regards,
Javier

[0]: https://lkml.org/lkml/2014/9/28/202
[1]: https://lkml.org/lkml/2014/9/4/652
[2]: https://lkml.org/lkml/2014/9/4/651
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/