[PATCH] Ensure pcf50606_global is set

andrzej zaborowski balrogg at gmail.com
Sat Jun 2 19:34:48 CEST 2007

On 02/06/07, Harald Welte <laforge at openmoko.org> wrote:
> 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.

Other than more communication through platform_data (which can also
get ugly sometimes), not really.

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

Yes, Bv4. Just checked the reason now and it turns out this was simply
a conflict with drivers/char/watchdog/s3c2410_wdt.c (Same miscdevice
major/minor). I guess the correct way to approach it is moving the
code that registers the pcf50606 watchdog to drivers/char/watchdog/
and then: either making only one watchdog selectable in Kconfig or
allocating more minor numbers - but that's not a task for openmoko


More information about the openmoko-kernel mailing list