diff options
Diffstat (limited to 'drivers/serial/atmel_serial.c')
-rw-r--r-- | drivers/serial/atmel_serial.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index e99a28387505..430997e33fc4 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
@@ -107,6 +107,7 @@ | |||
107 | 107 | ||
108 | #define UART_PUT_TPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TPR) | 108 | #define UART_PUT_TPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TPR) |
109 | #define UART_PUT_TCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TCR) | 109 | #define UART_PUT_TCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TCR) |
110 | #define UART_GET_TCR(port) __raw_readl((port)->membase + ATMEL_PDC_TCR) | ||
110 | 111 | ||
111 | static int (*atmel_open_hook)(struct uart_port *); | 112 | static int (*atmel_open_hook)(struct uart_port *); |
112 | static void (*atmel_close_hook)(struct uart_port *); | 113 | static void (*atmel_close_hook)(struct uart_port *); |
@@ -1275,6 +1276,7 @@ static void atmel_console_write(struct console *co, const char *s, u_int count) | |||
1275 | { | 1276 | { |
1276 | struct uart_port *port = &atmel_ports[co->index].uart; | 1277 | struct uart_port *port = &atmel_ports[co->index].uart; |
1277 | unsigned int status, imr; | 1278 | unsigned int status, imr; |
1279 | unsigned int pdc_tx; | ||
1278 | 1280 | ||
1279 | /* | 1281 | /* |
1280 | * First, save IMR and then disable interrupts | 1282 | * First, save IMR and then disable interrupts |
@@ -1282,6 +1284,10 @@ static void atmel_console_write(struct console *co, const char *s, u_int count) | |||
1282 | imr = UART_GET_IMR(port); | 1284 | imr = UART_GET_IMR(port); |
1283 | UART_PUT_IDR(port, ATMEL_US_RXRDY | ATMEL_US_TXRDY); | 1285 | UART_PUT_IDR(port, ATMEL_US_RXRDY | ATMEL_US_TXRDY); |
1284 | 1286 | ||
1287 | /* Store PDC transmit status and disable it */ | ||
1288 | pdc_tx = UART_GET_PTSR(port) & ATMEL_PDC_TXTEN; | ||
1289 | UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS); | ||
1290 | |||
1285 | uart_console_write(port, s, count, atmel_console_putchar); | 1291 | uart_console_write(port, s, count, atmel_console_putchar); |
1286 | 1292 | ||
1287 | /* | 1293 | /* |
@@ -1291,6 +1297,11 @@ static void atmel_console_write(struct console *co, const char *s, u_int count) | |||
1291 | do { | 1297 | do { |
1292 | status = UART_GET_CSR(port); | 1298 | status = UART_GET_CSR(port); |
1293 | } while (!(status & ATMEL_US_TXRDY)); | 1299 | } while (!(status & ATMEL_US_TXRDY)); |
1300 | |||
1301 | /* Restore PDC transmit status */ | ||
1302 | if (pdc_tx) | ||
1303 | UART_PUT_PTCR(port, ATMEL_PDC_TXTEN); | ||
1304 | |||
1294 | /* set interrupts back the way they were */ | 1305 | /* set interrupts back the way they were */ |
1295 | UART_PUT_IER(port, imr); | 1306 | UART_PUT_IER(port, imr); |
1296 | } | 1307 | } |