ARM: tegra: power: move cluster switch prolog/epilog from suspend
Jin Qian [Wed, 31 Aug 2011 00:23:55 +0000 (17:23 -0700)]
They're called only when doing cluster switch so move them to
cluster control function.

Change-Id: Ic258dd06ab454aa5eb96673665607b373284a43c
Reviewed-on: http://git-master/r/49952
Reviewed-by: Jin Qian <jqian@nvidia.com>
Tested-by: Jin Qian <jqian@nvidia.com>
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>

Rebase-Id: R1b68449702767a8555fff82b5fb8c88e1acbe363

arch/arm/mach-tegra/pm-t3.c
arch/arm/mach-tegra/pm.c

index 8cd3901..8325fb9 100644 (file)
@@ -329,7 +329,9 @@ int tegra_cluster_control(unsigned int us, unsigned int flags)
                if (us)
                        tegra_lp2_set_trigger(us);
 
+               tegra_cluster_switch_prolog(flags);
                tegra_suspend_dram(TEGRA_SUSPEND_LP1, flags);
+               tegra_cluster_switch_epilog(flags);
 
                if (us)
                        tegra_lp2_set_trigger(0);
index 9e6c9a8..57fcf55 100644 (file)
@@ -764,9 +764,6 @@ 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);
 
@@ -816,9 +813,6 @@ 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;