]> git.karo-electronics.de Git - karo-tx-linux.git/commit
PM / Domains: Introduce "save/restore state" device callbacks
authorRafael J. Wysocki <rjw@sisk.pl>
Sun, 27 Nov 2011 12:11:44 +0000 (13:11 +0100)
committerRafael J. Wysocki <rjw@sisk.pl>
Thu, 1 Dec 2011 20:47:18 +0000 (21:47 +0100)
commitecf00475f229fcf06362412ad2d15a3267e354a1
tree282792856ca84debf81e6c29141a6bebe7fdb966
parentd5e4cbfe2049fca375cb19c4bc0cf676e8b4a88a
PM / Domains: Introduce "save/restore state" device callbacks

The current PM domains code uses device drivers' .runtime_suspend()
and .runtime_resume() callbacks as the "save device state" and
"restore device state" operations, which may not be appropriate in
general, because it forces drivers to assume that they always will
be used with generic PM domains.  However, in theory, the same
hardware may be used in devices that don't belong to any PM
domain, in which case it would be necessary to add "fake" PM
domains to satisfy the above assumption.  It also may be located in
a PM domain that's not handled with the help of the generic code.

To allow device drivers that may be used along with the generic PM
domains code of more flexibility, introduce new device callbacks,
.save_state() and .restore_state(), that can be supplied by the
drivers in addition to their "standard" runtime PM callbacks.  This
will allow the drivers to be designed to work with generic PM domains
as well as without them.

For backwards compatibility, introduce default .save_state() and
.restore_state() callback routines for PM domains that will execute
a device driver's .runtime_suspend() and .runtime_resume() callbacks,
respectively, for the given device if the driver doesn't provide its
own implementations of .save_state() and .restore_state().

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