diff options
Diffstat (limited to 'include/linux/pm_runtime.h')
-rw-r--r-- | include/linux/pm_runtime.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index f615e217e575..3efa6ed2aaca 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h @@ -64,6 +64,8 @@ static inline int pm_runtime_get_if_in_use(struct device *dev) return pm_runtime_get_if_active(dev, false); } +extern int devm_pm_runtime_enable(struct device *dev); + static inline void pm_suspend_ignore_children(struct device *dev, bool enable) { dev->power.ignore_children = enable; @@ -160,6 +162,8 @@ static inline void __pm_runtime_disable(struct device *dev, bool c) {} static inline void pm_runtime_allow(struct device *dev) {} static inline void pm_runtime_forbid(struct device *dev) {} +static inline int devm_pm_runtime_enable(struct device *dev) { return 0; } + static inline void pm_suspend_ignore_children(struct device *dev, bool enable) {} static inline void pm_runtime_get_noresume(struct device *dev) {} static inline void pm_runtime_put_noidle(struct device *dev) {} @@ -296,6 +300,11 @@ static inline void pm_runtime_disable(struct device *dev) __pm_runtime_disable(dev, true); } +/** + * NOTE: It's important to undo this with pm_runtime_dont_use_autosuspend() + * at driver exit time unless your driver initially enabled pm_runtime + * with devm_pm_runtime_enable() (which handles it for you). + */ static inline void pm_runtime_use_autosuspend(struct device *dev) { __pm_runtime_use_autosuspend(dev, true); |