]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: [PATCH] OMAP24xx serial.c clock update
authorKomal Shah <komal_shah802003@yahoo.com>
Mon, 3 Oct 2005 09:29:54 +0000 (12:29 +0300)
committerTony Lindgren <tony@atomide.com>
Mon, 3 Oct 2005 09:29:54 +0000 (12:29 +0300)
Moved UART clock initialisation code from clock.c
to serial.c

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

index 1140a15b872c86a405ef6af58b30e89641c6a9c3..b65f4009fa1ed2e679324404a62d1a7bfb7c198e 100644 (file)
@@ -1080,13 +1080,5 @@ int __init omap2_clk_init(void)
        if (cpu_is_omap2430())
                clk_use(&sdrc_ick);
 
-       /* FIXME: Move these to serial setup */
-       clk_use(&uart1_ick);
-       clk_use(&uart1_fck);
-       clk_use(&uart2_ick);
-       clk_use(&uart2_fck);
-       clk_use(&uart3_ick);
-       clk_use(&uart3_fck);
-
        return 0;
 }
index 4972dee7266d0337ffcb3f725623db6cfb28c98e..f4df04fe1dd83ed06023db513f0db1f422bef7fe 100644 (file)
 #include <linux/serial_reg.h>
 
 #include <asm/io.h>
+#include <asm/hardware/clock.h>
 
 #include <asm/arch/common.h>
 #include <asm/arch/board.h>
 
+static struct clk * uart1_ick = NULL;
+static struct clk * uart1_fck = NULL;
+static struct clk * uart2_ick = NULL;
+static struct clk * uart2_fck = NULL;
+static struct clk * uart3_ick = NULL;
+static struct clk * uart3_fck = NULL;
+
 static struct plat_serial8250_port serial_platform_data[] = {
        {
                .membase        = (char *)IO_ADDRESS(OMAP_UART1_BASE),
@@ -105,6 +113,54 @@ void __init omap_serial_init()
                        continue;
                }
 
+               switch (i) {
+               case 0:
+                       uart1_ick = clk_get(NULL, "uart1_ick");
+                       if (IS_ERR(uart1_ick))
+                               printk("Could not get uart1_ick\n");
+                       else {
+                               clk_use(uart1_ick);
+                       }
+
+                       uart1_fck = clk_get(NULL, "uart1_fck");
+                       if (IS_ERR(uart1_fck))
+                               printk("Could not get uart1_fck\n");
+                       else {
+                               clk_use(uart1_fck);
+                       }
+                       break;
+               case 1:
+                       uart2_ick = clk_get(NULL, "uart2_ick");
+                       if (IS_ERR(uart2_ick))
+                               printk("Could not get uart2_ick\n");
+                       else {
+                               clk_use(uart2_ick);
+                       }
+
+                       uart2_fck = clk_get(NULL, "uart2_fck");
+                       if (IS_ERR(uart2_fck))
+                               printk("Could not get uart2_fck\n");
+                       else {
+                               clk_use(uart2_fck);
+                       }
+                       break;
+               case 2:
+                       uart3_ick = clk_get(NULL, "uart3_ick");
+                       if (IS_ERR(uart3_ick))
+                               printk("Could not get uart3_ick\n");
+                       else {
+                               clk_use(uart3_ick);
+                       }
+
+                       uart3_fck = clk_get(NULL, "uart3_fck");
+                       if (IS_ERR(uart3_fck))
+                               printk("Could not get uart3_fck\n");
+                       else {
+                               clk_use(uart3_fck);
+                       }
+                       break;
+               }
+
                omap_serial_reset(p);
        }
 }