Regulators in suspend

Mark Brown broonie at opensource.wolfsonmicro.com
Mon Dec 1 16:49:49 CET 2008


On Mon, Dec 01, 2008 at 08:51:25PM +0530, Balaji Rao wrote:

> And, I don't understand why enabling an already enabled regulator should
> result in a warning.. May be I don't know of real life examples where
> such a thing would be cause side effects. I was thinking along the lines
> of kfree, which doesn't shout if a NULL pointer is passed to it..

The client enable and disable operations don't operate on the physical
regulator, they operate on reference counts that feed into the actual
decision for the hardware (via machine constraints).  Given that model
but a lack of actual per-client reference counting in the core it was
safest to warn on any attempt to use multiple enables.  2.6.29 will let
you do multiple enables but will reference count so that you need an
equal number of disables to actually disable the client.

This means that you will still need to maintain the per-consumer state
that you're not currently maintaining - before 2.6.29 you'll get a
warning when attempting to do multiple enables, after then you'll find
that multiple enables need to be balanced by the same number of disables
which doesn't look to be the intended effect of your code.



More information about the openmoko-kernel mailing list