aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJongpill Lee <boyko.lee@samsung.com>2010-07-15 21:19:41 -0400
committerKukjin Kim <kgene.kim@samsung.com>2010-08-05 05:32:41 -0400
commit8b526ae4ddd7a62397d99856079b59eda5d09360 (patch)
tree004b09ebdb47c96612d28b97fb7c7dd5907597cb
parent9fe6206f400646a2322096b56c59891d530e8d51 (diff)
ARM: SAMSUNG: serial: Add FRACVAL support for newer UART
Add support for the FRACVAL register on the newer UART blocks which provides the same function as UDIVSLOT register but the FRACVAL is easier to implement. To support UDIVSLOT register, UDIVSLOT table search is necessary though supporting FRACVAL only needs the index value of UDIVSLOT table. Signed-off-by: Jongpill Lee <boyko.lee@samsung.com> Acked-by: Changhwan Youn <chaos.youn@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-serial.h2
-rw-r--r--drivers/serial/samsung.c9
2 files changed, 9 insertions, 2 deletions
diff --git a/arch/arm/plat-samsung/include/plat/regs-serial.h b/arch/arm/plat-samsung/include/plat/regs-serial.h
index a6eba8496b24..788837e99cb3 100644
--- a/arch/arm/plat-samsung/include/plat/regs-serial.h
+++ b/arch/arm/plat-samsung/include/plat/regs-serial.h
@@ -259,6 +259,8 @@ struct s3c2410_uartcfg {
259 unsigned short flags; 259 unsigned short flags;
260 upf_t uart_flags; /* default uart flags */ 260 upf_t uart_flags; /* default uart flags */
261 261
262 unsigned int has_fracval;
263
262 unsigned long ucon; /* value of ucon for port */ 264 unsigned long ucon; /* value of ucon for port */
263 unsigned long ulcon; /* value of ulcon for port */ 265 unsigned long ulcon; /* value of ulcon for port */
264 unsigned long ufcon; /* value of ufcon for port */ 266 unsigned long ufcon; /* value of ufcon for port */
diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c
index a9d6c5626a0a..b1156ba8ad14 100644
--- a/drivers/serial/samsung.c
+++ b/drivers/serial/samsung.c
@@ -705,8 +705,13 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
705 if (ourport->info->has_divslot) { 705 if (ourport->info->has_divslot) {
706 unsigned int div = ourport->baudclk_rate / baud; 706 unsigned int div = ourport->baudclk_rate / baud;
707 707
708 udivslot = udivslot_table[div & 15]; 708 if (cfg->has_fracval) {
709 dbg("udivslot = %04x (div %d)\n", udivslot, div & 15); 709 udivslot = (div & 15);
710 dbg("fracval = %04x\n", udivslot);
711 } else {
712 udivslot = udivslot_table[div & 15];
713 dbg("udivslot = %04x (div %d)\n", udivslot, div & 15);
714 }
710 } 715 }
711 716
712 switch (termios->c_cflag & CSIZE) { 717 switch (termios->c_cflag & CSIZE) {