xref: /openbmc/linux/drivers/base/power/power.h (revision 4dc7ccf7)
1 #ifdef CONFIG_PM_RUNTIME
2 
3 extern void pm_runtime_init(struct device *dev);
4 extern void pm_runtime_remove(struct device *dev);
5 
6 #else /* !CONFIG_PM_RUNTIME */
7 
8 static inline void pm_runtime_init(struct device *dev) {}
9 static inline void pm_runtime_remove(struct device *dev) {}
10 
11 #endif /* !CONFIG_PM_RUNTIME */
12 
13 #ifdef CONFIG_PM_SLEEP
14 
15 /* kernel/power/main.c */
16 extern int pm_async_enabled;
17 
18 /* drivers/base/power/main.c */
19 extern struct list_head dpm_list;	/* The active device list */
20 
21 static inline struct device *to_device(struct list_head *entry)
22 {
23 	return container_of(entry, struct device, power.entry);
24 }
25 
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 *);
32 
33 #else /* !CONFIG_PM_SLEEP */
34 
35 static inline void device_pm_init(struct device *dev)
36 {
37 	pm_runtime_init(dev);
38 }
39 
40 static inline void device_pm_remove(struct device *dev)
41 {
42 	pm_runtime_remove(dev);
43 }
44 
45 static inline void device_pm_add(struct device *dev) {}
46 static inline void device_pm_move_before(struct device *deva,
47 					 struct device *devb) {}
48 static inline void device_pm_move_after(struct device *deva,
49 					struct device *devb) {}
50 static inline void device_pm_move_last(struct device *dev) {}
51 
52 #endif /* !CONFIG_PM_SLEEP */
53 
54 #ifdef CONFIG_PM
55 
56 /*
57  * sysfs.c
58  */
59 
60 extern int dpm_sysfs_add(struct device *);
61 extern void dpm_sysfs_remove(struct device *);
62 
63 #else /* CONFIG_PM */
64 
65 static inline int dpm_sysfs_add(struct device *dev)
66 {
67 	return 0;
68 }
69 
70 static inline void dpm_sysfs_remove(struct device *dev)
71 {
72 }
73 
74 #endif
75