aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_lh7a40x.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/serial_lh7a40x.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/serial_lh7a40x.c')
-rw-r--r--drivers/serial/serial_lh7a40x.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/serial/serial_lh7a40x.c b/drivers/serial/serial_lh7a40x.c
index 04186eaae227..aa521b8e0d4e 100644
--- a/drivers/serial/serial_lh7a40x.c
+++ b/drivers/serial/serial_lh7a40x.c
@@ -543,6 +543,12 @@ static struct uart_port_lh7a40x lh7a40x_ports[DEV_NR] = {
543#else 543#else
544# define LH7A40X_CONSOLE &lh7a40x_console 544# define LH7A40X_CONSOLE &lh7a40x_console
545 545
546static void lh7a40xuart_console_putchar(struct uart_port *port, int ch)
547{
548 while (UR(port, UART_R_STATUS) & nTxRdy)
549 ;
550 UR(port, UART_R_DATA) = ch;
551}
546 552
547static void lh7a40xuart_console_write (struct console* co, 553static void lh7a40xuart_console_write (struct console* co,
548 const char* s, 554 const char* s,
@@ -556,16 +562,7 @@ static void lh7a40xuart_console_write (struct console* co,
556 UR (port, UART_R_INTEN) = 0; /* Disable all interrupts */ 562 UR (port, UART_R_INTEN) = 0; /* Disable all interrupts */
557 BIT_SET (port, UART_R_CON, UARTEN | SIRDIS); /* Enable UART */ 563 BIT_SET (port, UART_R_CON, UARTEN | SIRDIS); /* Enable UART */
558 564
559 for (; count-- > 0; ++s) { 565 uart_console_write(port, s, count, lh7a40xuart_console_putchar);
560 while (UR (port, UART_R_STATUS) & nTxRdy)
561 ;
562 UR (port, UART_R_DATA) = *s;
563 if (*s == '\n') {
564 while ((UR (port, UART_R_STATUS) & TxBusy))
565 ;
566 UR (port, UART_R_DATA) = '\r';
567 }
568 }
569 566
570 /* Wait until all characters are sent */ 567 /* Wait until all characters are sent */
571 while (UR (port, UART_R_STATUS) & TxBusy) 568 while (UR (port, UART_R_STATUS) & TxBusy)