Skip to content

Commit

Permalink
ARM: SAMSUNG: serial: Add FRACVAL support for newer UART
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jongpill Lee authored and Kukjin Kim committed Aug 5, 2010
1 parent 9fe6206 commit 8b526ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions arch/arm/plat-samsung/include/plat/regs-serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ struct s3c2410_uartcfg {
unsigned short flags;
upf_t uart_flags; /* default uart flags */

unsigned int has_fracval;

unsigned long ucon; /* value of ucon for port */
unsigned long ulcon; /* value of ulcon for port */
unsigned long ufcon; /* value of ufcon for port */
Expand Down
9 changes: 7 additions & 2 deletions drivers/serial/samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,13 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
if (ourport->info->has_divslot) {
unsigned int div = ourport->baudclk_rate / baud;

udivslot = udivslot_table[div & 15];
dbg("udivslot = %04x (div %d)\n", udivslot, div & 15);
if (cfg->has_fracval) {
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) {
Expand Down

0 comments on commit 8b526ae

Please sign in to comment.