summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/suspend.c
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2010-06-09 19:33:57 -0700
committerGary King <gking@nvidia.com>2010-07-02 07:15:44 -0700
commita3562cf11c826bc29e3f76ec6c31fa8376e88524 (patch)
treed4753cbb2c33bfd9feed26ec2dd3e05102956404 /arch/arm/mach-tegra/suspend.c
parent3835a7b2eb6d95033c84c03d97c83958c491df59 (diff)
[ARM/tegra] ODM: Resequenced USB_AVDD power control.
Attached USB_AVDD rail to PMU power enable input on entry to LP0, so that it is guaranteed to be turned On in h/w before bootrom code starts. Restored default USB_AVDD control configuration on LP0 exit, and keep it enabled until USB driver takes over. Since the USB_AVDD re-configuration must happen after USB driver suspend during LP0 entry, and before USB driver resume during LP0 exit, moved RM PMU-related operations from pm notifier callbacks to platform .prepare method (called after all drivers are suspended, but before irqs are disabled), and its .finish counterpart. Bug 702919 Bug 691042 Change-Id: I98d48ae15e960f41dd441fe3c38337ac04649a5e Reviewed-on: http://git-master.nvidia.com/r/2365 Tested-by: Aleksandr Frid <afrid@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/suspend.c')
-rw-r--r--arch/arm/mach-tegra/suspend.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/suspend.c b/arch/arm/mach-tegra/suspend.c
index 240ab30b1793..d40386313d01 100644
--- a/arch/arm/mach-tegra/suspend.c
+++ b/arch/arm/mach-tegra/suspend.c
@@ -414,6 +414,28 @@ static void tegra_suspend_dram(bool lp0_ok)
wmb();
}
+static int tegra_suspend_prepare(void)
+{
+#ifdef CONFIG_TEGRA_NVRM
+ NvOdmSocPowerState state =
+ NvOdmQueryLowestSocPowerState()->LowestPowerState;
+
+ NvRmPrivDfsSuspend(state);
+ NvRmPrivPmuLPxStateConfig(s_hRmGlobal, state, NV_TRUE);
+#endif
+ return 0;
+}
+
+static void tegra_suspend_finish(void)
+{
+#ifdef CONFIG_TEGRA_NVRM
+ NvOdmSocPowerState state =
+ NvOdmQueryLowestSocPowerState()->LowestPowerState;
+
+ NvRmPrivPmuLPxStateConfig(s_hRmGlobal, state, NV_FALSE);
+#endif
+}
+
static int tegra_suspend_prepare_late(void)
{
#ifdef CONFIG_TEGRA_NVRM
@@ -610,6 +632,8 @@ static int tegra_suspend_enter(suspend_state_t state)
static struct platform_suspend_ops tegra_suspend_ops = {
.valid = suspend_valid_only_mem,
+ .prepare = tegra_suspend_prepare,
+ .finish = tegra_suspend_finish,
.prepare_late = tegra_suspend_prepare_late,
.wake = tegra_suspend_wake,
.enter = tegra_suspend_enter,