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.h56
1 files changed, 25 insertions, 31 deletions
diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h
index a21223d95926..b6b8a273c5da 100644
--- a/drivers/base/power/power.h
+++ b/drivers/base/power/power.h
@@ -9,7 +9,7 @@ static inline void device_pm_init_common(struct device *dev)
9 } 9 }
10} 10}
11 11
12#ifdef CONFIG_PM_RUNTIME 12#ifdef CONFIG_PM
13 13
14static inline void pm_runtime_early_init(struct device *dev) 14static inline void pm_runtime_early_init(struct device *dev)
15{ 15{
@@ -20,7 +20,21 @@ static inline void pm_runtime_early_init(struct device *dev)
20extern void pm_runtime_init(struct device *dev); 20extern void pm_runtime_init(struct device *dev);
21extern void pm_runtime_remove(struct device *dev); 21extern void pm_runtime_remove(struct device *dev);
22 22
23#else /* !CONFIG_PM_RUNTIME */ 23/*
24 * sysfs.c
25 */
26
27extern int dpm_sysfs_add(struct device *dev);
28extern void dpm_sysfs_remove(struct device *dev);
29extern void rpm_sysfs_remove(struct device *dev);
30extern int wakeup_sysfs_add(struct device *dev);
31extern void wakeup_sysfs_remove(struct device *dev);
32extern int pm_qos_sysfs_add_resume_latency(struct device *dev);
33extern void pm_qos_sysfs_remove_resume_latency(struct device *dev);
34extern int pm_qos_sysfs_add_flags(struct device *dev);
35extern void pm_qos_sysfs_remove_flags(struct device *dev);
36
37#else /* CONFIG_PM */
24 38
25static inline void pm_runtime_early_init(struct device *dev) 39static inline void pm_runtime_early_init(struct device *dev)
26{ 40{
@@ -30,7 +44,15 @@ static inline void pm_runtime_early_init(struct device *dev)
30static inline void pm_runtime_init(struct device *dev) {} 44static inline void pm_runtime_init(struct device *dev) {}
31static inline void pm_runtime_remove(struct device *dev) {} 45static inline void pm_runtime_remove(struct device *dev) {}
32 46
33#endif /* !CONFIG_PM_RUNTIME */ 47static inline int dpm_sysfs_add(struct device *dev) { return 0; }
48static inline void dpm_sysfs_remove(struct device *dev) {}
49static inline void rpm_sysfs_remove(struct device *dev) {}
50static inline int wakeup_sysfs_add(struct device *dev) { return 0; }
51static inline void wakeup_sysfs_remove(struct device *dev) {}
52static inline int pm_qos_sysfs_add(struct device *dev) { return 0; }
53static inline void pm_qos_sysfs_remove(struct device *dev) {}
54
55#endif
34 56
35#ifdef CONFIG_PM_SLEEP 57#ifdef CONFIG_PM_SLEEP
36 58
@@ -77,31 +99,3 @@ static inline void device_pm_init(struct device *dev)
77 device_pm_sleep_init(dev); 99 device_pm_sleep_init(dev);
78 pm_runtime_init(dev); 100 pm_runtime_init(dev);
79} 101}
80
81#ifdef CONFIG_PM
82
83/*
84 * sysfs.c
85 */
86
87extern int dpm_sysfs_add(struct device *dev);
88extern void dpm_sysfs_remove(struct device *dev);
89extern void rpm_sysfs_remove(struct device *dev);
90extern int wakeup_sysfs_add(struct device *dev);
91extern void wakeup_sysfs_remove(struct device *dev);
92extern int pm_qos_sysfs_add_resume_latency(struct device *dev);
93extern void pm_qos_sysfs_remove_resume_latency(struct device *dev);
94extern int pm_qos_sysfs_add_flags(struct device *dev);
95extern void pm_qos_sysfs_remove_flags(struct device *dev);
96
97#else /* CONFIG_PM */
98
99static inline int dpm_sysfs_add(struct device *dev) { return 0; }
100static inline void dpm_sysfs_remove(struct device *dev) {}
101static inline void rpm_sysfs_remove(struct device *dev) {}
102static inline int wakeup_sysfs_add(struct device *dev) { return 0; }
103static inline void wakeup_sysfs_remove(struct device *dev) {}
104static inline int pm_qos_sysfs_add(struct device *dev) { return 0; }
105static inline void pm_qos_sysfs_remove(struct device *dev) {}
106
107#endif