blob: 2e700d795cf15033c933e4a1a71a4d73afa59a14 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * shutdown.c
3 */
4
Linus Torvalds1da177e2005-04-16 15:20:36 -07005extern void device_shutdown(void);
6
7
8#ifdef CONFIG_PM
9
10/*
11 * main.c
12 */
13
14/*
15 * Used to synchronize global power management operations.
16 */
17extern struct semaphore dpm_sem;
18
19/*
20 * Used to serialize changes to the dpm_* lists.
21 */
22extern struct semaphore dpm_list_sem;
23
24/*
25 * The PM lists.
26 */
27extern struct list_head dpm_active;
28extern struct list_head dpm_off;
29extern struct list_head dpm_off_irq;
30
31
32static inline struct dev_pm_info * to_pm_info(struct list_head * entry)
33{
34 return container_of(entry, struct dev_pm_info, entry);
35}
36
37static inline struct device * to_device(struct list_head * entry)
38{
39 return container_of(to_pm_info(entry), struct device, power);
40}
41
42extern int device_pm_add(struct device *);
43extern void device_pm_remove(struct device *);
44
45/*
46 * sysfs.c
47 */
48
49extern int dpm_sysfs_add(struct device *);
50extern void dpm_sysfs_remove(struct device *);
51
52/*
53 * resume.c
54 */
55
56extern void dpm_resume(void);
57extern void dpm_power_up(void);
58extern int resume_device(struct device *);
59
60/*
61 * suspend.c
62 */
63extern int suspend_device(struct device *, pm_message_t);
64
65
66/*
67 * runtime.c
68 */
69
70extern int dpm_runtime_suspend(struct device *, pm_message_t);
71extern void dpm_runtime_resume(struct device *);
72
73#else /* CONFIG_PM */
74
75
76static inline int device_pm_add(struct device * dev)
77{
78 return 0;
79}
80static inline void device_pm_remove(struct device * dev)
81{
82
83}
84
85static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state)
86{
87 return 0;
88}
89
90static inline void dpm_runtime_resume(struct device * dev)
91{
92
93}
94
95#endif