Merge remote-tracking branch 'pm/linux-next'
[linux-2.6/next.git] / drivers / base / power / power.h
blobf2a25f18fde7caaa3a1949c893afae3c872b76c3
1 #ifdef CONFIG_PM_RUNTIME
3 extern void pm_runtime_init(struct device *dev);
4 extern void pm_runtime_remove(struct device *dev);
6 #else /* !CONFIG_PM_RUNTIME */
8 static inline void pm_runtime_init(struct device *dev) {}
9 static inline void pm_runtime_remove(struct device *dev) {}
11 #endif /* !CONFIG_PM_RUNTIME */
13 #ifdef CONFIG_PM_SLEEP
15 /* kernel/power/main.c */
16 extern int pm_async_enabled;
18 /* drivers/base/power/main.c */
19 extern struct list_head dpm_list; /* The active device list */
21 static inline struct device *to_device(struct list_head *entry)
23 return container_of(entry, struct device, power.entry);
26 extern void device_pm_init(struct device *dev);
27 extern void device_pm_add(struct device *);
28 extern void device_pm_remove(struct device *);
29 extern void device_pm_move_before(struct device *, struct device *);
30 extern void device_pm_move_after(struct device *, struct device *);
31 extern void device_pm_move_last(struct device *);
33 #else /* !CONFIG_PM_SLEEP */
35 static inline void device_pm_init(struct device *dev)
37 spin_lock_init(&dev->power.lock);
38 pm_runtime_init(dev);
41 static inline void device_pm_remove(struct device *dev)
43 pm_runtime_remove(dev);
46 static inline void device_pm_add(struct device *dev) {}
47 static inline void device_pm_move_before(struct device *deva,
48 struct device *devb) {}
49 static inline void device_pm_move_after(struct device *deva,
50 struct device *devb) {}
51 static inline void device_pm_move_last(struct device *dev) {}
53 #endif /* !CONFIG_PM_SLEEP */
55 #ifdef CONFIG_PM
58 * sysfs.c
61 extern int dpm_sysfs_add(struct device *dev);
62 extern void dpm_sysfs_remove(struct device *dev);
63 extern void rpm_sysfs_remove(struct device *dev);
64 extern int wakeup_sysfs_add(struct device *dev);
65 extern void wakeup_sysfs_remove(struct device *dev);
67 #else /* CONFIG_PM */
69 static inline int dpm_sysfs_add(struct device *dev) { return 0; }
70 static inline void dpm_sysfs_remove(struct device *dev) {}
71 static inline void rpm_sysfs_remove(struct device *dev) {}
72 static inline int wakeup_sysfs_add(struct device *dev) { return 0; }
73 static inline void wakeup_sysfs_remove(struct device *dev) {}
75 #endif