diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-03-20 15:00:09 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-03-20 15:00:09 -0500 |
commit | d358788f3f30113e49882187d794832905e42592 (patch) | |
tree | 8c796ee4bf719dad4d3947c03cef2f3fd6cb5940 /drivers/serial/21285.c | |
parent | 7705a8792b0fc82fd7d4dd923724606bbfd9fb20 (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/21285.c')
-rw-r--r-- | drivers/serial/21285.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c index 8c5c276c5577..7572665a8855 100644 --- a/drivers/serial/21285.c +++ b/drivers/serial/21285.c | |||
@@ -375,23 +375,18 @@ static void serial21285_setup_ports(void) | |||
375 | } | 375 | } |
376 | 376 | ||
377 | #ifdef CONFIG_SERIAL_21285_CONSOLE | 377 | #ifdef CONFIG_SERIAL_21285_CONSOLE |
378 | static void serial21285_console_putchar(struct uart_port *port, int ch) | ||
379 | { | ||
380 | while (*CSR_UARTFLG & 0x20) | ||
381 | barrier(); | ||
382 | *CSR_UARTDR = ch; | ||
383 | } | ||
378 | 384 | ||
379 | static void | 385 | static void |
380 | serial21285_console_write(struct console *co, const char *s, | 386 | serial21285_console_write(struct console *co, const char *s, |
381 | unsigned int count) | 387 | unsigned int count) |
382 | { | 388 | { |
383 | int i; | 389 | uart_console_write(&serial21285_port, s, count, serial21285_console_putchar); |
384 | |||
385 | for (i = 0; i < count; i++) { | ||
386 | while (*CSR_UARTFLG & 0x20) | ||
387 | barrier(); | ||
388 | *CSR_UARTDR = s[i]; | ||
389 | if (s[i] == '\n') { | ||
390 | while (*CSR_UARTFLG & 0x20) | ||
391 | barrier(); | ||
392 | *CSR_UARTDR = '\r'; | ||
393 | } | ||
394 | } | ||
395 | } | 390 | } |
396 | 391 | ||
397 | static void __init | 392 | static void __init |