]> git.baikalelectronics.ru Git - kernel.git/commit
PM / Domains: Make it possible to add devices to inactive domains
authorRafael J. Wysocki <rjw@sisk.pl>
Mon, 14 May 2012 19:45:52 +0000 (21:45 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Fri, 18 May 2012 18:45:26 +0000 (20:45 +0200)
commit5ad6a2440535dfeb3cbd9d10e2806cd22e0fb41c
tree77a5d45a878b85ed3dad23f304b4e10fbfa66129
parentbc3eb0da57a1a54ad7b4c0dbb0794558a48f1666
PM / Domains: Make it possible to add devices to inactive domains

The generic PM domains core code currently requires domains to be in
the "power on" state for adding devices to them, but this limitation
turns out to be inconvenient in some situations, so remove it.

For this purpose, make __pm_genpd_add_device() set the device's
need_restore flag if the domain is in the "power off" state, so that
the device's "restore state" (usually .runtime_resume()) callback
is executed when it is resumed after the domain has been turned on.
If the domain is in the "power on" state, the device's need_restore
flag will be cleared by __pm_genpd_add_device(), so that its "save
state" (usually .runtime_suspend()) callback is executed when the
domain is about to be turned off.  However, since that default
behavior need not be always desirable, add a helper function
pm_genpd_dev_need_restore() allowing a device's need_restore flag
to be set/unset at any time.

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