[UPSTREAM 0/2] pcf50633 changes
balajirrao at openmoko.org
Sun Nov 16 20:33:53 CET 2008
Here's a pcf50633 driver rewrite to use the MFD model. This has resulted
in pretty large number of changes.
[ Warning : This is long :) ]
1. Removed usb_curlim worker. One of the reasons for having a worker for
that was that we could be called at unexpected times. Properly ordered
suspend/resume using parent-child relationships now exists in mach-gta02.c
and we won't see this problem again.
The second reason is that we can't use i2c functions as vbus_draw is
called from an interrupt context. This has been solved by _not_ calling
set_usbcurlim from vbus_draw. It instead sets a variable which is later
2. Charger detection code now moved into mach-gta02.c. This code can be
racy and confusing. An attepmpt is made to simplify it - We wait for
sometime(presently 3s) to get a vbus_draw grant from the host. If we
don't get it by then, we sense the charger using ADC and configure the
This also solves the problem where the charger was not identified as an
adapter by the ADC. I've seen this when I insert the adapter slowly.
3. NOBAT handling has been removed altogether. the chip does not expect
the battery to be removed and it is best handled in userspace where we
can communicate with the battery driver to find out more about it.
3. pcf50633_suspend_state has been eliminated. To make sure we don't get
interrupted when we are suspending, (this does not happen during resume
as the IRQ would be disabled when we suspend) there's a call to
cancel_work_sync after disable(irq) to make sure we are not in trouble.
4. Emergency 8s shutdown has been temporarily removed from the driver
as it certainly does not belong there.
5. 'Suppress onkey events on resume' - must be a better way to handle
this. Can't it be done from userspace ?
6. Resume reason - Removed currenty. More discussion required on format
of sysfs attribute.
Patches follow. Please review.
1/2 - the rewritten driver.
2/2 - changes in existing code required to use the new stuff.
More information about the openmoko-kernel