[PATCH] Ensure pcf50606_global is set

Harald Welte laforge at openmoko.org
Sat Jun 2 18:21:07 CEST 2007

On Sat, Jun 02, 2007 at 12:22:57AM +0200, andrzej zaborowski wrote:
> With a non-modular kernel, the s3c_udc is initalised before PCF50606.
> If the UDC is drawing power from the host, gta01_udc_vbus_draw() is
> called back and it will try to tell the PCF50606 (which is
> uninitialised) to enable fast-charge.
> The patch also eliminates the race between code that wants to use
> pcf50606_global before setting up I2C, by reordering the actions in
> pcf50606_detect(). The race is not only potential because I've hit it.
> The pcf50606_global usage is generally ugly :)

tell me ;)

But it was the 'best' solution I could come up with for now.  It's hard
to think of devices that have multiple of the same PMU's, but inevitably
they will sooner or later exist, though.

Also, without a proper abstraction level and infrastructure (i.e. power
resources associated with each device, and power provides (pmu's) I
doubt it makes sense to clean this up any further.

But if you have ideas, please let me know.

> BTW I also had to disable PCF50606_FEAT_WDT in platform_data to make
> pcf50606 work, not sure why.

that's strange.  This is on a GTA01?

- Harald Welte <laforge at openmoko.org>          	        http://openmoko.org/
Software for the world's first truly open Free Software mobile phone

More information about the openmoko-kernel mailing list