summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-harmony-power.c
diff options
context:
space:
mode:
authorBill Huang <bilhuang@nvidia.com>2011-12-15 02:42:15 -0800
committerVarun Wadekar <vwadekar@nvidia.com>2011-12-22 11:29:32 +0530
commit5a6654837203ad75c679169d89ed55fa7a83c148 (patch)
tree160b296d759ea125eac0208bbf6a6848aa011c4b /arch/arm/mach-tegra/board-harmony-power.c
parente744c3588e7a09c8ec80e28efffd6f08c1c2b2b8 (diff)
arm: tegra: harmony: add suspend support for harmony
enable suspend for harmony and set suspend mode to lp0 bug 911107 Change-Id: I59d412ab991fa86fedac12f0981bf93e26f8810a Signed-off-by: Bill Huang <bilhuang@nvidia.com> Reviewed-on: http://git-master/r/70270 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/board-harmony-power.c')
-rw-r--r--arch/arm/mach-tegra/board-harmony-power.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-harmony-power.c b/arch/arm/mach-tegra/board-harmony-power.c
index 9ebc04baee2f..05e53afa3537 100644
--- a/arch/arm/mach-tegra/board-harmony-power.c
+++ b/arch/arm/mach-tegra/board-harmony-power.c
@@ -28,6 +28,7 @@
#include <mach/irqs.h>
#include "board-harmony.h"
+#include "pm.h"
#define PMC_CTRL 0x0
#define PMC_CTRL_INTR_LOW (1 << 17)
@@ -274,6 +275,39 @@ static struct i2c_board_info __initdata harmony_regulators[] = {
},
};
+static void harmony_board_suspend(int lp_state, enum suspend_stage stg)
+{
+ if ((lp_state == TEGRA_SUSPEND_LP1) && (stg == TEGRA_SUSPEND_BEFORE_CPU))
+ tegra_console_uart_suspend();
+}
+
+static void harmony_board_resume(int lp_state, enum resume_stage stg)
+{
+ if ((lp_state == TEGRA_SUSPEND_LP1) && (stg == TEGRA_RESUME_AFTER_CPU))
+ tegra_console_uart_resume();
+}
+
+static struct tegra_suspend_platform_data harmony_suspend_data = {
+ /*
+ * Check power on time and crystal oscillator start time
+ * for appropriate settings.
+ */
+ .cpu_timer = 5000,
+ .cpu_off_timer = 5000,
+ .suspend_mode = TEGRA_SUSPEND_LP0,
+ .core_timer = 0x7e7e,
+ .core_off_timer = 0x7f,
+ .corereq_high = false,
+ .sysclkreq_high = true,
+ .board_suspend = harmony_board_suspend,
+ .board_resume = harmony_board_resume,
+};
+
+int __init harmony_suspend_init(void)
+{
+ tegra_init_suspend(&harmony_suspend_data);
+}
+
int __init harmony_regulator_init(void)
{
void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);