arm: tegra: Console suspend for all boards
Laxman Dewangan [Mon, 18 Jul 2011 06:17:13 +0000 (11:17 +0530)]
Added the board level suspend/resume and call the console
suspend from board level suspend/resume.

bug 820536

Original-Change-Id: I246265241246dc0682870571c927bd23023e5aca
Reviewed-on: http://git-master/r/41448
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Narendra Damahe <ndamahe@nvidia.com>

Rebase-Id: R8cde19092af981f1ac31a423aa035924b4353142

arch/arm/mach-tegra/pm.c
arch/arm/mach-tegra/pm.h

index 6d36a2b..3c1eb29 100644 (file)
@@ -43,6 +43,7 @@
 #include <linux/export.h>
 #include <linux/vmalloc.h>
 #include <linux/memblock.h>
+#include <linux/console.h>
 
 #include <asm/cacheflush.h>
 #include <asm/hardware/cache-l2x0.h>
@@ -1057,6 +1058,21 @@ static struct syscore_ops tegra_debug_uart_syscore_ops = {
        .resume = tegra_debug_uart_resume,
 };
 
+struct clk *debug_uart_clk = NULL;
+EXPORT_SYMBOL(debug_uart_clk);
+
+void tegra_console_uart_suspend(void)
+{
+       if (console_suspend_enabled && debug_uart_clk)
+               clk_disable(debug_uart_clk);
+}
+
+void tegra_console_uart_resume(void)
+{
+       if (console_suspend_enabled && debug_uart_clk)
+               clk_enable(debug_uart_clk);
+}
+
 static int tegra_debug_uart_syscore_init(void)
 {
        register_syscore_ops(&tegra_debug_uart_syscore_ops);
index 8da1cff..837ff00 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/mutex.h>
 #include <linux/init.h>
 #include <linux/errno.h>
+#include <linux/clkdev.h>
 
 #include <mach/iomap.h>
 
@@ -211,4 +212,8 @@ extern bool tegra_all_cpus_booted __read_mostly;
 /* The debug channel uart base physical address */
 extern unsigned long  debug_uart_port_base;
 
+extern struct clk *debug_uart_clk;
+void tegra_console_uart_suspend(void);
+void tegra_console_uart_resume(void);
+
 #endif /* _MACH_TEGRA_PM_H_ */