]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: tegra: hook tegra_tear_down_cpu function in the PM suspend init function
authorJoseph Lo <josephl@nvidia.com>
Tue, 4 Jun 2013 10:47:33 +0000 (18:47 +0800)
committerStephen Warren <swarren@nvidia.com>
Wed, 5 Jun 2013 17:44:54 +0000 (11:44 -0600)
The tegra_tear_down_cpu was used to cut off the CPU rail for various Tegra
SoCs. Hooking it in the PM suspend init function and making the CPUidle
driver more generic.

Signed-off-by: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
arch/arm/mach-tegra/cpuidle-tegra20.c
arch/arm/mach-tegra/cpuidle-tegra30.c
arch/arm/mach-tegra/pm.c

index 0cdba8de8c77b2f576a415648d762fff82fb81da..d6675130ee6217a2e7f8708f04dce1999fee55ef 100644 (file)
@@ -214,8 +214,5 @@ static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev,
 
 int __init tegra20_cpuidle_init(void)
 {
-#ifdef CONFIG_PM_SLEEP
-       tegra_tear_down_cpu = tegra20_tear_down_cpu;
-#endif
        return cpuidle_register(&tegra_idle_driver, cpu_possible_mask);
 }
index 3cf9aca5f3ea9de1266d11b67a1e7c4ae62a0ee8..9d9f554115e161fd2a70fc3cfd914cea3d7d66dc 100644 (file)
@@ -146,8 +146,5 @@ static int tegra30_idle_lp2(struct cpuidle_device *dev,
 
 int __init tegra30_cpuidle_init(void)
 {
-#ifdef CONFIG_PM_SLEEP
-       tegra_tear_down_cpu = tegra30_tear_down_cpu;
-#endif
        return cpuidle_register(&tegra_idle_driver, NULL);
 }
index 45cf52c7e528684f2400416298f161f9ffea4d34..5e6fb31ba4d933dd87a626ff3285d695975a8cd3 100644 (file)
 static DEFINE_SPINLOCK(tegra_lp2_lock);
 void (*tegra_tear_down_cpu)(void);
 
+static void tegra_tear_down_cpu_init(void)
+{
+       switch (tegra_chip_id) {
+       case TEGRA20:
+               if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC))
+                       tegra_tear_down_cpu = tegra20_tear_down_cpu;
+               break;
+       case TEGRA30:
+               if (IS_ENABLED(CONFIG_ARCH_TEGRA_3x_SOC))
+                       tegra_tear_down_cpu = tegra30_tear_down_cpu;
+               break;
+       }
+}
+
 /*
  * restore_cpu_complex
  *
@@ -224,6 +238,7 @@ void __init tegra_init_suspend(void)
        if (tegra_pmc_get_suspend_mode() == TEGRA_SUSPEND_NONE)
                return;
 
+       tegra_tear_down_cpu_init();
        tegra_pmc_suspend_init();
 
        suspend_set_ops(&tegra_suspend_ops);