[UPSTREAM] Use new regulator API for pcf50633

Mark Brown broonie at opensource.wolfsonmicro.com
Tue Oct 28 14:24:40 CET 2008

On Tue, Oct 28, 2008 at 06:30:22PM +0530, Balaji Rao wrote:

> The changed regulator API requires that we create a platform device for
> every regulator. This causes some races with devices initialization. The
> attach_child_devices callback can be called only after all regulators
> have been registred with the core.

The way this is dealth with in the Wolfson PMICs is to have a callback
in the platform data for the PMIC which is invoked at an appropriate
point in device setup.  The Wolfson devices need to offer an opportunity
for the platform to do things like configure multi-function pins on the
device so this is needed anyway.

> I've not touched the suspend/resume part. Suspending regulators is
> done through the regulator_prepare_suspend function, which can be called
> from pcf50633_suspend ? But how do we get the regulators back to active
> state on resume ? 

At the minute drivers handle this through a combination of the client
drivers disabling and enabling their regulators as they suspend and
resume and the hardware having explicit support for using a different
configuration while suspended (the regulator API has support for
configuring that through the machine suspend mode settings).

What exactly needs doing to restore the hardware state here?

That said, I can't see any reason why there shouldn't be a matching call
for use in early resume. 

I'd expect these to be called from the platform code rather than the
pcf50633 driver - it'll affect all regulators in the system, not just
those in the pcf50633.  If it's the pcf50633 it should just be able to
talk to its own regulator drivers directly.

More information about the openmoko-kernel mailing list