diff options
Diffstat (limited to 'include/linux/pm_domain.h')
-rw-r--r-- | include/linux/pm_domain.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 30f794eb3826..a7d6172922d4 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/err.h> | 15 | #include <linux/err.h> |
16 | #include <linux/of.h> | 16 | #include <linux/of.h> |
17 | #include <linux/notifier.h> | 17 | #include <linux/notifier.h> |
18 | #include <linux/cpuidle.h> | ||
18 | 19 | ||
19 | enum gpd_status { | 20 | enum gpd_status { |
20 | GPD_STATE_ACTIVE = 0, /* PM domain is active */ | 21 | GPD_STATE_ACTIVE = 0, /* PM domain is active */ |
@@ -45,6 +46,11 @@ struct gpd_dev_ops { | |||
45 | bool (*active_wakeup)(struct device *dev); | 46 | bool (*active_wakeup)(struct device *dev); |
46 | }; | 47 | }; |
47 | 48 | ||
49 | struct gpd_cpu_data { | ||
50 | unsigned int saved_exit_latency; | ||
51 | struct cpuidle_state *idle_state; | ||
52 | }; | ||
53 | |||
48 | struct generic_pm_domain { | 54 | struct generic_pm_domain { |
49 | struct dev_pm_domain domain; /* PM domain operations */ | 55 | struct dev_pm_domain domain; /* PM domain operations */ |
50 | struct list_head gpd_list_node; /* Node in the global PM domains list */ | 56 | struct list_head gpd_list_node; /* Node in the global PM domains list */ |
@@ -75,6 +81,7 @@ struct generic_pm_domain { | |||
75 | bool max_off_time_changed; | 81 | bool max_off_time_changed; |
76 | bool cached_power_down_ok; | 82 | bool cached_power_down_ok; |
77 | struct device_node *of_node; /* Node in device tree */ | 83 | struct device_node *of_node; /* Node in device tree */ |
84 | struct gpd_cpu_data *cpu_data; | ||
78 | }; | 85 | }; |
79 | 86 | ||
80 | static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) | 87 | static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) |
@@ -105,6 +112,7 @@ struct generic_pm_domain_data { | |||
105 | struct gpd_timing_data td; | 112 | struct gpd_timing_data td; |
106 | struct notifier_block nb; | 113 | struct notifier_block nb; |
107 | struct mutex lock; | 114 | struct mutex lock; |
115 | unsigned int refcount; | ||
108 | bool need_restore; | 116 | bool need_restore; |
109 | bool always_on; | 117 | bool always_on; |
110 | }; | 118 | }; |
@@ -155,6 +163,8 @@ extern int pm_genpd_add_callbacks(struct device *dev, | |||
155 | struct gpd_dev_ops *ops, | 163 | struct gpd_dev_ops *ops, |
156 | struct gpd_timing_data *td); | 164 | struct gpd_timing_data *td); |
157 | extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); | 165 | extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); |
166 | extern int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state); | ||
167 | extern int genpd_detach_cpuidle(struct generic_pm_domain *genpd); | ||
158 | extern void pm_genpd_init(struct generic_pm_domain *genpd, | 168 | extern void pm_genpd_init(struct generic_pm_domain *genpd, |
159 | struct dev_power_governor *gov, bool is_off); | 169 | struct dev_power_governor *gov, bool is_off); |
160 | 170 | ||
@@ -211,6 +221,14 @@ static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td) | |||
211 | { | 221 | { |
212 | return -ENOSYS; | 222 | return -ENOSYS; |
213 | } | 223 | } |
224 | static inline int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st) | ||
225 | { | ||
226 | return -ENOSYS; | ||
227 | } | ||
228 | static inline int genpd_detach_cpuidle(struct generic_pm_domain *genpd) | ||
229 | { | ||
230 | return -ENOSYS; | ||
231 | } | ||
214 | static inline void pm_genpd_init(struct generic_pm_domain *genpd, | 232 | static inline void pm_genpd_init(struct generic_pm_domain *genpd, |
215 | struct dev_power_governor *gov, bool is_off) | 233 | struct dev_power_governor *gov, bool is_off) |
216 | { | 234 | { |