Linux-2.6.12-rc2
[linux-2.6/next.git] / drivers / base / power / power.h
blobe5eda746f2a6d1f2a543e017665d2dac90f0fe5c
3 enum {
4 DEVICE_PM_ON,
5 DEVICE_PM1,
6 DEVICE_PM2,
7 DEVICE_PM3,
8 DEVICE_PM_OFF,
9 };
12 * shutdown.c
15 extern int device_detach_shutdown(struct device *);
16 extern void device_shutdown(void);
19 #ifdef CONFIG_PM
22 * main.c
26 * Used to synchronize global power management operations.
28 extern struct semaphore dpm_sem;
31 * Used to serialize changes to the dpm_* lists.
33 extern struct semaphore dpm_list_sem;
36 * The PM lists.
38 extern struct list_head dpm_active;
39 extern struct list_head dpm_off;
40 extern struct list_head dpm_off_irq;
43 static inline struct dev_pm_info * to_pm_info(struct list_head * entry)
45 return container_of(entry, struct dev_pm_info, entry);
48 static inline struct device * to_device(struct list_head * entry)
50 return container_of(to_pm_info(entry), struct device, power);
53 extern int device_pm_add(struct device *);
54 extern void device_pm_remove(struct device *);
57 * sysfs.c
60 extern int dpm_sysfs_add(struct device *);
61 extern void dpm_sysfs_remove(struct device *);
64 * resume.c
67 extern void dpm_resume(void);
68 extern void dpm_power_up(void);
69 extern int resume_device(struct device *);
72 * suspend.c
74 extern int suspend_device(struct device *, pm_message_t);
78 * runtime.c
81 extern int dpm_runtime_suspend(struct device *, pm_message_t);
82 extern void dpm_runtime_resume(struct device *);
84 #else /* CONFIG_PM */
87 static inline int device_pm_add(struct device * dev)
89 return 0;
91 static inline void device_pm_remove(struct device * dev)
96 static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state)
98 return 0;
101 static inline void dpm_runtime_resume(struct device * dev)
106 #endif