aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/vfp/vfpmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/vfp/vfpmodule.c')
-rw-r--r--arch/arm/vfp/vfpmodule.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 79bcb4316930..0cbd5a0a9332 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -11,6 +11,7 @@
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/cpu.h> 13#include <linux/cpu.h>
14#include <linux/cpu_pm.h>
14#include <linux/kernel.h> 15#include <linux/kernel.h>
15#include <linux/notifier.h> 16#include <linux/notifier.h>
16#include <linux/signal.h> 17#include <linux/signal.h>
@@ -68,7 +69,7 @@ static bool vfp_state_in_hw(unsigned int cpu, struct thread_info *thread)
68/* 69/*
69 * Force a reload of the VFP context from the thread structure. We do 70 * Force a reload of the VFP context from the thread structure. We do
70 * this by ensuring that access to the VFP hardware is disabled, and 71 * this by ensuring that access to the VFP hardware is disabled, and
71 * clear last_VFP_context. Must be called from non-preemptible context. 72 * clear vfp_current_hw_state. Must be called from non-preemptible context.
72 */ 73 */
73static void vfp_force_reload(unsigned int cpu, struct thread_info *thread) 74static void vfp_force_reload(unsigned int cpu, struct thread_info *thread)
74{ 75{
@@ -436,9 +437,7 @@ static void vfp_enable(void *unused)
436 set_copro_access(access | CPACC_FULL(10) | CPACC_FULL(11)); 437 set_copro_access(access | CPACC_FULL(10) | CPACC_FULL(11));
437} 438}
438 439
439#ifdef CONFIG_PM 440#ifdef CONFIG_CPU_PM
440#include <linux/syscore_ops.h>
441
442static int vfp_pm_suspend(void) 441static int vfp_pm_suspend(void)
443{ 442{
444 struct thread_info *ti = current_thread_info(); 443 struct thread_info *ti = current_thread_info();
@@ -468,19 +467,33 @@ static void vfp_pm_resume(void)
468 fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN); 467 fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
469} 468}
470 469
471static struct syscore_ops vfp_pm_syscore_ops = { 470static int vfp_cpu_pm_notifier(struct notifier_block *self, unsigned long cmd,
472 .suspend = vfp_pm_suspend, 471 void *v)
473 .resume = vfp_pm_resume, 472{
473 switch (cmd) {
474 case CPU_PM_ENTER:
475 vfp_pm_suspend();
476 break;
477 case CPU_PM_ENTER_FAILED:
478 case CPU_PM_EXIT:
479 vfp_pm_resume();
480 break;
481 }
482 return NOTIFY_OK;
483}
484
485static struct notifier_block vfp_cpu_pm_notifier_block = {
486 .notifier_call = vfp_cpu_pm_notifier,
474}; 487};
475 488
476static void vfp_pm_init(void) 489static void vfp_pm_init(void)
477{ 490{
478 register_syscore_ops(&vfp_pm_syscore_ops); 491 cpu_pm_register_notifier(&vfp_cpu_pm_notifier_block);
479} 492}
480 493
481#else 494#else
482static inline void vfp_pm_init(void) { } 495static inline void vfp_pm_init(void) { }
483#endif /* CONFIG_PM */ 496#endif /* CONFIG_CPU_PM */
484 497
485/* 498/*
486 * Ensure that the VFP state stored in 'thread->vfpstate' is up to date 499 * Ensure that the VFP state stored in 'thread->vfpstate' is up to date