diff options
author | Mayuresh Kulkarni <mkulkarni@nvidia.com> | 2012-02-24 19:35:36 +0530 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-04-05 09:10:50 -0700 |
commit | 2ed508c4809ae7d24c164edde3ddc44b02d41285 (patch) | |
tree | 986da8d2ab9b2e24dc2106fdb6fd7edf7420d4ba /arch/arm/mach-tegra/pm.c | |
parent | ab1f075e4c6afff574f3626be08f32ca51cc4a98 (diff) |
arm: tegra: turn off pll-a/p in LP1
- current code does not turn off pll-a/p in LP1
irrespective of voice call status
- add a new flag to indicate voice call on-going
- use PMC_SCRATCH37 to hold this flag
- if it is set, do not turn-off pll-a/p during LP1
- save-restore PMC_SCRATCH37 if it was used to hold the
voice call on-going flag
- fix few misc formatting issues in tegra3_cpu_clk32k
Bug 924817
Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-on: http://git-master/r/85768
(cherry picked from commit 7853981c987ae329620bb54d869016cb74a6c054)
Change-Id: Id5348d2eb44a4bacaf00f6d17edceedaef819e29
Reviewed-on: http://git-master/r/94395
Tested-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/pm.c')
-rw-r--r-- | arch/arm/mach-tegra/pm.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c index 40bd28aea0ad..2194b6daf710 100644 --- a/arch/arm/mach-tegra/pm.c +++ b/arch/arm/mach-tegra/pm.c @@ -43,6 +43,7 @@ #include <linux/memblock.h> #include <linux/console.h> #include <linux/pm_qos_params.h> +#include <linux/tegra_audio.h> #include <asm/cacheflush.h> #include <asm/cpu_pm.h> @@ -837,6 +838,7 @@ static void tegra_suspend_check_pwr_stats(void) int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags) { int err = 0; + u32 scratch37 = 0xDEADBEEF; if (WARN_ON(mode <= TEGRA_SUSPEND_NONE || mode >= TEGRA_MAX_SUSPEND_MODE)) { @@ -844,6 +846,17 @@ int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags) goto fail; } + if (tegra_is_voice_call_active()) { + u32 reg; + + /* backup the current value of scratch37 */ + scratch37 = readl(pmc + PMC_SCRATCH37); + + /* If voice call is active, set a flag in PMC_SCRATCH37 */ + reg = TEGRA_POWER_LP1_AUDIO; + pmc_32kwritel(reg, PMC_SCRATCH37); + } + if ((mode == TEGRA_SUSPEND_LP0) && !tegra_pm_irq_lp0_allowed()) { pr_info("LP0 not used due to unsupported wakeup events\n"); mode = TEGRA_SUSPEND_LP1; @@ -899,6 +912,10 @@ int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags) } else if (mode == TEGRA_SUSPEND_LP1) *iram_cpu_lp1_mask = 0; + /* if scratch37 was clobbered during LP1, restore it */ + if (scratch37 != 0xDEADBEEF) + pmc_32kwritel(scratch37, PMC_SCRATCH37); + restore_cpu_complex(flags); /* for platforms where the core & CPU power requests are |