]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Fix compile for serial init if CONFIG_PM is not selected
authorTony Lindgren <tony@atomide.com>
Thu, 8 Jan 2009 09:39:00 +0000 (11:39 +0200)
committerTony Lindgren <tony@atomide.com>
Thu, 8 Jan 2009 09:39:00 +0000 (11:39 +0200)
This patch should be merged into the "MAP3: PM: UART: disable clocks
when idle" patch for omap-pm-upstream.

Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/serial.c

index 7f9a50da55f5b4cc0d13920a2aa6752574e4532b..fd5b9f83e0bc51ad361c2eaaf11a7b016ee65f7c 100644 (file)
@@ -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) {