diff options
Diffstat (limited to 'include/linux/pm.h')
| -rw-r--r-- | include/linux/pm.h | 43 |
1 files changed, 3 insertions, 40 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index 015b735811b4..1de72cbbe0d1 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -183,8 +183,9 @@ typedef struct pm_message { | |||
| 183 | struct dev_pm_info { | 183 | struct dev_pm_info { |
| 184 | pm_message_t power_state; | 184 | pm_message_t power_state; |
| 185 | unsigned can_wakeup:1; | 185 | unsigned can_wakeup:1; |
| 186 | #ifdef CONFIG_PM_SLEEP | ||
| 187 | unsigned should_wakeup:1; | 186 | unsigned should_wakeup:1; |
| 187 | bool sleeping:1; /* Owned by the PM core */ | ||
| 188 | #ifdef CONFIG_PM_SLEEP | ||
| 188 | struct list_head entry; | 189 | struct list_head entry; |
| 189 | #endif | 190 | #endif |
| 190 | }; | 191 | }; |
| @@ -197,11 +198,6 @@ extern void device_resume(void); | |||
| 197 | extern int device_suspend(pm_message_t state); | 198 | extern int device_suspend(pm_message_t state); |
| 198 | extern int device_prepare_suspend(pm_message_t state); | 199 | extern int device_prepare_suspend(pm_message_t state); |
| 199 | 200 | ||
| 200 | #define device_set_wakeup_enable(dev,val) \ | ||
| 201 | ((dev)->power.should_wakeup = !!(val)) | ||
| 202 | #define device_may_wakeup(dev) \ | ||
| 203 | (device_can_wakeup(dev) && (dev)->power.should_wakeup) | ||
| 204 | |||
| 205 | extern void __suspend_report_result(const char *function, void *fn, int ret); | 201 | extern void __suspend_report_result(const char *function, void *fn, int ret); |
| 206 | 202 | ||
| 207 | #define suspend_report_result(fn, ret) \ | 203 | #define suspend_report_result(fn, ret) \ |
| @@ -209,20 +205,6 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
| 209 | __suspend_report_result(__FUNCTION__, fn, ret); \ | 205 | __suspend_report_result(__FUNCTION__, fn, ret); \ |
| 210 | } while (0) | 206 | } while (0) |
| 211 | 207 | ||
| 212 | /* | ||
| 213 | * Platform hook to activate device wakeup capability, if that's not already | ||
| 214 | * handled by enable_irq_wake() etc. | ||
| 215 | * Returns zero on success, else negative errno | ||
| 216 | */ | ||
| 217 | extern int (*platform_enable_wakeup)(struct device *dev, int is_on); | ||
| 218 | |||
| 219 | static inline int call_platform_enable_wakeup(struct device *dev, int is_on) | ||
| 220 | { | ||
| 221 | if (platform_enable_wakeup) | ||
| 222 | return (*platform_enable_wakeup)(dev, is_on); | ||
| 223 | return 0; | ||
| 224 | } | ||
| 225 | |||
| 226 | #else /* !CONFIG_PM_SLEEP */ | 208 | #else /* !CONFIG_PM_SLEEP */ |
| 227 | 209 | ||
| 228 | static inline int device_suspend(pm_message_t state) | 210 | static inline int device_suspend(pm_message_t state) |
| @@ -230,29 +212,10 @@ static inline int device_suspend(pm_message_t state) | |||
| 230 | return 0; | 212 | return 0; |
| 231 | } | 213 | } |
| 232 | 214 | ||
| 233 | #define device_set_wakeup_enable(dev,val) do{}while(0) | 215 | #define suspend_report_result(fn, ret) do {} while (0) |
| 234 | #define device_may_wakeup(dev) (0) | ||
| 235 | |||
| 236 | #define suspend_report_result(fn, ret) do { } while (0) | ||
| 237 | |||
| 238 | static inline int call_platform_enable_wakeup(struct device *dev, int is_on) | ||
| 239 | { | ||
| 240 | return 0; | ||
| 241 | } | ||
| 242 | 216 | ||
| 243 | #endif /* !CONFIG_PM_SLEEP */ | 217 | #endif /* !CONFIG_PM_SLEEP */ |
| 244 | 218 | ||
| 245 | /* changes to device_may_wakeup take effect on the next pm state change. | ||
| 246 | * by default, devices should wakeup if they can. | ||
| 247 | */ | ||
| 248 | #define device_can_wakeup(dev) \ | ||
| 249 | ((dev)->power.can_wakeup) | ||
| 250 | #define device_init_wakeup(dev,val) \ | ||
| 251 | do { \ | ||
| 252 | device_can_wakeup(dev) = !!(val); \ | ||
| 253 | device_set_wakeup_enable(dev,val); \ | ||
| 254 | } while(0) | ||
| 255 | |||
| 256 | /* | 219 | /* |
| 257 | * Global Power Management flags | 220 | * Global Power Management flags |
| 258 | * Used to keep APM and ACPI from both being active | 221 | * Used to keep APM and ACPI from both being active |
