aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/m32r_sio.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/m32r_sio.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/m32r_sio.c')
-rw-r--r--drivers/serial/m32r_sio.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c
index 242a04104393..876bc5e027bb 100644
--- a/drivers/serial/m32r_sio.c
+++ b/drivers/serial/m32r_sio.c
@@ -1039,6 +1039,14 @@ static inline void wait_for_xmitr(struct uart_sio_port *up)
1039 } 1039 }
1040} 1040}
1041 1041
1042static void m32r_sio_console_putchar(struct uart_port *port, int ch)
1043{
1044 struct uart_sio_port *up = (struct uart_sio_port *)port;
1045
1046 wait_for_xmitr(up);
1047 sio_out(up, SIOTXB, ch);
1048}
1049
1042/* 1050/*
1043 * Print a string to the serial port trying not to disturb 1051 * Print a string to the serial port trying not to disturb
1044 * any possible real use of the port... 1052 * any possible real use of the port...
@@ -1058,23 +1066,7 @@ static void m32r_sio_console_write(struct console *co, const char *s,
1058 ier = sio_in(up, SIOTRCR); 1066 ier = sio_in(up, SIOTRCR);
1059 sio_out(up, SIOTRCR, 0); 1067 sio_out(up, SIOTRCR, 0);
1060 1068
1061 /* 1069 uart_console_write(&up->port, s, count, m32r_sio_console_putchar);
1062 * Now, do each character
1063 */
1064 for (i = 0; i < count; i++, s++) {
1065 wait_for_xmitr(up);
1066
1067 /*
1068 * Send the character out.
1069 * If a LF, also do CR...
1070 */
1071 sio_out(up, SIOTXB, *s);
1072
1073 if (*s == 10) {
1074 wait_for_xmitr(up);
1075 sio_out(up, SIOTXB, 13);
1076 }
1077 }
1078 1070
1079 /* 1071 /*
1080 * Finally, wait for transmitter to become empty 1072 * Finally, wait for transmitter to become empty