From: Komal Shah Date: Mon, 3 Oct 2005 09:29:54 +0000 (+0300) Subject: [PATCH] ARM: OMAP: [PATCH] OMAP24xx serial.c clock update X-Git-Tag: v2.6.15-omap2~181 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=f7fed1b5898b4956ff9c073571225678be8d9358;p=linux-2.6-omap-h63xx.git [PATCH] ARM: OMAP: [PATCH] OMAP24xx serial.c clock update Moved UART clock initialisation code from clock.c to serial.c Signed-off-by: Komal Shah Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 1140a15b872..b65f4009fa1 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c @@ -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; } diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 4972dee7266..f4df04fe1dd 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -18,10 +18,18 @@ #include #include +#include #include #include +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); } }