diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2013-12-10 08:37:41 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-12-21 19:39:58 -0500 |
commit | 717e5d458e3bfca495a38dca61c64f274c049e46 (patch) | |
tree | aae88934c12c3222e4e44d1b3081626bf6199826 /include/linux/pm_runtime.h | |
parent | d9fb563d3cdfd774ee0a7c03e98bb305cdd613eb (diff) |
PM / Runtime: Implement the pm_generic_runtime functions for CONFIG_PM
The pm_generic_runtime_suspend|resume functions were implemented within
CONFIG_PM_RUNTIME.
As we also may use runtime PM callbacks during system suspend, to put
devices into low power state, we need to move the implementation of
pm_generic_runtime_suspend|resume to CONFIG_PM.
This change gives a power domain provision to invoke a platform
driver's runtime PM callback from a power domain's system PM callback.
This were earlier prevented by the platform bus, since it uses the
pm_generic_runtime_suspend|resume functions as runtime PM callbacks.
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>
Diffstat (limited to 'include/linux/pm_runtime.h')
-rw-r--r-- | include/linux/pm_runtime.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 6fa7cea25da9..16c9a62fa1c0 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
@@ -23,6 +23,14 @@ | |||
23 | usage_count */ | 23 | usage_count */ |
24 | #define RPM_AUTO 0x08 /* Use autosuspend_delay */ | 24 | #define RPM_AUTO 0x08 /* Use autosuspend_delay */ |
25 | 25 | ||
26 | #ifdef CONFIG_PM | ||
27 | extern int pm_generic_runtime_suspend(struct device *dev); | ||
28 | extern int pm_generic_runtime_resume(struct device *dev); | ||
29 | #else | ||
30 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | ||
31 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | ||
32 | #endif | ||
33 | |||
26 | #ifdef CONFIG_PM_RUNTIME | 34 | #ifdef CONFIG_PM_RUNTIME |
27 | 35 | ||
28 | extern struct workqueue_struct *pm_wq; | 36 | extern struct workqueue_struct *pm_wq; |
@@ -37,8 +45,6 @@ extern void pm_runtime_enable(struct device *dev); | |||
37 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); | 45 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); |
38 | extern void pm_runtime_allow(struct device *dev); | 46 | extern void pm_runtime_allow(struct device *dev); |
39 | extern void pm_runtime_forbid(struct device *dev); | 47 | extern void pm_runtime_forbid(struct device *dev); |
40 | extern int pm_generic_runtime_suspend(struct device *dev); | ||
41 | extern int pm_generic_runtime_resume(struct device *dev); | ||
42 | extern void pm_runtime_no_callbacks(struct device *dev); | 48 | extern void pm_runtime_no_callbacks(struct device *dev); |
43 | extern void pm_runtime_irq_safe(struct device *dev); | 49 | extern void pm_runtime_irq_safe(struct device *dev); |
44 | extern void __pm_runtime_use_autosuspend(struct device *dev, bool use); | 50 | extern void __pm_runtime_use_autosuspend(struct device *dev, bool use); |
@@ -142,8 +148,6 @@ static inline bool pm_runtime_active(struct device *dev) { return true; } | |||
142 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } | 148 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } |
143 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } | 149 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } |
144 | 150 | ||
145 | static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } | ||
146 | static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } | ||
147 | static inline void pm_runtime_no_callbacks(struct device *dev) {} | 151 | static inline void pm_runtime_no_callbacks(struct device *dev) {} |
148 | static inline void pm_runtime_irq_safe(struct device *dev) {} | 152 | static inline void pm_runtime_irq_safe(struct device *dev) {} |
149 | 153 | ||