summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos/cpuidle.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2014-05-08 23:43:27 +0200
committerKukjin Kim <kgene.kim@samsung.com>2014-05-25 22:21:07 +0200
commit85f9f90808b4437bbdff1dff2c80663dae57ab51 (patch)
treea67595bc1ea34fbdb942a7b5d04a13d0e9f6ab4b /arch/arm/mach-exynos/cpuidle.c
parentARM: EXYNOS: Fix S5P_WAKEUP_STAT call for cpuidle (diff)
downloadlinux-85f9f90808b4437bbdff1dff2c80663dae57ab51.tar.xz
linux-85f9f90808b4437bbdff1dff2c80663dae57ab51.zip
ARM: EXYNOS: Use the cpu_pm notifier for pm
Use the cpu_pm_enter/exit notifier to group some pm code inside the pm file. The save and restore code is duplicated across pm.c and cpuidle.c. By using the cpu_pm notifier, we can factor out the routine. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-exynos/cpuidle.c')
-rw-r--r--arch/arm/mach-exynos/cpuidle.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c
index 87f9f129883d..7a2d01bbef6b 100644
--- a/arch/arm/mach-exynos/cpuidle.c
+++ b/arch/arm/mach-exynos/cpuidle.c
@@ -47,26 +47,6 @@ static void exynos_set_wakeupmask(void)
__raw_writel(0x0000ff3e, S5P_WAKEUP_MASK);
}
-static unsigned int g_pwr_ctrl, g_diag_reg;
-
-static void save_cpu_arch_register(void)
-{
- /*read power control register*/
- asm("mrc p15, 0, %0, c15, c0, 0" : "=r"(g_pwr_ctrl) : : "cc");
- /*read diagnostic register*/
- asm("mrc p15, 0, %0, c15, c0, 1" : "=r"(g_diag_reg) : : "cc");
- return;
-}
-
-static void restore_cpu_arch_register(void)
-{
- /*write power control register*/
- asm("mcr p15, 0, %0, c15, c0, 0" : : "r"(g_pwr_ctrl) : "cc");
- /*write diagnostic register*/
- asm("mcr p15, 0, %0, c15, c0, 1" : : "r"(g_diag_reg) : "cc");
- return;
-}
-
static int idle_finisher(unsigned long flags)
{
exynos_set_wakeupmask();
@@ -88,8 +68,6 @@ static int exynos_enter_core0_aftr(struct cpuidle_device *dev,
{
unsigned long tmp;
- save_cpu_arch_register();
-
/* Setting Central Sequence Register for power down mode */
tmp = __raw_readl(S5P_CENTRAL_SEQ_CONFIGURATION);
tmp &= ~S5P_CENTRAL_LOWPWR_CFG;
@@ -104,8 +82,6 @@ static int exynos_enter_core0_aftr(struct cpuidle_device *dev,
#endif
cpu_pm_exit();
- restore_cpu_arch_register();
-
/*
* If PMU failed while entering sleep mode, WFI will be
* ignored by PMU and then exiting cpu_do_idle().