aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pm.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-05-17 17:26:21 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-05-17 17:26:21 -0400
commit6538df80194e305f1b78cafb556f4bb442f808b3 (patch)
tree72927d33d82f0e9502811abfc10d722a7423fff2 /include/linux/pm.h
parent91e7c75ba93c48a82670d630b9daac92ff70095d (diff)
PM: Introduce generic prepare and complete callbacks for subsystems
Introduce generic .prepare() and .complete() power management callbacks, currently missing, that can be used by subsystems and power domains and export them. Provide NULL definitions of all the generic system sleep callbacks for CONFIG_PM_SLEEP unset. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r--include/linux/pm.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h
index dce7c7148771..3160648ccdda 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -550,6 +550,16 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
550 } while (0) 550 } while (0)
551 551
552extern int device_pm_wait_for_dev(struct device *sub, struct device *dev); 552extern int device_pm_wait_for_dev(struct device *sub, struct device *dev);
553
554extern int pm_generic_prepare(struct device *dev);
555extern int pm_generic_suspend(struct device *dev);
556extern int pm_generic_resume(struct device *dev);
557extern int pm_generic_freeze(struct device *dev);
558extern int pm_generic_thaw(struct device *dev);
559extern int pm_generic_restore(struct device *dev);
560extern int pm_generic_poweroff(struct device *dev);
561extern void pm_generic_complete(struct device *dev);
562
553#else /* !CONFIG_PM_SLEEP */ 563#else /* !CONFIG_PM_SLEEP */
554 564
555#define device_pm_lock() do {} while (0) 565#define device_pm_lock() do {} while (0)
@@ -566,6 +576,15 @@ static inline int device_pm_wait_for_dev(struct device *a, struct device *b)
566{ 576{
567 return 0; 577 return 0;
568} 578}
579
580#define pm_generic_prepare NULL
581#define pm_generic_suspend NULL
582#define pm_generic_resume NULL
583#define pm_generic_freeze NULL
584#define pm_generic_thaw NULL
585#define pm_generic_restore NULL
586#define pm_generic_poweroff NULL
587#define pm_generic_complete NULL
569#endif /* !CONFIG_PM_SLEEP */ 588#endif /* !CONFIG_PM_SLEEP */
570 589
571/* How to reorder dpm_list after device_move() */ 590/* How to reorder dpm_list after device_move() */
@@ -576,11 +595,4 @@ enum dpm_order {
576 DPM_ORDER_DEV_LAST, 595 DPM_ORDER_DEV_LAST,
577}; 596};
578 597
579extern int pm_generic_suspend(struct device *dev);
580extern int pm_generic_resume(struct device *dev);
581extern int pm_generic_freeze(struct device *dev);
582extern int pm_generic_thaw(struct device *dev);
583extern int pm_generic_restore(struct device *dev);
584extern int pm_generic_poweroff(struct device *dev);
585
586#endif /* _LINUX_PM_H */ 598#endif /* _LINUX_PM_H */