aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r--include/linux/pm.h42
1 files changed, 26 insertions, 16 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 512e09177e57..411e4f4be52b 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -425,7 +425,8 @@ struct dev_pm_info {
425 pm_message_t power_state; 425 pm_message_t power_state;
426 unsigned int can_wakeup:1; 426 unsigned int can_wakeup:1;
427 unsigned int async_suspend:1; 427 unsigned int async_suspend:1;
428 unsigned int in_suspend:1; /* Owned by the PM core */ 428 bool is_prepared:1; /* Owned by the PM core */
429 bool is_suspended:1; /* Ditto */
429 spinlock_t lock; 430 spinlock_t lock;
430#ifdef CONFIG_PM_SLEEP 431#ifdef CONFIG_PM_SLEEP
431 struct list_head entry; 432 struct list_head entry;
@@ -460,6 +461,7 @@ struct dev_pm_info {
460 unsigned long active_jiffies; 461 unsigned long active_jiffies;
461 unsigned long suspended_jiffies; 462 unsigned long suspended_jiffies;
462 unsigned long accounting_timestamp; 463 unsigned long accounting_timestamp;
464 void *subsys_data; /* Owned by the subsystem. */
463#endif 465#endif
464}; 466};
465 467
@@ -529,21 +531,17 @@ struct dev_power_domain {
529 */ 531 */
530 532
531#ifdef CONFIG_PM_SLEEP 533#ifdef CONFIG_PM_SLEEP
532#ifndef CONFIG_ARCH_NO_SYSDEV_OPS
533extern int sysdev_suspend(pm_message_t state);
534extern int sysdev_resume(void);
535#else
536static inline int sysdev_suspend(pm_message_t state) { return 0; }
537static inline int sysdev_resume(void) { return 0; }
538#endif
539
540extern void device_pm_lock(void); 534extern void device_pm_lock(void);
541extern void dpm_resume_noirq(pm_message_t state); 535extern void dpm_resume_noirq(pm_message_t state);
542extern void dpm_resume_end(pm_message_t state); 536extern void dpm_resume_end(pm_message_t state);
537extern void dpm_resume(pm_message_t state);
538extern void dpm_complete(pm_message_t state);
543 539
544extern void device_pm_unlock(void); 540extern void device_pm_unlock(void);
545extern int dpm_suspend_noirq(pm_message_t state); 541extern int dpm_suspend_noirq(pm_message_t state);
546extern int dpm_suspend_start(pm_message_t state); 542extern int dpm_suspend_start(pm_message_t state);
543extern int dpm_suspend(pm_message_t state);
544extern int dpm_prepare(pm_message_t state);
547 545
548extern void __suspend_report_result(const char *function, void *fn, int ret); 546extern void __suspend_report_result(const char *function, void *fn, int ret);
549 547
@@ -553,6 +551,16 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
553 } while (0) 551 } while (0)
554 552
555extern int device_pm_wait_for_dev(struct device *sub, struct device *dev); 553extern int device_pm_wait_for_dev(struct device *sub, struct device *dev);
554
555extern int pm_generic_prepare(struct device *dev);
556extern int pm_generic_suspend(struct device *dev);
557extern int pm_generic_resume(struct device *dev);
558extern int pm_generic_freeze(struct device *dev);
559extern int pm_generic_thaw(struct device *dev);
560extern int pm_generic_restore(struct device *dev);
561extern int pm_generic_poweroff(struct device *dev);
562extern void pm_generic_complete(struct device *dev);
563
556#else /* !CONFIG_PM_SLEEP */ 564#else /* !CONFIG_PM_SLEEP */
557 565
558#define device_pm_lock() do {} while (0) 566#define device_pm_lock() do {} while (0)
@@ -569,6 +577,15 @@ static inline int device_pm_wait_for_dev(struct device *a, struct device *b)
569{ 577{
570 return 0; 578 return 0;
571} 579}
580
581#define pm_generic_prepare NULL
582#define pm_generic_suspend NULL
583#define pm_generic_resume NULL
584#define pm_generic_freeze NULL
585#define pm_generic_thaw NULL
586#define pm_generic_restore NULL
587#define pm_generic_poweroff NULL
588#define pm_generic_complete NULL
572#endif /* !CONFIG_PM_SLEEP */ 589#endif /* !CONFIG_PM_SLEEP */
573 590
574/* How to reorder dpm_list after device_move() */ 591/* How to reorder dpm_list after device_move() */
@@ -579,11 +596,4 @@ enum dpm_order {
579 DPM_ORDER_DEV_LAST, 596 DPM_ORDER_DEV_LAST,
580}; 597};
581 598
582extern int pm_generic_suspend(struct device *dev);
583extern int pm_generic_resume(struct device *dev);
584extern int pm_generic_freeze(struct device *dev);
585extern int pm_generic_thaw(struct device *dev);
586extern int pm_generic_restore(struct device *dev);
587extern int pm_generic_poweroff(struct device *dev);
588
589#endif /* _LINUX_PM_H */ 599#endif /* _LINUX_PM_H */