diff options
Diffstat (limited to 'drivers/base/power/power.h')
-rw-r--r-- | drivers/base/power/power.h | 31 |
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 @@ | |||
1 | static inline void device_pm_init(struct device *dev) | 1 | #ifdef CONFIG_PM_RUNTIME |
2 | { | 2 | |
3 | dev->power.status = DPM_ON; | 3 | extern void pm_runtime_init(struct device *dev); |
4 | } | 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 */ | ||
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 | ||
26 | extern void device_pm_init(struct device *dev); | ||
19 | extern void device_pm_add(struct device *); | 27 | extern void device_pm_add(struct device *); |
20 | extern void device_pm_remove(struct device *); | 28 | extern void device_pm_remove(struct device *); |
21 | extern void device_pm_move_before(struct device *, struct device *); | 29 | extern void device_pm_move_before(struct device *, struct device *); |
22 | extern void device_pm_move_after(struct device *, struct device *); | 30 | extern void device_pm_move_after(struct device *, struct device *); |
23 | extern void device_pm_move_last(struct device *); | 31 | extern void device_pm_move_last(struct device *); |
24 | 32 | ||
25 | #else /* CONFIG_PM_SLEEP */ | 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 | } | ||
26 | 44 | ||
27 | static inline void device_pm_add(struct device *dev) {} | 45 | static inline void device_pm_add(struct device *dev) {} |
28 | static inline void device_pm_remove(struct device *dev) {} | ||
29 | static inline void device_pm_move_before(struct device *deva, | 46 | static inline void device_pm_move_before(struct device *deva, |
30 | struct device *devb) {} | 47 | struct device *devb) {} |
31 | static inline void device_pm_move_after(struct device *deva, | 48 | static inline void device_pm_move_after(struct device *deva, |
32 | struct device *devb) {} | 49 | struct device *devb) {} |
33 | static inline void device_pm_move_last(struct device *dev) {} | 50 | static 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 | ||