aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/power/power.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/power/power.h')
-rw-r--r--drivers/base/power/power.h31
1 files changed, 24 insertions, 7 deletions
diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h
index c7cb4fc3735c..b8fa1aa5225a 100644
--- a/drivers/base/power/power.h
+++ b/drivers/base/power/power.h
@@ -1,7 +1,14 @@
1static inline void device_pm_init(struct device *dev) 1#ifdef CONFIG_PM_RUNTIME
2{ 2
3 dev->power.status = DPM_ON; 3extern void pm_runtime_init(struct device *dev);
4} 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 */
5 12
6#ifdef CONFIG_PM_SLEEP 13#ifdef CONFIG_PM_SLEEP
7 14
@@ -16,23 +23,33 @@ static inline struct device *to_device(struct list_head *entry)
16 return container_of(entry, struct device, power.entry); 23 return container_of(entry, struct device, power.entry);
17} 24}
18 25
26extern void device_pm_init(struct device *dev);
19extern void device_pm_add(struct device *); 27extern void device_pm_add(struct device *);
20extern void device_pm_remove(struct device *); 28extern void device_pm_remove(struct device *);
21extern void device_pm_move_before(struct device *, struct device *); 29extern void device_pm_move_before(struct device *, struct device *);
22extern void device_pm_move_after(struct device *, struct device *); 30extern void device_pm_move_after(struct device *, struct device *);
23extern void device_pm_move_last(struct device *); 31extern void device_pm_move_last(struct device *);
24 32
25#else /* CONFIG_PM_SLEEP */ 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}
26 44
27static inline void device_pm_add(struct device *dev) {} 45static inline void device_pm_add(struct device *dev) {}
28static inline void device_pm_remove(struct device *dev) {}
29static inline void device_pm_move_before(struct device *deva, 46static inline void device_pm_move_before(struct device *deva,
30 struct device *devb) {} 47 struct device *devb) {}
31static inline void device_pm_move_after(struct device *deva, 48static inline void device_pm_move_after(struct device *deva,
32 struct device *devb) {} 49 struct device *devb) {}
33static inline void device_pm_move_last(struct device *dev) {} 50static inline void device_pm_move_last(struct device *dev) {}
34 51
35#endif 52#endif /* !CONFIG_PM_SLEEP */
36 53
37#ifdef CONFIG_PM 54#ifdef CONFIG_PM
38 55