summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/pm.c
diff options
context:
space:
mode:
authorPrashant Gaikwad <pgaikwad@nvidia.com>2013-10-22 11:59:08 +0530
committerBharat Nihalani <bnihalani@nvidia.com>2013-11-04 16:55:00 -0800
commit189d7256f9ced370334a0dd000ba6aab41cea166 (patch)
treef34d92edd2b04a766fc35208a4c6980ba1817a89 /arch/arm/mach-tegra/pm.c
parent0307508aefb53d21c10c27abf9fbf3d2b894bde3 (diff)
arm: tegra: add function to enter LP0 from cpuidle
Bug 1254633 Change-Id: I8c69d238877615a594bed6542462873f897e0ad4 Signed-off-by: Prashant Gaikwad <pgaikwad@nvidia.com> Reviewed-on: http://git-master/r/309496 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/pm.c')
-rw-r--r--arch/arm/mach-tegra/pm.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c
index eaf0cbb337df..21978406812c 100644
--- a/arch/arm/mach-tegra/pm.c
+++ b/arch/arm/mach-tegra/pm.c
@@ -69,6 +69,8 @@
#include <asm/rodata.h>
#include <mach/irqs.h>
+#include <mach/tegra_smmu.h>
+#include <mach/pm_domains.h>
#include "board.h"
#include "clock.h"
@@ -1263,6 +1265,46 @@ static void tegra_suspend_powergate_control(int partid, bool turn_off)
tegra_unpowergate_partition(partid);
}
+#ifdef CONFIG_TEGRA_LP0_IN_IDLE
+int tegra_enter_lp0(unsigned long sleep_time)
+{
+ int err = 0;
+
+ /* This state is managed by power domains, hence no voice call expected if
+ * we are entering this state */
+
+ tegra_rtc_set_trigger(sleep_time);
+
+ tegra_actmon_save();
+
+ tegra_dma_save();
+
+ tegra_smmu_save();
+
+ err = syscore_save();
+ if (err) {
+ tegra_smmu_restore();
+ tegra_dma_restore();
+ tegra_rtc_set_trigger(0);
+ return err;
+ }
+
+ tegra_suspend_dram(TEGRA_SUSPEND_LP0, 0);
+
+ syscore_restore();
+
+ tegra_smmu_restore();
+
+ tegra_dma_restore();
+
+ tegra_actmon_restore();
+
+ tegra_rtc_set_trigger(0);
+
+ return 0;
+}
+#endif
+
int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags)
{
int err = 0;