[RFC] lp_events: an lternitive to suspend blocker user mode andkernel API

From: mark gross
Date: Sun May 30 2010 - 16:04:01 EST


Low Power Events is a possible alternative to suspend blocker / wake
lock API used by Android.

It provides comparable power state notification and kernel mode critical
section definition. It differs from suspend blocker in that:
1) it is a platform and device independent implementation. Device
specific code is register as lp_ops, similar to pm_ops. Drivers use
the platform independent functions.

2) it forces a user mode transition coming out of a LP state.
Notification of wake up sources go to the user mode process managing the
lp states. Notification of blocked LP state entry is through an
error return, and notification of un-blocking is through a file node as
well.

I think the change need to the Google Android user mode power handling
code can be limited to changes to _only_
"hardware/libhardware_legacy/power/power.c"

This code is still just a prototype of the platform independent code,
and I'm implementing it on Eclair for the Intel Moorestown platform this
weekend. I'll have patches to eclair and updated kernel patches that
enable this sometime Monday, after I bring it up on my target device.
Hopefully by the end of next week I think I'll have it working well with
Android.

At this time the following patch is only known to compile. I send it to
help with the discussion.

FWTW I do work on Android at Intel and I think I can make this work.
(well, today I do.)

--mgross

Draft kernel patch :

--Signed-off-by: Mark Gross <markgross@xxxxxxxxxxx>