From 937a2eb65f2257ca90697ad69d648178b7037cec Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Wed, 16 Jul 2008 21:52:46 +0100 Subject: [PATCH] --- yaml --- r: 102348 b: refs/heads/master c: 9afd561acabe5059ff16d163a176e2350269aba5 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/serial/atmel_serial.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 37c615a38fd2..075430b32837 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6bb0e3a59a089e23eecc0af3b6f6012b2a9affba +refs/heads/master: 9afd561acabe5059ff16d163a176e2350269aba5 diff --git a/trunk/drivers/serial/atmel_serial.c b/trunk/drivers/serial/atmel_serial.c index 6aeef22bd203..c17fcd6085f3 100644 --- a/trunk/drivers/serial/atmel_serial.c +++ b/trunk/drivers/serial/atmel_serial.c @@ -955,6 +955,20 @@ static void atmel_shutdown(struct uart_port *port) atmel_close_hook(port); } +/* + * Flush any TX data submitted for DMA. Called when the TX circular + * buffer is reset. + */ +static void atmel_flush_buffer(struct uart_port *port) +{ + struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); + + if (atmel_use_dma_tx(port)) { + UART_PUT_TCR(port, 0); + atmel_port->pdc_tx.ofs = 0; + } +} + /* * Power / Clock management. */ @@ -1189,6 +1203,7 @@ static struct uart_ops atmel_pops = { .break_ctl = atmel_break_ctl, .startup = atmel_startup, .shutdown = atmel_shutdown, + .flush_buffer = atmel_flush_buffer, .set_termios = atmel_set_termios, .type = atmel_type, .release_port = atmel_release_port,