[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>
This commit is contained in:

committed by
Russell King

parent
7705a8792b
commit
d358788f3f
@@ -1252,8 +1252,9 @@ static struct zilog_layout __iomem * __init get_zs(int chip, int node)
|
||||
|
||||
#define ZS_PUT_CHAR_MAX_DELAY 2000 /* 10 ms */
|
||||
|
||||
static void sunzilog_put_char(struct zilog_channel __iomem *channel, unsigned char ch)
|
||||
static void sunzilog_putchar(struct uart_port *port, int ch)
|
||||
{
|
||||
struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port);
|
||||
int loops = ZS_PUT_CHAR_MAX_DELAY;
|
||||
|
||||
/* This is a timed polling loop so do not switch the explicit
|
||||
@@ -1284,7 +1285,7 @@ static int sunzilog_serio_write(struct serio *serio, unsigned char ch)
|
||||
|
||||
spin_lock_irqsave(&sunzilog_serio_lock, flags);
|
||||
|
||||
sunzilog_put_char(ZILOG_CHANNEL_FROM_PORT(&up->port), ch);
|
||||
sunzilog_putchar(&up->port, ch);
|
||||
|
||||
spin_unlock_irqrestore(&sunzilog_serio_lock, flags);
|
||||
|
||||
@@ -1325,16 +1326,10 @@ static void
|
||||
sunzilog_console_write(struct console *con, const char *s, unsigned int count)
|
||||
{
|
||||
struct uart_sunzilog_port *up = &sunzilog_port_table[con->index];
|
||||
struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(&up->port);
|
||||
unsigned long flags;
|
||||
int i;
|
||||
|
||||
spin_lock_irqsave(&up->port.lock, flags);
|
||||
for (i = 0; i < count; i++, s++) {
|
||||
sunzilog_put_char(channel, *s);
|
||||
if (*s == 10)
|
||||
sunzilog_put_char(channel, 13);
|
||||
}
|
||||
uart_console_write(&up->port, s, count, sunzilog_putchar);
|
||||
udelay(2);
|
||||
spin_unlock_irqrestore(&up->port.lock, flags);
|
||||
}
|
||||
|
Reference in New Issue
Block a user