ARM: tegra: power: Call cluster_switch_prolog/epilog for LP1
Yudong Tan [Thu, 18 Aug 2011 22:29:08 +0000 (15:29 -0700)]
cluster_switch_prolog is needed to set up car/flow controller registers
for LP1 entry. epilog is needed to clean up some flags in flow controller
after LP1 exit.

Bug 862502

Change-Id: Ib9eeac6fc541cfa644d782071dbd4187255404d8
Reviewed-on: http://git-master/r/47585
Reviewed-by: Daniel Willemsen <dwillemsen@nvidia.com>
Tested-by: Daniel Willemsen <dwillemsen@nvidia.com>

Rebase-Id: R2c72673ba1b7f04ffa1b760ff54aaf73cf23f09e

arch/arm/mach-tegra/pm.c

index e81dae1..06ce359 100644 (file)
@@ -764,6 +764,9 @@ int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags)
 
        tegra_pm_set(mode);
 
+       if (flags & TEGRA_POWER_CLUSTER_MASK)
+               tegra_cluster_switch_prolog(flags);
+
        if (pdata && pdata->board_suspend)
                pdata->board_suspend(mode, TEGRA_SUSPEND_BEFORE_CPU);
 
@@ -811,6 +814,9 @@ int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags)
 
        tegra_common_resume();
 
+       if (flags & TEGRA_POWER_CLUSTER_MASK)
+               tegra_cluster_switch_epilog(mode);
+
        pr_info("Exited suspend state %s\n", lp_state[mode]);
 
        return 0;