diff options
author | Jin Qian <jqian@nvidia.com> | 2011-08-31 19:47:26 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:48:51 -0800 |
commit | 514c27412c673913e7555368ef2ddec82737ebd5 (patch) | |
tree | 63eacb06f637d1e0a72ef2d9efcd3821bf004962 /arch/arm/mach-tegra/pm.c | |
parent | 901b511b10fd59f06471705be3e6bffea723af46 (diff) |
ARM: tegra: power: move cluster switch to syscore for LP0
move printk as well since they rely on uart resume in syscore
Bug 862504
Change-Id: Iad62c87dbb01d07bf731babb62cb480d62b9402e
Reviewed-on: http://git-master/r/50240
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: R8c5b23f5045260160a4906da425cc297fae5b59b
Diffstat (limited to 'arch/arm/mach-tegra/pm.c')
-rw-r--r-- | arch/arm/mach-tegra/pm.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c index b5fe018290d9..0a4de1a68b5c 100644 --- a/arch/arm/mach-tegra/pm.c +++ b/arch/arm/mach-tegra/pm.c @@ -759,8 +759,6 @@ int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags) tegra_common_suspend(); - pr_info("Entering suspend state %s\n", lp_state[mode]); - tegra_pm_set(mode); if (pdata && pdata->board_suspend) @@ -772,7 +770,6 @@ int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags) cpu_complex_pm_enter(); if (mode == TEGRA_SUSPEND_LP0) { - tegra_lp0_cpu_mode(true); tegra_lp0_suspend_mc(); tegra_cpu_reset_handler_save(); } @@ -796,7 +793,6 @@ int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags) if (mode == TEGRA_SUSPEND_LP0) { tegra_cpu_reset_handler_restore(); tegra_lp0_resume_mc(); - tegra_lp0_cpu_mode(false); } else if (mode == TEGRA_SUSPEND_LP1) *iram_cpu_lp1_mask = 0; @@ -812,8 +808,6 @@ int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags) tegra_common_resume(); - pr_info("Exited suspend state %s\n", lp_state[mode]); - return 0; } @@ -891,6 +885,33 @@ static struct kobj_attribute suspend_mode_attribute = static struct kobject *suspend_kobj; #endif +static int tegra_pm_enter_suspend(void) +{ + pr_info("Entering suspend state %s\n", lp_state[current_suspend_mode]); + if (current_suspend_mode == TEGRA_SUSPEND_LP0) + tegra_lp0_cpu_mode(true); + return 0; +} + +static void tegra_pm_enter_resume(void) +{ + if (current_suspend_mode == TEGRA_SUSPEND_LP0) + tegra_lp0_cpu_mode(false); + pr_info("Exited suspend state %s\n", lp_state[current_suspend_mode]); +} + +static struct syscore_ops tegra_pm_enter_syscore_ops = { + .suspend = tegra_pm_enter_suspend, + .resume = tegra_pm_enter_resume, +}; + +static __init int tegra_pm_enter_syscore_init(void) +{ + register_syscore_ops(&tegra_pm_enter_syscore_ops); + return 0; +} +subsys_initcall(tegra_pm_enter_syscore_init); + void __init tegra_init_suspend(struct tegra_suspend_platform_data *plat) { u32 reg; |