]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ARM: SAMSUNG: serial: Fix on handling of one clock source for UART
authorBoojin Kim <boojin.kim@samsung.com>
Sat, 28 May 2011 02:04:03 +0000 (19:04 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 7 Jun 2011 16:25:34 +0000 (09:25 -0700)
This patch fixes the way of comparison for handling of two or more
clock sources for UART.

For example, if just only one clock source is defined even though
there are two clock sources for UART, the serial driver does not
set proper clock up. Of course, it is problem.

So this patch changes the condition of comparison to avoid useless
setup clock and adds a flag 'NO_NEED_CHECK_CLKSRC' which means
selection of source clock is not required.

In addition, since the Exynos4210 has only one clock source for UART
this patch adds the flag into its common_init_uarts().

Signed-off-by: Boojin Kim <boojin.kim@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/arm/mach-exynos4/init.c
arch/arm/plat-samsung/include/plat/regs-serial.h
drivers/tty/serial/s5pv210.c

index cf91f50e43ab6434962b0ed9f3457e32a1cc12ec..a8a83e3881a4e9442a15a06a46210355e65ddebd 100644 (file)
@@ -35,6 +35,7 @@ void __init exynos4_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
                        tcfg->clocks = exynos4_serial_clocks;
                        tcfg->clocks_size = ARRAY_SIZE(exynos4_serial_clocks);
                }
+               tcfg->flags |= NO_NEED_CHECK_CLKSRC;
        }
 
        s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
index c151c5f94a87b0e647863b5bb48016a6f27f55a8..116edfe120b972612aad96fa9217ad2fdc279c84 100644 (file)
 #define S5PV210_UFSTAT_RXMASK  (255<<0)
 #define S5PV210_UFSTAT_RXSHIFT (0)
 
+#define NO_NEED_CHECK_CLKSRC   1
+
 #ifndef __ASSEMBLY__
 
 /* struct s3c24xx_uart_clksrc
index fb2619f93d84e25424dc551def7a33ae56710041..dd194dc80ee9a4f0adbbeae30e4c222756b20d19 100644 (file)
@@ -30,7 +30,7 @@ static int s5pv210_serial_setsource(struct uart_port *port,
        struct s3c2410_uartcfg *cfg = port->dev->platform_data;
        unsigned long ucon = rd_regl(port, S3C2410_UCON);
 
-       if ((cfg->clocks_size) == 1)
+       if (cfg->flags & NO_NEED_CHECK_CLKSRC)
                return 0;
 
        if (strcmp(clk->name, "pclk") == 0)
@@ -55,7 +55,7 @@ static int s5pv210_serial_getsource(struct uart_port *port,
 
        clk->divisor = 1;
 
-       if ((cfg->clocks_size) == 1)
+       if (cfg->flags & NO_NEED_CHECK_CLKSRC)
                return 0;
 
        switch (ucon & S5PV210_UCON_CLKMASK) {