diff options
Diffstat (limited to 'kernel/cpu_pm.c')
| -rw-r--r-- | kernel/cpu_pm.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/kernel/cpu_pm.c b/kernel/cpu_pm.c index 4d1ff4acd04b..249152e15308 100644 --- a/kernel/cpu_pm.c +++ b/kernel/cpu_pm.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
| 21 | #include <linux/notifier.h> | 21 | #include <linux/notifier.h> |
| 22 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
| 23 | #include <linux/syscore_ops.h> | ||
| 23 | 24 | ||
| 24 | static DEFINE_RWLOCK(cpu_pm_notifier_lock); | 25 | static DEFINE_RWLOCK(cpu_pm_notifier_lock); |
| 25 | static RAW_NOTIFIER_HEAD(cpu_pm_notifier_chain); | 26 | static RAW_NOTIFIER_HEAD(cpu_pm_notifier_chain); |
| @@ -198,3 +199,35 @@ int cpu_cluster_pm_exit(void) | |||
| 198 | return ret; | 199 | return ret; |
| 199 | } | 200 | } |
| 200 | EXPORT_SYMBOL_GPL(cpu_cluster_pm_exit); | 201 | EXPORT_SYMBOL_GPL(cpu_cluster_pm_exit); |
| 202 | |||
| 203 | #ifdef CONFIG_PM | ||
| 204 | static int cpu_pm_suspend(void) | ||
| 205 | { | ||
| 206 | int ret; | ||
| 207 | |||
| 208 | ret = cpu_pm_enter(); | ||
| 209 | if (ret) | ||
| 210 | return ret; | ||
| 211 | |||
| 212 | ret = cpu_cluster_pm_enter(); | ||
| 213 | return ret; | ||
| 214 | } | ||
| 215 | |||
| 216 | static void cpu_pm_resume(void) | ||
| 217 | { | ||
| 218 | cpu_cluster_pm_exit(); | ||
| 219 | cpu_pm_exit(); | ||
| 220 | } | ||
| 221 | |||
| 222 | static struct syscore_ops cpu_pm_syscore_ops = { | ||
| 223 | .suspend = cpu_pm_suspend, | ||
| 224 | .resume = cpu_pm_resume, | ||
| 225 | }; | ||
| 226 | |||
| 227 | static int cpu_pm_init(void) | ||
| 228 | { | ||
| 229 | register_syscore_ops(&cpu_pm_syscore_ops); | ||
| 230 | return 0; | ||
| 231 | } | ||
| 232 | core_initcall(cpu_pm_init); | ||
| 233 | #endif | ||
