create /sys/.../power when CONFIG_PM is set
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / base / power / power.h
blob6c4a19bc86d8a26db1cdbbf84906ce9b8c313667
1 /*
2 * shutdown.c
3 */
5 extern void device_shutdown(void);
8 #ifdef CONFIG_PM_SLEEP
11 * main.c
15 * Used to synchronize global power management operations.
17 extern struct mutex dpm_mtx;
20 * Used to serialize changes to the dpm_* lists.
22 extern struct mutex dpm_list_mtx;
25 * The PM lists.
27 extern struct list_head dpm_active;
28 extern struct list_head dpm_off;
29 extern struct list_head dpm_off_irq;
32 static inline struct dev_pm_info * to_pm_info(struct list_head * entry)
34 return container_of(entry, struct dev_pm_info, entry);
37 static inline struct device *to_device(struct list_head *entry)
39 return container_of(to_pm_info(entry), struct device, power);
42 extern void device_pm_add(struct device *);
43 extern void device_pm_remove(struct device *);
45 #else /* CONFIG_PM_SLEEP */
47 static inline void device_pm_add(struct device *dev)
51 static inline void device_pm_remove(struct device *dev)
54 #endif
56 #ifdef CONFIG_PM
58 * sysfs.c
61 extern int dpm_sysfs_add(struct device *);
62 extern void dpm_sysfs_remove(struct device *);
65 * resume.c
68 extern void dpm_resume(void);
69 extern void dpm_power_up(void);
70 extern int resume_device(struct device *);
73 * suspend.c
75 extern int suspend_device(struct device *, pm_message_t);
77 #else /* CONFIG_PM */
79 static inline int dpm_sysfs_add(struct device *dev)
81 return 0;
84 static inline void dpm_sysfs_remove(struct device *dev)
88 #endif