OSDN Git Service

PM / Runtime: Add second macro for definition of runtime PM callbacks
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 10 Dec 2013 13:37:40 +0000 (14:37 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 22 Dec 2013 00:39:52 +0000 (01:39 +0100)
commitd9fb563d3cdfd774ee0a7c03e98bb305cdd613eb
tree2be6f4ca1052f3ad13817d5574044d236cfd4ccc
parent319e2e3f63c348a9b66db4667efa73178e18b17d
PM / Runtime: Add second macro for definition of runtime PM callbacks

By having the runtime PM callbacks implemented for CONFIG_PM, these
becomes available in all combinations of CONFIG_PM_SLEEP and
CONFIG_PM_RUNTIME.

The benefit using this, is that we don't need to implement the wrapper
functions which handles runtime PM resourses, typically called from
both runtime PM and system PM callbacks. Instead the runtime PM
callbacks can be invoked directly from system PM callbacks, which is
useful for some drivers, subsystems and power domains.

Use the new macro SET_PM_RUNTIME_PM_OPS in cases were the above makes
sense. Make sure the callbacks are encapsulated within CONFIG_PM
instead of CONFIG_PM_RUNTIME.

Do note that the old macro SET_RUNTIME_PM_OPS, which is being quite
widely used right now, requires the callbacks to be defined for
CONFIG_PM_RUNTIME. In many cases it will certainly be convenient to
convert to the new macro above, but that will have to be distinguished
in case by case.

Cc: Kevin Hilman <khilman@linaro.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
include/linux/pm.h