Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-btrfs-devel.git] / drivers / base / power / power.h
blob9bf62323aaf35778a0d664f5e4c05713bce80d80
1 #include <linux/pm_qos.h>
3 #ifdef CONFIG_PM_RUNTIME
5 extern void pm_runtime_init(struct device *dev);
6 extern void pm_runtime_remove(struct device *dev);
8 #else /* !CONFIG_PM_RUNTIME */
10 static inline void pm_runtime_init(struct device *dev) {}
11 static inline void pm_runtime_remove(struct device *dev) {}
13 #endif /* !CONFIG_PM_RUNTIME */
15 #ifdef CONFIG_PM_SLEEP
17 /* kernel/power/main.c */
18 extern int pm_async_enabled;
20 /* drivers/base/power/main.c */
21 extern struct list_head dpm_list; /* The active device list */
23 static inline struct device *to_device(struct list_head *entry)
25 return container_of(entry, struct device, power.entry);
28 extern void device_pm_init(struct device *dev);
29 extern void device_pm_add(struct device *);
30 extern void device_pm_remove(struct device *);
31 extern void device_pm_move_before(struct device *, struct device *);
32 extern void device_pm_move_after(struct device *, struct device *);
33 extern void device_pm_move_last(struct device *);
35 #else /* !CONFIG_PM_SLEEP */
37 static inline void device_pm_init(struct device *dev)
39 spin_lock_init(&dev->power.lock);
40 dev->power.power_state = PMSG_INVALID;
41 pm_runtime_init(dev);
44 static inline void device_pm_add(struct device *dev)
46 dev_pm_qos_constraints_init(dev);
49 static inline void device_pm_remove(struct device *dev)
51 dev_pm_qos_constraints_destroy(dev);
52 pm_runtime_remove(dev);
55 static inline void device_pm_move_before(struct device *deva,
56 struct device *devb) {}
57 static inline void device_pm_move_after(struct device *deva,
58 struct device *devb) {}
59 static inline void device_pm_move_last(struct device *dev) {}
61 #endif /* !CONFIG_PM_SLEEP */
63 #ifdef CONFIG_PM
66 * sysfs.c
69 extern int dpm_sysfs_add(struct device *dev);
70 extern void dpm_sysfs_remove(struct device *dev);
71 extern void rpm_sysfs_remove(struct device *dev);
72 extern int wakeup_sysfs_add(struct device *dev);
73 extern void wakeup_sysfs_remove(struct device *dev);
75 #else /* CONFIG_PM */
77 static inline int dpm_sysfs_add(struct device *dev) { return 0; }
78 static inline void dpm_sysfs_remove(struct device *dev) {}
79 static inline void rpm_sysfs_remove(struct device *dev) {}
80 static inline int wakeup_sysfs_add(struct device *dev) { return 0; }
81 static inline void wakeup_sysfs_remove(struct device *dev) {}
83 #endif