Regulators in suspend

Balaji Rao balajirrao at
Mon Dec 1 12:49:09 CET 2008

On Mon, Dec 01, 2008 at 11:35:53AM +0000, Andy Green wrote:
> Hash: SHA1
> Hi -
> I noticed something about the regulator stuff last night when dealing
> with suspend on the pm_bt driver.
> We have this kind of construct
> 		if (on) {
> 			if (!regulator_is_enabled(bt_data->regulator))
> 				regulator_enable(bt_data->regulator);
> 		} else {
> 			if (regulator_is_enabled(bt_data->regulator))
> 				regulator_disable(bt_data->regulator);
> 		}
> because the regulator stuff only wants to hear disable on enabled
> regulator and vice versa.


> However, regulator_is_enabled() is giving a result for the actual state
> of the regulator, via a (ops->blah)() thing, but the _enable() and
> _disable() guys are looking first at the logical state they hold about
> if they enabled or disabled the regulator.


> On probe and resume at the moment these two things are out of step, the
> regulator defaults to up on Qi it seems and they are wrong on resume too
> at the moment, blowing WARN_ON() stacktraces.

Oh, yes. We have to mark the regulators which are boot_on in the
regulator_init data in mach_gta02.c. I wanted to do it, but I forgot. I think
this should solve the problem ? But I wonder what happens during resume..
I'll see..

Andy, can you please try this out ? If it works, I'll send you a patch.


More information about the openmoko-kernel mailing list