aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_txx9.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_txx9.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_txx9.c')
-rw-r--r--drivers/serial/serial_txx9.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/drivers/serial/serial_txx9.c b/drivers/serial/serial_txx9.c
index ee98a867bc6d..1a259cee1a98 100644
--- a/drivers/serial/serial_txx9.c
+++ b/drivers/serial/serial_txx9.c
@@ -854,6 +854,14 @@ static inline void wait_for_xmitr(struct uart_txx9_port *up)
854 } 854 }
855} 855}
856 856
857static void serial_txx9_console_putchar(struct uart_port *port, int ch)
858{
859 struct uart_txx9_port *up = (struct uart_txx9_port *)port;
860
861 wait_for_xmitr(up);
862 sio_out(up, TXX9_SITFIFO, ch);
863}
864
857/* 865/*
858 * Print a string to the serial port trying not to disturb 866 * Print a string to the serial port trying not to disturb
859 * any possible real use of the port... 867 * any possible real use of the port...
@@ -865,7 +873,6 @@ serial_txx9_console_write(struct console *co, const char *s, unsigned int count)
865{ 873{
866 struct uart_txx9_port *up = &serial_txx9_ports[co->index]; 874 struct uart_txx9_port *up = &serial_txx9_ports[co->index];
867 unsigned int ier, flcr; 875 unsigned int ier, flcr;
868 int i;
869 876
870 /* 877 /*
871 * First save the UER then disable the interrupts 878 * First save the UER then disable the interrupts
@@ -879,22 +886,7 @@ serial_txx9_console_write(struct console *co, const char *s, unsigned int count)
879 if (!(up->port.flags & UPF_CONS_FLOW) && (flcr & TXX9_SIFLCR_TES)) 886 if (!(up->port.flags & UPF_CONS_FLOW) && (flcr & TXX9_SIFLCR_TES))
880 sio_out(up, TXX9_SIFLCR, flcr & ~TXX9_SIFLCR_TES); 887 sio_out(up, TXX9_SIFLCR, flcr & ~TXX9_SIFLCR_TES);
881 888
882 /* 889 uart_console_write(&up->port, s, count, serial_txx9_console_putchar);
883 * Now, do each character
884 */
885 for (i = 0; i < count; i++, s++) {
886 wait_for_xmitr(up);
887
888 /*
889 * Send the character out.
890 * If a LF, also do CR...
891 */
892 sio_out(up, TXX9_SITFIFO, *s);
893 if (*s == 10) {
894 wait_for_xmitr(up);
895 sio_out(up, TXX9_SITFIFO, 13);
896 }
897 }
898 890
899 /* 891 /*
900 * Finally, wait for transmitter to become empty 892 * Finally, wait for transmitter to become empty