提交 717e5d45 编写于 作者: U Ulf Hansson 提交者: Rafael J. Wysocki

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: NUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 d9fb563d
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/export.h> #include <linux/export.h>
#ifdef CONFIG_PM_RUNTIME #ifdef CONFIG_PM
/** /**
* pm_generic_runtime_suspend - Generic runtime suspend callback for subsystems. * pm_generic_runtime_suspend - Generic runtime suspend callback for subsystems.
* @dev: Device to suspend. * @dev: Device to suspend.
...@@ -48,7 +48,7 @@ int pm_generic_runtime_resume(struct device *dev) ...@@ -48,7 +48,7 @@ int pm_generic_runtime_resume(struct device *dev)
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(pm_generic_runtime_resume); EXPORT_SYMBOL_GPL(pm_generic_runtime_resume);
#endif /* CONFIG_PM_RUNTIME */ #endif /* CONFIG_PM */
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
/** /**
......
...@@ -23,6 +23,14 @@ ...@@ -23,6 +23,14 @@
usage_count */ usage_count */
#define RPM_AUTO 0x08 /* Use autosuspend_delay */ #define RPM_AUTO 0x08 /* Use autosuspend_delay */
#ifdef CONFIG_PM
extern int pm_generic_runtime_suspend(struct device *dev);
extern int pm_generic_runtime_resume(struct device *dev);
#else
static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
#endif
#ifdef CONFIG_PM_RUNTIME #ifdef CONFIG_PM_RUNTIME
extern struct workqueue_struct *pm_wq; extern struct workqueue_struct *pm_wq;
...@@ -37,8 +45,6 @@ extern void pm_runtime_enable(struct device *dev); ...@@ -37,8 +45,6 @@ extern void pm_runtime_enable(struct device *dev);
extern void __pm_runtime_disable(struct device *dev, bool check_resume); extern void __pm_runtime_disable(struct device *dev, bool check_resume);
extern void pm_runtime_allow(struct device *dev); extern void pm_runtime_allow(struct device *dev);
extern void pm_runtime_forbid(struct device *dev); extern void pm_runtime_forbid(struct device *dev);
extern int pm_generic_runtime_suspend(struct device *dev);
extern int pm_generic_runtime_resume(struct device *dev);
extern void pm_runtime_no_callbacks(struct device *dev); extern void pm_runtime_no_callbacks(struct device *dev);
extern void pm_runtime_irq_safe(struct device *dev); extern void pm_runtime_irq_safe(struct device *dev);
extern void __pm_runtime_use_autosuspend(struct device *dev, bool use); 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,8 +148,6 @@ static inline bool pm_runtime_active(struct device *dev) { return true; }
static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } static inline bool pm_runtime_status_suspended(struct device *dev) { return false; }
static inline bool pm_runtime_enabled(struct device *dev) { return false; } static inline bool pm_runtime_enabled(struct device *dev) { return false; }
static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
static inline void pm_runtime_no_callbacks(struct device *dev) {} static inline void pm_runtime_no_callbacks(struct device *dev) {}
static inline void pm_runtime_irq_safe(struct device *dev) {} static inline void pm_runtime_irq_safe(struct device *dev) {}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部