aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/ip22zilog.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/ip22zilog.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/ip22zilog.c')
-rw-r--r--drivers/serial/ip22zilog.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/serial/ip22zilog.c b/drivers/serial/ip22zilog.c
index 193722d680cf..651772474ac1 100644
--- a/drivers/serial/ip22zilog.c
+++ b/drivers/serial/ip22zilog.c
@@ -967,8 +967,9 @@ static struct zilog_layout * __init get_zs(int chip)
967#define ZS_PUT_CHAR_MAX_DELAY 2000 /* 10 ms */ 967#define ZS_PUT_CHAR_MAX_DELAY 2000 /* 10 ms */
968 968
969#ifdef CONFIG_SERIAL_IP22_ZILOG_CONSOLE 969#ifdef CONFIG_SERIAL_IP22_ZILOG_CONSOLE
970static void ip22zilog_put_char(struct zilog_channel *channel, unsigned char ch) 970static void ip22zilog_put_char(struct uart_port *port, int ch)
971{ 971{
972 struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port);
972 int loops = ZS_PUT_CHAR_MAX_DELAY; 973 int loops = ZS_PUT_CHAR_MAX_DELAY;
973 974
974 /* This is a timed polling loop so do not switch the explicit 975 /* This is a timed polling loop so do not switch the explicit
@@ -992,16 +993,10 @@ static void
992ip22zilog_console_write(struct console *con, const char *s, unsigned int count) 993ip22zilog_console_write(struct console *con, const char *s, unsigned int count)
993{ 994{
994 struct uart_ip22zilog_port *up = &ip22zilog_port_table[con->index]; 995 struct uart_ip22zilog_port *up = &ip22zilog_port_table[con->index];
995 struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(&up->port);
996 unsigned long flags; 996 unsigned long flags;
997 int i;
998 997
999 spin_lock_irqsave(&up->port.lock, flags); 998 spin_lock_irqsave(&up->port.lock, flags);
1000 for (i = 0; i < count; i++, s++) { 999 uart_console_write(&up->port, s, count, ip22zilog_put_char);
1001 ip22zilog_put_char(channel, *s);
1002 if (*s == 10)
1003 ip22zilog_put_char(channel, 13);
1004 }
1005 udelay(2); 1000 udelay(2);
1006 spin_unlock_irqrestore(&up->port.lock, flags); 1001 spin_unlock_irqrestore(&up->port.lock, flags);
1007} 1002}