s5p: uart: fix setting the div value
authorMinkyu Kang <mk7.kang@samsung.com>
Thu, 19 Aug 2010 10:22:03 +0000 (19:22 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Thu, 19 Aug 2010 10:22:03 +0000 (19:22 +0900)
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
arch/arm/include/asm/arch-s5p64xx/uart.h
arch/arm/include/asm/arch-s5pc1xx/uart.h
arch/arm/include/asm/arch-s5pc2xx/uart.h
drivers/serial/serial_s5p.c

index 8e69c4f..419f578 100644 (file)
@@ -41,6 +41,9 @@ struct s5p_uart {
        unsigned char   res3[2];
        unsigned char   res4[0x3d0];
 };
+
+static int use_divslot = 1;
+
 #endif /* __ASSEMBLY__ */
 
 #endif
index 2d7ad7e..0774749 100644 (file)
@@ -42,6 +42,9 @@ struct s5p_uart {
        unsigned char   res3[2];
        unsigned char   res4[0x3d0];
 };
+
+static int use_divslot = 1;
+
 #endif /* __ASSEMBLY__ */
 
 #endif
index a5405e8..26cad04 100644 (file)
@@ -43,6 +43,9 @@ struct s5p_uart {
        unsigned char   res4[3];
        unsigned char   res5[0xffd0];
 };
+
+static int use_divslot = 0;
+
 #endif /* __ASSEMBLY__ */
 
 #endif
index fd1fd5d..41c931a 100644 (file)
@@ -70,12 +70,11 @@ void serial_setbrg_dev(const int dev_index)
        val = uclk / baudrate;
 
        writel(val / 16 - 1, &uart->ubrdiv);
-#ifdef CONFIG_S5PC210
-       if (cpu_is_s5pc210())
-               writew(val & 15, &uart->udivslot);
-       else
-#endif
+
+       if (use_divslot)
                writew(udivslot[val % 16], &uart->udivslot);
+       else
+               writew(val & 16, &uart->udivslot);      /* ufracval */
 }
 
 /*