summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-tegra/board-cardhu-power.c4
-rw-r--r--arch/arm/mach-tegra/board-cardhu.c14
-rw-r--r--arch/arm/mach-tegra/board-cardhu.h3
-rw-r--r--arch/arm/mach-tegra/board-enterprise-power.c14
-rw-r--r--arch/arm/mach-tegra/board-enterprise.c1
-rw-r--r--arch/arm/mach-tegra/board-ventana-power.c14
-rw-r--r--arch/arm/mach-tegra/board-ventana.c1
-rw-r--r--arch/arm/mach-tegra/pm.c16
-rw-r--r--arch/arm/mach-tegra/pm.h5
9 files changed, 51 insertions, 21 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-power.c b/arch/arm/mach-tegra/board-cardhu-power.c
index 051ace4bfd70..b16447a50811 100644
--- a/arch/arm/mach-tegra/board-cardhu-power.c
+++ b/arch/arm/mach-tegra/board-cardhu-power.c
@@ -902,13 +902,13 @@ int __init cardhu_gpio_switch_regulator_init(void)
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();
+ tegra_console_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();
+ tegra_console_uart_resume();
}
static struct tegra_suspend_platform_data cardhu_suspend_data = {
diff --git a/arch/arm/mach-tegra/board-cardhu.c b/arch/arm/mach-tegra/board-cardhu.c
index b285a3822031..924a94ac468d 100644
--- a/arch/arm/mach-tegra/board-cardhu.c
+++ b/arch/arm/mach-tegra/board-cardhu.c
@@ -36,7 +36,6 @@
#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>
@@ -277,7 +276,6 @@ static struct uart_clk_parent uart_parent_clk[] = {
[2] = {.name = "clk_m"},
};
-static struct clk *debug_uart_clk;
static struct tegra_uart_platform_data cardhu_uart_pdata;
static void __init uart_debug_init(void)
@@ -356,18 +354,6 @@ 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 eddc20cfbea5..f9ed1e5cd5d2 100644
--- a/arch/arm/mach-tegra/board-cardhu.h
+++ b/arch/arm/mach-tegra/board-cardhu.h
@@ -171,7 +171,4 @@ 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
diff --git a/arch/arm/mach-tegra/board-enterprise-power.c b/arch/arm/mach-tegra/board-enterprise-power.c
index 9f1f95948cdf..4da5d1dd0740 100644
--- a/arch/arm/mach-tegra/board-enterprise-power.c
+++ b/arch/arm/mach-tegra/board-enterprise-power.c
@@ -400,6 +400,18 @@ int __init enterprise_regulator_init(void)
return 0;
}
+static void enterprise_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 enterprise_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 enterprise_suspend_data = {
.cpu_timer = 2000,
.cpu_off_timer = 200,
@@ -408,6 +420,8 @@ static struct tegra_suspend_platform_data enterprise_suspend_data = {
.core_off_timer = 0,
.corereq_high = true,
.sysclkreq_high = true,
+ .board_suspend = enterprise_board_suspend,
+ .board_resume = enterprise_board_resume,
};
int __init enterprise_suspend_init(void)
diff --git a/arch/arm/mach-tegra/board-enterprise.c b/arch/arm/mach-tegra/board-enterprise.c
index 87b353ba0b56..1b6171eeae1a 100644
--- a/arch/arm/mach-tegra/board-enterprise.c
+++ b/arch/arm/mach-tegra/board-enterprise.c
@@ -241,7 +241,6 @@ static struct uart_clk_parent uart_parent_clk[] = {
[1] = {.name = "pll_m"},
[2] = {.name = "clk_m"},
};
-static struct clk *debug_uart_clk;
static struct tegra_uart_platform_data enterprise_uart_pdata;
static void __init uart_debug_init(void)
diff --git a/arch/arm/mach-tegra/board-ventana-power.c b/arch/arm/mach-tegra/board-ventana-power.c
index 14c5748fc50d..656ffc5aa7c9 100644
--- a/arch/arm/mach-tegra/board-ventana-power.c
+++ b/arch/arm/mach-tegra/board-ventana-power.c
@@ -201,6 +201,18 @@ static struct i2c_board_info __initdata ventana_regulators[] = {
},
};
+static void ventana_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 ventana_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 ventana_suspend_data = {
/*
* Check power on time and crystal oscillator start time
@@ -213,6 +225,8 @@ static struct tegra_suspend_platform_data ventana_suspend_data = {
.core_off_timer = 0xf,
.corereq_high = false,
.sysclkreq_high = true,
+ .board_suspend = ventana_board_suspend,
+ .board_resume = ventana_board_resume,
};
int __init ventana_regulator_init(void)
diff --git a/arch/arm/mach-tegra/board-ventana.c b/arch/arm/mach-tegra/board-ventana.c
index 8d4f80febf51..41576952c051 100644
--- a/arch/arm/mach-tegra/board-ventana.c
+++ b/arch/arm/mach-tegra/board-ventana.c
@@ -201,7 +201,6 @@ static struct uart_clk_parent uart_parent_clk[] = {
[2] = {.name = "clk_m"},
};
-static struct clk *debug_uart_clk;
static struct tegra_uart_platform_data ventana_uart_pdata;
static void __init uart_debug_init(void)
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c
index 34da66ee17cf..33fcca25097f 100644
--- a/arch/arm/mach-tegra/pm.c
+++ b/arch/arm/mach-tegra/pm.c
@@ -40,6 +40,7 @@
#include <linux/syscore_ops.h>
#include <linux/vmalloc.h>
#include <linux/memblock.h>
+#include <linux/console.h>
#include <asm/cacheflush.h>
#include <asm/cpu_pm.h>
@@ -1056,6 +1057,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);
diff --git a/arch/arm/mach-tegra/pm.h b/arch/arm/mach-tegra/pm.h
index 5a620928c4bc..49cd77f9b584 100644
--- a/arch/arm/mach-tegra/pm.h
+++ b/arch/arm/mach-tegra/pm.h
@@ -25,6 +25,7 @@
#include <linux/mutex.h>
#include <linux/init.h>
#include <linux/errno.h>
+#include <linux/clkdev.h>
#include <mach/iomap.h>
@@ -213,4 +214,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_ */