Merge tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-tegra / pm.c
index 523604de666f6f6369330fabadbedb2b05750cf9..891fb70d0aa7f8a05bf65f3f3606790c70010ab6 100644 (file)
 #define PMC_CPUPWROFF_TIMER    0xcc
 
 #ifdef CONFIG_PM_SLEEP
-static unsigned int g_diag_reg;
 static DEFINE_SPINLOCK(tegra_lp2_lock);
 static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
 static struct clk *tegra_pclk;
 void (*tegra_tear_down_cpu)(void);
 
-void save_cpu_arch_register(void)
-{
-       /* read diagnostic register */
-       asm("mrc p15, 0, %0, c15, c0, 1" : "=r"(g_diag_reg) : : "cc");
-       return;
-}
-
-void restore_cpu_arch_register(void)
-{
-       /* write diagnostic register */
-       asm("mcr p15, 0, %0, c15, c0, 1" : : "r"(g_diag_reg) : "cc");
-       return;
-}
-
 static void set_power_timers(unsigned long us_on, unsigned long us_off)
 {
        unsigned long long ticks;
@@ -119,8 +104,6 @@ static void restore_cpu_complex(void)
        tegra_cpu_clock_resume();
 
        flowctrl_cpu_suspend_exit(cpu);
-
-       restore_cpu_arch_register();
 }
 
 /*
@@ -145,8 +128,6 @@ static void suspend_cpu_complex(void)
        tegra_cpu_clock_suspend();
 
        flowctrl_cpu_suspend_enter(cpu);
-
-       save_cpu_arch_register();
 }
 
 void tegra_clear_cpu_in_lp2(int phy_cpu_id)
@@ -181,14 +162,14 @@ bool tegra_set_cpu_in_lp2(int phy_cpu_id)
        return last_cpu;
 }
 
-static int tegra_sleep_cpu(unsigned long v2p)
+int tegra_cpu_do_idle(void)
 {
-       /* Switch to the identity mapping. */
-       cpu_switch_mm(idmap_pgd, &init_mm);
-
-       /* Flush the TLB. */
-       local_flush_tlb_all();
+       return cpu_do_idle();
+}
 
+static int tegra_sleep_cpu(unsigned long v2p)
+{
+       setup_mm_for_reboot();
        tegra_sleep_cpu_finish(v2p);
 
        /* should never here */