]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - drivers/base/power/power.h
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/dvrabel/uwb
[mirror_ubuntu-bionic-kernel.git] / drivers / base / power / power.h
CommitLineData
5e928f77
RW
1#ifdef CONFIG_PM_RUNTIME
2
3extern void pm_runtime_init(struct device *dev);
4extern void pm_runtime_remove(struct device *dev);
5
6#else /* !CONFIG_PM_RUNTIME */
7
8static inline void pm_runtime_init(struct device *dev) {}
9static inline void pm_runtime_remove(struct device *dev) {}
10
11#endif /* !CONFIG_PM_RUNTIME */
3b98aeaf 12
296699de 13#ifdef CONFIG_PM_SLEEP
1da177e4 14
0e06b4a8
RW
15/* kernel/power/main.c */
16extern int pm_async_enabled;
1da177e4 17
0e06b4a8 18/* drivers/base/power/main.c */
1eede070 19extern struct list_head dpm_list; /* The active device list */
1da177e4 20
dec13c15 21static inline struct device *to_device(struct list_head *entry)
1da177e4 22{
cd59abfc 23 return container_of(entry, struct device, power.entry);
1da177e4
LT
24}
25
5e928f77 26extern void device_pm_init(struct device *dev);
3b98aeaf 27extern void device_pm_add(struct device *);
1da177e4 28extern void device_pm_remove(struct device *);
ffa6a705
CH
29extern void device_pm_move_before(struct device *, struct device *);
30extern void device_pm_move_after(struct device *, struct device *);
31extern void device_pm_move_last(struct device *);
1da177e4 32
5e928f77
RW
33#else /* !CONFIG_PM_SLEEP */
34
35static inline void device_pm_init(struct device *dev)
36{
37 pm_runtime_init(dev);
38}
39
40static inline void device_pm_remove(struct device *dev)
41{
42 pm_runtime_remove(dev);
43}
dec13c15 44
3b98aeaf 45static inline void device_pm_add(struct device *dev) {}
ffa6a705
CH
46static inline void device_pm_move_before(struct device *deva,
47 struct device *devb) {}
48static inline void device_pm_move_after(struct device *deva,
49 struct device *devb) {}
50static inline void device_pm_move_last(struct device *dev) {}
775b64d2 51
5e928f77 52#endif /* !CONFIG_PM_SLEEP */
dec13c15
DD
53
54#ifdef CONFIG_PM
55
1da177e4
LT
56/*
57 * sysfs.c
58 */
59
60extern int dpm_sysfs_add(struct device *);
61extern void dpm_sysfs_remove(struct device *);
62
dec13c15 63#else /* CONFIG_PM */
1da177e4 64
dec13c15 65static inline int dpm_sysfs_add(struct device *dev)
1da177e4
LT
66{
67 return 0;
68}
1da177e4 69
dec13c15
DD
70static inline void dpm_sysfs_remove(struct device *dev)
71{
1da177e4
LT
72}
73
1da177e4 74#endif