aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/s3c2410.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2006-03-20 15:00:09 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-03-20 15:00:09 -0500
commitd358788f3f30113e49882187d794832905e42592 (patch)
tree8c796ee4bf719dad4d3947c03cef2f3fd6cb5940 /drivers/serial/s3c2410.c
parent7705a8792b0fc82fd7d4dd923724606bbfd9fb20 (diff)
[SERIAL] kernel console should send CRLF not LFCR
Glen Turner reported that writing LFCR rather than the more traditional CRLF causes issues with some terminals. Since this aflicts many serial drivers, extract the common code to a library function (uart_console_write) and arrange for each driver to supply a "putchar" function. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial/s3c2410.c')
-rw-r--r--drivers/serial/s3c2410.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 7410e093a6b9..e4d701239702 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -1584,25 +1584,19 @@ s3c24xx_serial_console_txrdy(struct uart_port *port, unsigned int ufcon)
1584} 1584}
1585 1585
1586static void 1586static void
1587s3c24xx_serial_console_write(struct console *co, const char *s, 1587s3c24xx_serial_console_putchar(struct uart_port *port, int ch)
1588 unsigned int count)
1589{ 1588{
1590 int i;
1591 unsigned int ufcon = rd_regl(cons_uart, S3C2410_UFCON); 1589 unsigned int ufcon = rd_regl(cons_uart, S3C2410_UFCON);
1590 while (!s3c24xx_serial_console_txrdy(port, ufcon))
1591 barrier();
1592 wr_regb(cons_uart, S3C2410_UTXH, ch);
1593}
1592 1594
1593 for (i = 0; i < count; i++) { 1595static void
1594 while (!s3c24xx_serial_console_txrdy(cons_uart, ufcon)) 1596s3c24xx_serial_console_write(struct console *co, const char *s,
1595 barrier(); 1597 unsigned int count)
1596 1598{
1597 wr_regb(cons_uart, S3C2410_UTXH, s[i]); 1599 uart_console_write(cons_uart, s, count, s3c24xx_serial_console_putchar);
1598
1599 if (s[i] == '\n') {
1600 while (!s3c24xx_serial_console_txrdy(cons_uart, ufcon))
1601 barrier();
1602
1603 wr_regb(cons_uart, S3C2410_UTXH, '\r');
1604 }
1605 }
1606} 1600}
1607 1601
1608static void __init 1602static void __init