aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/vr41xx_siu.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/vr41xx_siu.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/vr41xx_siu.c')
-rw-r--r--drivers/serial/vr41xx_siu.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c
index d61494d185cd..3f88b8e81937 100644
--- a/drivers/serial/vr41xx_siu.c
+++ b/drivers/serial/vr41xx_siu.c
@@ -821,25 +821,23 @@ static void wait_for_xmitr(struct uart_port *port)
821 } 821 }
822} 822}
823 823
824static void siu_console_putchar(struct uart_port *port, int ch)
825{
826 wait_for_xmitr(port);
827 siu_write(port, UART_TX, ch);
828}
829
824static void siu_console_write(struct console *con, const char *s, unsigned count) 830static void siu_console_write(struct console *con, const char *s, unsigned count)
825{ 831{
826 struct uart_port *port; 832 struct uart_port *port;
827 uint8_t ier; 833 uint8_t ier;
828 unsigned i;
829 834
830 port = &siu_uart_ports[con->index]; 835 port = &siu_uart_ports[con->index];
831 836
832 ier = siu_read(port, UART_IER); 837 ier = siu_read(port, UART_IER);
833 siu_write(port, UART_IER, 0); 838 siu_write(port, UART_IER, 0);
834 839
835 for (i = 0; i < count && *s != '\0'; i++, s++) { 840 uart_console_write(port, s, count, siu_console_putchar);
836 wait_for_xmitr(port);
837 siu_write(port, UART_TX, *s);
838 if (*s == '\n') {
839 wait_for_xmitr(port);
840 siu_write(port, UART_TX, '\r');
841 }
842 }
843 841
844 wait_for_xmitr(port); 842 wait_for_xmitr(port);
845 siu_write(port, UART_IER, ier); 843 siu_write(port, UART_IER, ier);