diff options
| -rw-r--r-- | include/linux/pm.h | 2 | ||||
| -rw-r--r-- | include/linux/pm_wakeup.h | 25 |
2 files changed, 16 insertions, 11 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index dd9c7ab38270..21415cc91cbb 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -431,6 +431,8 @@ struct dev_pm_info { | |||
| 431 | struct list_head entry; | 431 | struct list_head entry; |
| 432 | struct completion completion; | 432 | struct completion completion; |
| 433 | struct wakeup_source *wakeup; | 433 | struct wakeup_source *wakeup; |
| 434 | #else | ||
| 435 | unsigned int should_wakeup:1; | ||
| 434 | #endif | 436 | #endif |
| 435 | #ifdef CONFIG_PM_RUNTIME | 437 | #ifdef CONFIG_PM_RUNTIME |
| 436 | struct timer_list suspend_timer; | 438 | struct timer_list suspend_timer; |
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h index 9cff00dd6b63..03a67db03d01 100644 --- a/include/linux/pm_wakeup.h +++ b/include/linux/pm_wakeup.h | |||
| @@ -109,11 +109,6 @@ static inline bool device_can_wakeup(struct device *dev) | |||
| 109 | return dev->power.can_wakeup; | 109 | return dev->power.can_wakeup; |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | static inline bool device_may_wakeup(struct device *dev) | ||
| 113 | { | ||
| 114 | return false; | ||
| 115 | } | ||
| 116 | |||
| 117 | static inline struct wakeup_source *wakeup_source_create(const char *name) | 112 | static inline struct wakeup_source *wakeup_source_create(const char *name) |
| 118 | { | 113 | { |
| 119 | return NULL; | 114 | return NULL; |
| @@ -134,24 +129,32 @@ static inline void wakeup_source_unregister(struct wakeup_source *ws) {} | |||
| 134 | 129 | ||
| 135 | static inline int device_wakeup_enable(struct device *dev) | 130 | static inline int device_wakeup_enable(struct device *dev) |
| 136 | { | 131 | { |
| 137 | return -EINVAL; | 132 | dev->power.should_wakeup = true; |
| 133 | return 0; | ||
| 138 | } | 134 | } |
| 139 | 135 | ||
| 140 | static inline int device_wakeup_disable(struct device *dev) | 136 | static inline int device_wakeup_disable(struct device *dev) |
| 141 | { | 137 | { |
| 138 | dev->power.should_wakeup = false; | ||
| 142 | return 0; | 139 | return 0; |
| 143 | } | 140 | } |
| 144 | 141 | ||
| 145 | static inline int device_init_wakeup(struct device *dev, bool val) | 142 | static inline int device_set_wakeup_enable(struct device *dev, bool enable) |
| 146 | { | 143 | { |
| 147 | dev->power.can_wakeup = val; | 144 | dev->power.should_wakeup = enable; |
| 148 | return val ? -EINVAL : 0; | 145 | return 0; |
| 149 | } | 146 | } |
| 150 | 147 | ||
| 148 | static inline int device_init_wakeup(struct device *dev, bool val) | ||
| 149 | { | ||
| 150 | device_set_wakeup_capable(dev, val); | ||
| 151 | device_set_wakeup_enable(dev, val); | ||
| 152 | return 0; | ||
| 153 | } | ||
| 151 | 154 | ||
| 152 | static inline int device_set_wakeup_enable(struct device *dev, bool enable) | 155 | static inline bool device_may_wakeup(struct device *dev) |
| 153 | { | 156 | { |
| 154 | return -EINVAL; | 157 | return dev->power.can_wakeup && dev->power.should_wakeup; |
| 155 | } | 158 | } |
| 156 | 159 | ||
| 157 | static inline void __pm_stay_awake(struct wakeup_source *ws) {} | 160 | static inline void __pm_stay_awake(struct wakeup_source *ws) {} |
