Re: [PATCH 06/10] PM: Add early suspend api.

Matthew Garrett
2009-02-12T11:34:56Z

On Tue, Feb 10, 2009 at 05:49:11PM -0800, Arve Hjønnevåg wrote:

> +EARLY_SUSPEND_LEVEL_BLANK_SCREEN:
> + On suspend the screen should be turned off but the framebuffer must still be
> + accessible. On resume the screen can be turned back on.
> +
> +EARLY_SUSPEND_LEVEL_STOP_DRAWING:
> + On suspend this level notifies user-space that it should stop accessing the
> + framebuffer and it waits for it to complete. On resume it notifies user-space
> + that it should resume screen access.
> + Two methods are provided, console switch or a sysfs interface.
> +
> +EARLY_SUSPEND_LEVEL_DISABLE_FB:
> + Turn off the framebuffer on suspend and back on on resume.
> +

This set seems like a pretty poor example. There's already a userspace
interface for controlling the LCD via sysfs, and extending this to power
down the associated framebuffer hardware would be trivial.

> +EARLY_SUSPEND_LEVEL_STOP_INPUT:
> + On suspend turn off input devices that are not capable of wakeup or where
> + wakeup is disabled. On resume turn the same devices back on.

Why not just ask your userspace input consumer to release the device and
then have the driver automatically power itself down when its use count
hits zero?

--
Matthew Garrett | mjg59@srcf.ucam.org