Commit 8fe2d541 authored by Albin Tonnerre's avatar Albin Tonnerre Committed by Greg Kroah-Hartman

serial: atmel_serial: add poll_get_char and poll_put_char uart_ops

Permits using KGDB over the console with the atmel_serial driver.

[akpm@linux-foundation.org: s/barrier/cpu_relax/]
Signed-off-by: default avatarAlbin Tonnerre <albin.tonnerre@free-electrons.com>
Acked-by: default avatarAndrew Victor <linux@maxim.org.za>
Acked-by: default avatarHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8b505ca8
...@@ -1213,6 +1213,24 @@ static int atmel_verify_port(struct uart_port *port, struct serial_struct *ser) ...@@ -1213,6 +1213,24 @@ static int atmel_verify_port(struct uart_port *port, struct serial_struct *ser)
return ret; return ret;
} }
#ifdef CONFIG_CONSOLE_POLL
static int atmel_poll_get_char(struct uart_port *port)
{
while (!(UART_GET_CSR(port) & ATMEL_US_RXRDY))
cpu_relax();
return UART_GET_CHAR(port);
}
static void atmel_poll_put_char(struct uart_port *port, unsigned char ch)
{
while (!(UART_GET_CSR(port) & ATMEL_US_TXRDY))
cpu_relax();
UART_PUT_CHAR(port, ch);
}
#endif
static struct uart_ops atmel_pops = { static struct uart_ops atmel_pops = {
.tx_empty = atmel_tx_empty, .tx_empty = atmel_tx_empty,
.set_mctrl = atmel_set_mctrl, .set_mctrl = atmel_set_mctrl,
...@@ -1232,6 +1250,10 @@ static struct uart_ops atmel_pops = { ...@@ -1232,6 +1250,10 @@ static struct uart_ops atmel_pops = {
.config_port = atmel_config_port, .config_port = atmel_config_port,
.verify_port = atmel_verify_port, .verify_port = atmel_verify_port,
.pm = atmel_serial_pm, .pm = atmel_serial_pm,
#ifdef CONFIG_CONSOLE_POLL
.poll_get_char = atmel_poll_get_char,
.poll_put_char = atmel_poll_put_char,
#endif
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment