From e8b22165f8af8cf9827d6c3e1279c17a457efb08 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Thu, 8 Jan 2009 11:39:00 +0200 Subject: [PATCH] Fix compile for serial init if CONFIG_PM is not selected This patch should be merged into the "MAP3: PM: UART: disable clocks when idle" patch for omap-pm-upstream. Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/serial.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 7f9a50da55f..fd5b9f83e0b 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -125,6 +125,16 @@ static inline void __init omap_uart_reset(struct omap_uart_state *uart) serial_write_reg(p, UART_OMAP_SYSC, (0x02 << 3) | (1 << 2) | (1 << 0)); } +static inline void omap_uart_enable_clocks(struct omap_uart_state *uart) +{ + if (uart->clocked) + return; + + clk_enable(uart->ick); + clk_enable(uart->fck); + uart->clocked = 1; +} + #ifdef CONFIG_PM #ifdef CONFIG_ARCH_OMAP3 @@ -204,14 +214,9 @@ static void omap_uart_smart_idle_enable(struct omap_uart_state *uart, serial_write_reg(p, UART_OMAP_SYSC, sysc); } -static inline void omap_uart_enable_clocks(struct omap_uart_state *uart) +static inline void omap_uart_restore(struct omap_uart_state *uart) { - if (uart->clocked) - return; - - clk_enable(uart->ick); - clk_enable(uart->fck); - uart->clocked = 1; + omap_uart_enable_clocks(uart); omap_uart_restore_context(uart); } @@ -228,7 +233,7 @@ static inline void omap_uart_disable_clocks(struct omap_uart_state *uart) static void omap_uart_block_sleep(struct omap_uart_state *uart) { - omap_uart_enable_clocks(uart); + omap_uart_restore(uart); omap_uart_smart_idle_enable(uart, 0); uart->can_sleep = 0; @@ -273,7 +278,7 @@ void omap_uart_resume_idle(int num) list_for_each_entry(uart, &uart_list, node) { if (num == uart->num) { - omap_uart_enable_clocks(uart); + omap_uart_restore(uart); /* Check for IO pad wakeup */ if (cpu_is_omap34xx() && uart->padconf) { -- 2.41.0