diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2011-07-15 11:10:57 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:47:44 -0800 |
commit | 03ec9a964aaffe6844061a217a1e9f24349a8cce (patch) | |
tree | d1690a51a40db3d8f244635ab8f0ed7ef6368a4d | |
parent | 7ce24a35400df989b176d5a2a26f5cc496ff8bd2 (diff) |
arm: tegra: cardhu: Add board level suspend/resume
Adding board level suspend/resume for cardhu.
Disabling the clock for console uart port if console_suspend
is enabled.
bug 820536
Original-Change-Id: Iecb78708ff7784dd131ffa83692b2419dba44e88
Reviewed-on: http://git-master/r/41147
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Rebase-Id: R14dcb8c7822b2bdc7e66807e292776b68d08d12d
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu-power.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu.h | 3 |
3 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-power.c b/arch/arm/mach-tegra/board-cardhu-power.c index dfb566c87fde..051ace4bfd70 100644 --- a/arch/arm/mach-tegra/board-cardhu-power.c +++ b/arch/arm/mach-tegra/board-cardhu-power.c @@ -899,6 +899,18 @@ int __init cardhu_gpio_switch_regulator_init(void) return platform_device_register(&gswitch_regulator_pdata); } +static void cardhu_board_suspend(int lp_state, enum suspend_stage stg) +{ + if ((lp_state == TEGRA_SUSPEND_LP1) && (stg == TEGRA_SUSPEND_BEFORE_CPU)) + cardhu_debug_uart_suspend(); +} + +static void cardhu_board_resume(int lp_state, enum resume_stage stg) +{ + if ((lp_state == TEGRA_SUSPEND_LP1) && (stg == TEGRA_RESUME_AFTER_CPU)) + cardhu_debug_uart_resume(); +} + static struct tegra_suspend_platform_data cardhu_suspend_data = { .cpu_timer = 2000, .cpu_off_timer = 200, @@ -908,6 +920,8 @@ static struct tegra_suspend_platform_data cardhu_suspend_data = { .corereq_high = true, .sysclkreq_high = true, .cpu_lp2_min_residency = 2000, + .board_suspend = cardhu_board_suspend, + .board_resume = cardhu_board_resume, }; int __init cardhu_suspend_init(void) diff --git a/arch/arm/mach-tegra/board-cardhu.c b/arch/arm/mach-tegra/board-cardhu.c index 1d28df5bea5e..b285a3822031 100644 --- a/arch/arm/mach-tegra/board-cardhu.c +++ b/arch/arm/mach-tegra/board-cardhu.c @@ -36,6 +36,7 @@ #include <linux/spi/spi.h> #include <linux/i2c/atmel_mxt_ts.h> #include <linux/tegra_uart.h> +#include <linux/console.h> #include <sound/wm8903.h> @@ -355,6 +356,18 @@ static void __init cardhu_uart_init(void) ARRAY_SIZE(cardhu_uart_devices)); } +void cardhu_debug_uart_suspend(void) +{ + if (console_suspend_enabled) + clk_disable(debug_uart_clk); +} + +void cardhu_debug_uart_resume(void) +{ + if (console_suspend_enabled) + clk_enable(debug_uart_clk); +} + static struct platform_device tegra_camera = { .name = "tegra_camera", .id = -1, diff --git a/arch/arm/mach-tegra/board-cardhu.h b/arch/arm/mach-tegra/board-cardhu.h index f9ed1e5cd5d2..eddc20cfbea5 100644 --- a/arch/arm/mach-tegra/board-cardhu.h +++ b/arch/arm/mach-tegra/board-cardhu.h @@ -171,4 +171,7 @@ int cardhu_power_off_init(void); int cardhu_edp_init(void); int cardhu_pmon_init(void); +void cardhu_debug_uart_suspend(void); +void cardhu_debug_uart_resume(void); + #endif |