PM / Domains: System-wide transitions support for generic domains (v5)
authorRafael J. Wysocki <rjw@sisk.pl>
Fri, 1 Jul 2011 20:13:19 +0000 (22:13 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Sat, 2 Jul 2011 12:29:56 +0000 (14:29 +0200)
commit596ba34bcd2978ee9823cc1d84df230576f8ffb9
treeef118fc94c08730c7e82a58c2e7f70cb781d17c2
parent5248051b9afb6684cd817b2fbdaefa5063761dab
PM / Domains: System-wide transitions support for generic domains (v5)

Make generic PM domains support system-wide power transitions
(system suspend and hibernation).  Add suspend, resume, freeze, thaw,
poweroff and restore callbacks to be associated with struct
generic_pm_domain objects and make pm_genpd_init() use them as
appropriate.

The new callbacks do nothing for devices belonging to power domains
that were powered down at run time (before the transition).  For the
other devices the action carried out depends on the type of the
transition.  During system suspend the power domain .suspend()
callback executes pm_generic_suspend() for the device, while the
PM domain .suspend_noirq() callback runs pm_generic_suspend_noirq()
for it, stops it and eventually removes power from the PM domain it
belongs to (after all devices in the domain have been stopped and its
subdomains have been powered off).

During system resume the PM domain .resume_noirq() callback
restores power to the PM domain (when executed for it first time),
starts the device and executes pm_generic_resume_noirq() for it,
while the .resume() callback executes pm_generic_resume() for the
device.  Finally, the .complete() callback executes pm_runtime_idle()
for the device which should put it back into the suspended state if
its runtime PM usage count is equal to zero at that time.

The actions carried out during hibernation and resume from it are
analogous to the ones described above.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: Kevin Hilman <khilman@ti.com>
drivers/base/power/domain.c
include/linux/pm_domain.h