Commit bf91add4 authored by Joseph Lo's avatar Joseph Lo Committed by Stephen Warren

ARM: tegra: hook tegra_tear_down_cpu function in the PM suspend init function

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: default avatarJoseph Lo <josephl@nvidia.com>
Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
parent e22dc2b2
...@@ -214,8 +214,5 @@ static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev, ...@@ -214,8 +214,5 @@ static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev,
int __init tegra20_cpuidle_init(void) 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); return cpuidle_register(&tegra_idle_driver, cpu_possible_mask);
} }
...@@ -146,8 +146,5 @@ static int tegra30_idle_lp2(struct cpuidle_device *dev, ...@@ -146,8 +146,5 @@ static int tegra30_idle_lp2(struct cpuidle_device *dev,
int __init tegra30_cpuidle_init(void) 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); return cpuidle_register(&tegra_idle_driver, NULL);
} }
...@@ -44,6 +44,20 @@ ...@@ -44,6 +44,20 @@
static DEFINE_SPINLOCK(tegra_lp2_lock); static DEFINE_SPINLOCK(tegra_lp2_lock);
void (*tegra_tear_down_cpu)(void); 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 * restore_cpu_complex
* *
...@@ -224,6 +238,7 @@ void __init tegra_init_suspend(void) ...@@ -224,6 +238,7 @@ void __init tegra_init_suspend(void)
if (tegra_pmc_get_suspend_mode() == TEGRA_SUSPEND_NONE) if (tegra_pmc_get_suspend_mode() == TEGRA_SUSPEND_NONE)
return; return;
tegra_tear_down_cpu_init();
tegra_pmc_suspend_init(); tegra_pmc_suspend_init();
suspend_set_ops(&tegra_suspend_ops); suspend_set_ops(&tegra_suspend_ops);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment