summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2011-12-12 20:04:57 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 10:59:23 +0200
commit7f9b91b56e6d3b0898dcb43247ed9c9a544d3279 (patch)
tree6bd365243af48a2c22e0e7c39a5e41646fc75a4b
parent3b5dd7d0086148c9a21cf59d0373353cd29721e9 (diff)
ux500: pm: allow console UART GPIO to by changed at runtime
So that multiple boards with the UART on different GPIOs can be handled in one kernel image. ST-Ericsson ID: 326681 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I29aa5daa26756255cd2cd04b2c67f13a73b444c6 Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/42220 Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
-rw-r--r--arch/arm/mach-ux500/include/mach/pm.h2
-rw-r--r--arch/arm/mach-ux500/pm/Kconfig2
-rw-r--r--arch/arm/mach-ux500/pm/pm.c2
-rw-r--r--arch/arm/mach-ux500/pm/suspend_dbg.c8
4 files changed, 10 insertions, 4 deletions
diff --git a/arch/arm/mach-ux500/include/mach/pm.h b/arch/arm/mach-ux500/include/mach/pm.h
index d5fe29b6c88..c6f1b0adca5 100644
--- a/arch/arm/mach-ux500/include/mach/pm.h
+++ b/arch/arm/mach-ux500/include/mach/pm.h
@@ -104,4 +104,6 @@ static inline void ux500_pm_prcmu_set_ioforce(bool enable) { }
#endif
+extern int ux500_console_uart_gpio_pin;
+
#endif
diff --git a/arch/arm/mach-ux500/pm/Kconfig b/arch/arm/mach-ux500/pm/Kconfig
index 195a1d7cad2..12004ba9858 100644
--- a/arch/arm/mach-ux500/pm/Kconfig
+++ b/arch/arm/mach-ux500/pm/Kconfig
@@ -26,6 +26,8 @@ config UX500_CONSOLE_UART_GPIO_PIN
help
GPIO pin number of the GPIO pin connected to the console UART RX line.
+ Board-specific code can change this.
+
config UX500_SUSPEND
bool "Suspend to mem and standby support"
depends on (UX500_SOC_DB8500 || UX500_SOC_DB5500) && PM && SUSPEND
diff --git a/arch/arm/mach-ux500/pm/pm.c b/arch/arm/mach-ux500/pm/pm.c
index 604846021b7..b1337d8ba9f 100644
--- a/arch/arm/mach-ux500/pm/pm.c
+++ b/arch/arm/mach-ux500/pm/pm.c
@@ -48,6 +48,8 @@
#define PRCM_IOCR 0x310
#define PRCM_IOCR_IOFORCE 0x1
+int ux500_console_uart_gpio_pin = CONFIG_UX500_CONSOLE_UART_GPIO_PIN;
+
static u32 u8500_gpio_banks[] = {U8500_GPIOBANK0_BASE,
U8500_GPIOBANK1_BASE,
U8500_GPIOBANK2_BASE,
diff --git a/arch/arm/mach-ux500/pm/suspend_dbg.c b/arch/arm/mach-ux500/pm/suspend_dbg.c
index d6da667ae3b..1b7d871ba52 100644
--- a/arch/arm/mach-ux500/pm/suspend_dbg.c
+++ b/arch/arm/mach-ux500/pm/suspend_dbg.c
@@ -42,14 +42,14 @@ static u32 suspend_count;
#ifdef CONFIG_UX500_SUSPEND_DBG_WAKE_ON_UART
void ux500_suspend_dbg_add_wake_on_uart(void)
{
- irq_set_irq_wake(GPIO_TO_IRQ(CONFIG_UX500_CONSOLE_UART_GPIO_PIN), 1);
- irq_set_irq_type(GPIO_TO_IRQ(CONFIG_UX500_CONSOLE_UART_GPIO_PIN),
- IRQ_TYPE_EDGE_BOTH);
+ irq_set_irq_wake(GPIO_TO_IRQ(ux500_console_uart_gpio_pin), 1);
+ irq_set_irq_type(GPIO_TO_IRQ(ux500_console_uart_gpio_pin),
+ IRQ_TYPE_EDGE_BOTH);
}
void ux500_suspend_dbg_remove_wake_on_uart(void)
{
- irq_set_irq_wake(GPIO_TO_IRQ(CONFIG_UX500_CONSOLE_UART_GPIO_PIN), 0);
+ irq_set_irq_wake(GPIO_TO_IRQ(ux500_console_uart_gpio_pin), 0);
}
#endif