aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/power/power.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/base/power/power.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/base/power/power.h')
-rw-r--r--drivers/base/power/power.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h
new file mode 100644
index 000000000000..e5eda746f2a6
--- /dev/null
+++ b/drivers/base/power/power.h
@@ -0,0 +1,106 @@
1
2
3enum {
4 DEVICE_PM_ON,
5 DEVICE_PM1,
6 DEVICE_PM2,
7 DEVICE_PM3,
8 DEVICE_PM_OFF,
9};
10
11/*
12 * shutdown.c
13 */
14
15extern int device_detach_shutdown(struct device *);
16extern void device_shutdown(void);
17
18
19#ifdef CONFIG_PM
20
21/*
22 * main.c
23 */
24
25/*
26 * Used to synchronize global power management operations.
27 */
28extern struct semaphore dpm_sem;
29
30/*
31 * Used to serialize changes to the dpm_* lists.
32 */
33extern struct semaphore dpm_list_sem;
34
35/*
36 * The PM lists.
37 */
38extern struct list_head dpm_active;
39extern struct list_head dpm_off;
40extern struct list_head dpm_off_irq;
41
42
43static inline struct dev_pm_info * to_pm_info(struct list_head * entry)
44{
45 return container_of(entry, struct dev_pm_info, entry);
46}
47
48static inline struct device * to_device(struct list_head * entry)
49{
50 return container_of(to_pm_info(entry), struct device, power);
51}
52
53extern int device_pm_add(struct device *);
54extern void device_pm_remove(struct device *);
55
56/*
57 * sysfs.c
58 */
59
60extern int dpm_sysfs_add(struct device *);
61extern void dpm_sysfs_remove(struct device *);
62
63/*
64 * resume.c
65 */
66
67extern void dpm_resume(void);
68extern void dpm_power_up(void);
69extern int resume_device(struct device *);
70
71/*
72 * suspend.c
73 */
74extern int suspend_device(struct device *, pm_message_t);
75
76
77/*
78 * runtime.c
79 */
80
81extern int dpm_runtime_suspend(struct device *, pm_message_t);
82extern void dpm_runtime_resume(struct device *);
83
84#else /* CONFIG_PM */
85
86
87static inline int device_pm_add(struct device * dev)
88{
89 return 0;
90}
91static inline void device_pm_remove(struct device * dev)
92{
93
94}
95
96static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state)
97{
98 return 0;
99}
100
101static inline void dpm_runtime_resume(struct device * dev)
102{
103
104}
105
106#endif