提交 8b526ae4 编写于 作者: J Jongpill Lee 提交者: Kukjin Kim

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: NJongpill Lee <boyko.lee@samsung.com>
Acked-by: NChanghwan Youn <chaos.youn@samsung.com>
Signed-off-by: NKukjin Kim <kgene.kim@samsung.com>
上级 9fe6206f
...@@ -259,6 +259,8 @@ struct s3c2410_uartcfg { ...@@ -259,6 +259,8 @@ struct s3c2410_uartcfg {
unsigned short flags; unsigned short flags;
upf_t uart_flags; /* default uart flags */ upf_t uart_flags; /* default uart flags */
unsigned int has_fracval;
unsigned long ucon; /* value of ucon for port */ unsigned long ucon; /* value of ucon for port */
unsigned long ulcon; /* value of ulcon for port */ unsigned long ulcon; /* value of ulcon for port */
unsigned long ufcon; /* value of ufcon for port */ unsigned long ufcon; /* value of ufcon for port */
......
...@@ -705,8 +705,13 @@ static void s3c24xx_serial_set_termios(struct uart_port *port, ...@@ -705,8 +705,13 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
if (ourport->info->has_divslot) { if (ourport->info->has_divslot) {
unsigned int div = ourport->baudclk_rate / baud; unsigned int div = ourport->baudclk_rate / baud;
udivslot = udivslot_table[div & 15]; if (cfg->has_fracval) {
dbg("udivslot = %04x (div %d)\n", udivslot, div & 15); udivslot = (div & 15);
dbg("fracval = %04x\n", udivslot);
} else {
udivslot = udivslot_table[div & 15];
dbg("udivslot = %04x (div %d)\n", udivslot, div & 15);
}
} }
switch (termios->c_cflag & CSIZE) { switch (termios->c_cflag & CSIZE) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册