aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_lh7a40x.c
diff options
context:
space:
mode:
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)