diff options
Diffstat (limited to 'include/linux/pm_domain.h')
| -rw-r--r-- | include/linux/pm_domain.h | 92 |
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 | ||
| 142 | static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, | 141 | extern 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 | |||
| 148 | static 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 | ||
| 154 | extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, | 145 | extern int pm_genpd_remove_device(struct generic_pm_domain *genpd, |
| 155 | struct device *dev); | 146 | struct device *dev); |
| 156 | extern void pm_genpd_dev_always_on(struct device *dev, bool val); | ||
| 157 | extern void pm_genpd_dev_need_restore(struct device *dev, bool val); | 147 | extern void pm_genpd_dev_need_restore(struct device *dev, bool val); |
| 158 | extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, | 148 | extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, |
| 159 | struct generic_pm_domain *new_subdomain); | 149 | struct generic_pm_domain *new_subdomain); |
| 150 | extern int pm_genpd_add_subdomain_names(const char *master_name, | ||
| 151 | const char *subdomain_name); | ||
| 160 | extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, | 152 | extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, |
| 161 | struct generic_pm_domain *target); | 153 | struct generic_pm_domain *target); |
| 162 | extern int pm_genpd_add_callbacks(struct device *dev, | 154 | extern 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); |
| 165 | extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); | 157 | 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); | 158 | extern int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state); |
| 167 | extern int genpd_detach_cpuidle(struct generic_pm_domain *genpd); | 159 | extern int pm_genpd_name_attach_cpuidle(const char *name, int state); |
| 160 | extern int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd); | ||
| 161 | extern int pm_genpd_name_detach_cpuidle(const char *name); | ||
| 168 | extern void pm_genpd_init(struct generic_pm_domain *genpd, | 162 | extern 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 | ||
| 171 | extern int pm_genpd_poweron(struct generic_pm_domain *genpd); | 165 | extern int pm_genpd_poweron(struct generic_pm_domain *genpd); |
| 166 | extern int pm_genpd_name_poweron(const char *domain_name); | ||
| 172 | 167 | ||
| 173 | extern bool default_stop_ok(struct device *dev); | 168 | extern 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 | } |
| 192 | static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, | 187 | static 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 | } | ||
| 193 | static 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 | } |
| 202 | static inline void pm_genpd_dev_always_on(struct device *dev, bool val) {} | ||
| 203 | static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {} | 204 | static inline void pm_genpd_dev_need_restore(struct device *dev, bool val) {} |
| 204 | static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd, | 205 | static 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 | } |
| 210 | static inline int pm_genpd_add_subdomain_names(const char *master_name, | ||
| 211 | const char *subdomain_name) | ||
| 212 | { | ||
| 213 | return -ENOSYS; | ||
| 214 | } | ||
| 209 | static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, | 215 | static 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 | } |
| 224 | static inline int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st) | 230 | static inline int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st) |
| 225 | { | 231 | { |
| 226 | return -ENOSYS; | 232 | return -ENOSYS; |
| 227 | } | 233 | } |
| 228 | static inline int genpd_detach_cpuidle(struct generic_pm_domain *genpd) | 234 | static inline int pm_genpd_name_attach_cpuidle(const char *name, int state) |
| 235 | { | ||
| 236 | return -ENOSYS; | ||
| 237 | } | ||
| 238 | static inline int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd) | ||
| 239 | { | ||
| 240 | return -ENOSYS; | ||
| 241 | } | ||
| 242 | static 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 | } |
| 254 | static inline int pm_genpd_name_poweron(const char *domain_name) | ||
| 255 | { | ||
| 256 | return -ENOSYS; | ||
| 257 | } | ||
| 240 | static inline bool default_stop_ok(struct device *dev) | 258 | static 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 | ||
| 266 | static 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 | |||
| 272 | static 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 | |||
| 278 | static 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 | |||
| 248 | static inline int pm_genpd_remove_callbacks(struct device *dev) | 284 | static 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) {} | |||
| 258 | static inline void pm_genpd_poweroff_unused(void) {} | 294 | static inline void pm_genpd_poweroff_unused(void) {} |
| 259 | #endif | 295 | #endif |
| 260 | 296 | ||
| 297 | #ifdef CONFIG_PM_GENERIC_DOMAINS_SLEEP | ||
| 298 | extern void pm_genpd_syscore_switch(struct device *dev, bool suspend); | ||
| 299 | #else | ||
| 300 | static inline void pm_genpd_syscore_switch(struct device *dev, bool suspend) {} | ||
| 301 | #endif | ||
| 302 | |||
| 303 | static inline void pm_genpd_syscore_poweroff(struct device *dev) | ||
| 304 | { | ||
| 305 | pm_genpd_syscore_switch(dev, true); | ||
| 306 | } | ||
| 307 | |||
| 308 | static 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 */ |
