aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pm_domain.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pm_domain.h')
-rw-r--r--include/linux/pm_domain.h92
1 files changed, 72 insertions, 20 deletions
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index a7d6172922d4..7c1d252b20c0 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -114,7 +114,6 @@ struct generic_pm_domain_data {
114 struct mutex lock; 114 struct mutex lock;
115 unsigned int refcount; 115 unsigned int refcount;
116 bool need_restore; 116 bool need_restore;
117 bool always_on;
118}; 117};
119 118
120#ifdef CONFIG_PM_GENERIC_DOMAINS 119#ifdef CONFIG_PM_GENERIC_DOMAINS
@@ -139,36 +138,32 @@ extern int __pm_genpd_of_add_device(struct device_node *genpd_node,
139 struct device *dev, 138 struct device *dev,
140 struct gpd_timing_data *td); 139 struct gpd_timing_data *td);
141 140
142static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, 141extern int __pm_genpd_name_add_device(const char *domain_name,
143 struct device *dev) 142 struct device *dev,
144{ 143 struct gpd_timing_data *td);
145 return __pm_genpd_add_device(genpd, dev, NULL);
146}
147
148static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
149 struct device *dev)
150{
151 return __pm_genpd_of_add_device(genpd_node, dev, NULL);
152}
153 144
154extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, 145extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
155 struct device *dev); 146 struct device *dev);
156extern void pm_genpd_dev_always_on(struct device *dev, bool val);
157extern void pm_genpd_dev_need_restore(struct device *dev, bool val); 147extern void pm_genpd_dev_need_restore(struct device *dev, bool val);
158extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, 148extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
159 struct generic_pm_domain *new_subdomain); 149 struct generic_pm_domain *new_subdomain);
150extern int pm_genpd_add_subdomain_names(const char *master_name,
151 const char *subdomain_name);
160extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, 152extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
161 struct generic_pm_domain *target); 153 struct generic_pm_domain *target);
162extern int pm_genpd_add_callbacks(struct device *dev, 154extern int pm_genpd_add_callbacks(struct device *dev,
163 struct gpd_dev_ops *ops, 155 struct gpd_dev_ops *ops,
164 struct gpd_timing_data *td); 156 struct gpd_timing_data *td);
165extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); 157extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td);
166extern int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state); 158extern int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state);
167extern int genpd_detach_cpuidle(struct generic_pm_domain *genpd); 159extern int pm_genpd_name_attach_cpuidle(const char *name, int state);
160extern int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd);
161extern int pm_genpd_name_detach_cpuidle(const char *name);
168extern void pm_genpd_init(struct generic_pm_domain *genpd, 162extern void pm_genpd_init(struct generic_pm_domain *genpd,
169 struct dev_power_governor *gov, bool is_off); 163 struct dev_power_governor *gov, bool is_off);
170 164
171extern int pm_genpd_poweron(struct generic_pm_domain *genpd); 165extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
166extern int pm_genpd_name_poweron(const char *domain_name);
172 167
173extern bool default_stop_ok(struct device *dev); 168extern bool default_stop_ok(struct device *dev);
174 169
@@ -189,8 +184,15 @@ static inline int __pm_genpd_add_device(struct generic_pm_domain *genpd,
189{ 184{
190 return -ENOSYS; 185 return -ENOSYS;
191} 186}
192static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, 187static inline int __pm_genpd_of_add_device(struct device_node *genpd_node,
193 struct device *dev) 188 struct device *dev,
189 struct gpd_timing_data *td)
190{
191 return -ENOSYS;
192}
193static inline int __pm_genpd_name_add_device(const char *domain_name,
194 struct device *dev,
195 struct gpd_timing_data *td)
194{ 196{
195 return -ENOSYS; 197 return -ENOSYS;
196} 198}
@@ -199,13 +201,17 @@ static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd,
199{ 201{
200 return -ENOSYS; 202 return -ENOSYS;
201} 203}
202static inline void pm_genpd_dev_always_on(struct device *dev, bool val) {}
203static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {} 204static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {}
204static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, 205static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
205 struct generic_pm_domain *new_sd) 206 struct generic_pm_domain *new_sd)
206{ 207{
207 return -ENOSYS; 208 return -ENOSYS;
208} 209}
210static inline int pm_genpd_add_subdomain_names(const char *master_name,
211 const char *subdomain_name)
212{
213 return -ENOSYS;
214}
209static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, 215static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
210 struct generic_pm_domain *target) 216 struct generic_pm_domain *target)
211{ 217{
@@ -221,11 +227,19 @@ static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td)
221{ 227{
222 return -ENOSYS; 228 return -ENOSYS;
223} 229}
224static inline int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st) 230static inline int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st)
225{ 231{
226 return -ENOSYS; 232 return -ENOSYS;
227} 233}
228static inline int genpd_detach_cpuidle(struct generic_pm_domain *genpd) 234static inline int pm_genpd_name_attach_cpuidle(const char *name, int state)
235{
236 return -ENOSYS;
237}
238static inline int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd)
239{
240 return -ENOSYS;
241}
242static inline int pm_genpd_name_detach_cpuidle(const char *name)
229{ 243{
230 return -ENOSYS; 244 return -ENOSYS;
231} 245}
@@ -237,6 +251,10 @@ static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
237{ 251{
238 return -ENOSYS; 252 return -ENOSYS;
239} 253}
254static inline int pm_genpd_name_poweron(const char *domain_name)
255{
256 return -ENOSYS;
257}
240static inline bool default_stop_ok(struct device *dev) 258static inline bool default_stop_ok(struct device *dev)
241{ 259{
242 return false; 260 return false;
@@ -245,6 +263,24 @@ static inline bool default_stop_ok(struct device *dev)
245#define pm_domain_always_on_gov NULL 263#define pm_domain_always_on_gov NULL
246#endif 264#endif
247 265
266static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
267 struct device *dev)
268{
269 return __pm_genpd_add_device(genpd, dev, NULL);
270}
271
272static inline int pm_genpd_of_add_device(struct device_node *genpd_node,
273 struct device *dev)
274{
275 return __pm_genpd_of_add_device(genpd_node, dev, NULL);
276}
277
278static inline int pm_genpd_name_add_device(const char *domain_name,
279 struct device *dev)
280{
281 return __pm_genpd_name_add_device(domain_name, dev, NULL);
282}
283
248static inline int pm_genpd_remove_callbacks(struct device *dev) 284static inline int pm_genpd_remove_callbacks(struct device *dev)
249{ 285{
250 return __pm_genpd_remove_callbacks(dev, true); 286 return __pm_genpd_remove_callbacks(dev, true);
@@ -258,4 +294,20 @@ static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {}
258static inline void pm_genpd_poweroff_unused(void) {} 294static inline void pm_genpd_poweroff_unused(void) {}
259#endif 295#endif
260 296
297#ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP
298extern void pm_genpd_syscore_switch(struct device *dev, bool suspend);
299#else
300static inline void pm_genpd_syscore_switch(struct device *dev, bool suspend) {}
301#endif
302
303static inline void pm_genpd_syscore_poweroff(struct device *dev)
304{
305 pm_genpd_syscore_switch(dev, true);
306}
307
308static inline void pm_genpd_syscore_poweron(struct device *dev)
309{
310 pm_genpd_syscore_switch(dev, false);
311}
312
261#endif /* _LINUX_PM_DOMAIN_H */ 313#endif /* _LINUX_PM_DOMAIN_H */