Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6

* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
PM: Make ACPI wakeup from S5 work again when CONFIG_PM_SLEEP is unset

+16 -11
+2
include/linux/pm.h
··· 431 431 struct list_head entry; 432 432 struct completion completion; 433 433 struct wakeup_source *wakeup; 434 + #else 435 + unsigned int should_wakeup:1; 434 436 #endif 435 437 #ifdef CONFIG_PM_RUNTIME 436 438 struct timer_list suspend_timer;
+14 -11
include/linux/pm_wakeup.h
··· 109 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 112 static inline struct wakeup_source *wakeup_source_create(const char *name) 118 113 { 119 114 return NULL; ··· 129 134 130 135 static inline int device_wakeup_enable(struct device *dev) 131 136 { 132 - return -EINVAL; 137 + dev->power.should_wakeup = true; 138 + return 0; 133 139 } 134 140 135 141 static inline int device_wakeup_disable(struct device *dev) 136 142 { 143 + dev->power.should_wakeup = false; 144 + return 0; 145 + } 146 + 147 + static inline int device_set_wakeup_enable(struct device *dev, bool enable) 148 + { 149 + dev->power.should_wakeup = enable; 137 150 return 0; 138 151 } 139 152 140 153 static inline int device_init_wakeup(struct device *dev, bool val) 141 154 { 142 - dev->power.can_wakeup = val; 143 - return val ? -EINVAL : 0; 155 + device_set_wakeup_capable(dev, val); 156 + device_set_wakeup_enable(dev, val); 157 + return 0; 144 158 } 145 159 146 - 147 - static inline int device_set_wakeup_enable(struct device *dev, bool enable) 160 + static inline bool device_may_wakeup(struct device *dev) 148 161 { 149 - return -EINVAL; 162 + return dev->power.can_wakeup && dev->power.should_wakeup; 150 163 } 151 164 152 165 static inline void __pm_stay_awake(struct wakeup_source *ws) {}