diff options
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r-- | include/linux/pm.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index ad3cc2eb0d34..e52f6f83c061 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -165,6 +165,7 @@ struct pm_ops { | |||
165 | int (*finish)(suspend_state_t state); | 165 | int (*finish)(suspend_state_t state); |
166 | }; | 166 | }; |
167 | 167 | ||
168 | #ifdef CONFIG_SUSPEND | ||
168 | extern struct pm_ops *pm_ops; | 169 | extern struct pm_ops *pm_ops; |
169 | 170 | ||
170 | /** | 171 | /** |
@@ -193,6 +194,12 @@ extern void arch_suspend_disable_irqs(void); | |||
193 | extern void arch_suspend_enable_irqs(void); | 194 | extern void arch_suspend_enable_irqs(void); |
194 | 195 | ||
195 | extern int pm_suspend(suspend_state_t state); | 196 | extern int pm_suspend(suspend_state_t state); |
197 | #else /* !CONFIG_SUSPEND */ | ||
198 | #define suspend_valid_only_mem NULL | ||
199 | |||
200 | static inline void pm_set_ops(struct pm_ops *pm_ops) {} | ||
201 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } | ||
202 | #endif /* !CONFIG_SUSPEND */ | ||
196 | 203 | ||
197 | /* | 204 | /* |
198 | * Device power management | 205 | * Device power management |
@@ -266,7 +273,7 @@ typedef struct pm_message { | |||
266 | struct dev_pm_info { | 273 | struct dev_pm_info { |
267 | pm_message_t power_state; | 274 | pm_message_t power_state; |
268 | unsigned can_wakeup:1; | 275 | unsigned can_wakeup:1; |
269 | #ifdef CONFIG_PM | 276 | #ifdef CONFIG_PM_SLEEP |
270 | unsigned should_wakeup:1; | 277 | unsigned should_wakeup:1; |
271 | struct list_head entry; | 278 | struct list_head entry; |
272 | #endif | 279 | #endif |
@@ -276,7 +283,7 @@ extern int device_power_down(pm_message_t state); | |||
276 | extern void device_power_up(void); | 283 | extern void device_power_up(void); |
277 | extern void device_resume(void); | 284 | extern void device_resume(void); |
278 | 285 | ||
279 | #ifdef CONFIG_PM | 286 | #ifdef CONFIG_PM_SLEEP |
280 | extern int device_suspend(pm_message_t state); | 287 | extern int device_suspend(pm_message_t state); |
281 | extern int device_prepare_suspend(pm_message_t state); | 288 | extern int device_prepare_suspend(pm_message_t state); |
282 | 289 | ||
@@ -306,7 +313,7 @@ static inline int call_platform_enable_wakeup(struct device *dev, int is_on) | |||
306 | return 0; | 313 | return 0; |
307 | } | 314 | } |
308 | 315 | ||
309 | #else /* !CONFIG_PM */ | 316 | #else /* !CONFIG_PM_SLEEP */ |
310 | 317 | ||
311 | static inline int device_suspend(pm_message_t state) | 318 | static inline int device_suspend(pm_message_t state) |
312 | { | 319 | { |
@@ -323,7 +330,7 @@ static inline int call_platform_enable_wakeup(struct device *dev, int is_on) | |||
323 | return 0; | 330 | return 0; |
324 | } | 331 | } |
325 | 332 | ||
326 | #endif | 333 | #endif /* !CONFIG_PM_SLEEP */ |
327 | 334 | ||
328 | /* changes to device_may_wakeup take effect on the next pm state change. | 335 | /* changes to device_may_wakeup take effect on the next pm state change. |
329 | * by default, devices should wakeup if they can. | 336 | * by default, devices should wakeup if they can. |