aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/clps711x.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/clps711x.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/clps711x.c')
-rw-r--r--drivers/serial/clps711x.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c
index ce7b2e4ecd17..2691112c84ad 100644
--- a/drivers/serial/clps711x.c
+++ b/drivers/serial/clps711x.c
@@ -424,6 +424,13 @@ static struct uart_port clps711x_ports[UART_NR] = {
424}; 424};
425 425
426#ifdef CONFIG_SERIAL_CLPS711X_CONSOLE 426#ifdef CONFIG_SERIAL_CLPS711X_CONSOLE
427static void clps711xuart_console_putchar(struct uart_port *port, int ch)
428{
429 while (clps_readl(SYSFLG(port)) & SYSFLG_UTXFF)
430 barrier();
431 clps_writel(ch, UARTDR(port));
432}
433
427/* 434/*
428 * Print a string to the serial port trying not to disturb 435 * Print a string to the serial port trying not to disturb
429 * any possible real use of the port... 436 * any possible real use of the port...
@@ -438,7 +445,6 @@ clps711xuart_console_write(struct console *co, const char *s,
438{ 445{
439 struct uart_port *port = clps711x_ports + co->index; 446 struct uart_port *port = clps711x_ports + co->index;
440 unsigned int status, syscon; 447 unsigned int status, syscon;
441 int i;
442 448
443 /* 449 /*
444 * Ensure that the port is enabled. 450 * Ensure that the port is enabled.
@@ -446,21 +452,7 @@ clps711xuart_console_write(struct console *co, const char *s,
446 syscon = clps_readl(SYSCON(port)); 452 syscon = clps_readl(SYSCON(port));
447 clps_writel(syscon | SYSCON_UARTEN, SYSCON(port)); 453 clps_writel(syscon | SYSCON_UARTEN, SYSCON(port));
448 454
449 /* 455 uart_console_write(port, s, count, clps711xuart_console_putchar);
450 * Now, do each character
451 */
452 for (i = 0; i < count; i++) {
453 do {
454 status = clps_readl(SYSFLG(port));
455 } while (status & SYSFLG_UTXFF);
456 clps_writel(s[i], UARTDR(port));
457 if (s[i] == '\n') {
458 do {
459 status = clps_readl(SYSFLG(port));
460 } while (status & SYSFLG_UTXFF);
461 clps_writel('\r', UARTDR(port));
462 }
463 }
464 456
465 /* 457 /*
466 * Finally, wait for transmitter to become empty 458 * Finally, wait for transmitter to become empty