aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/atmel_serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/atmel_serial.c')
-rw-r--r--drivers/serial/atmel_serial.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
index 6aeef22bd203..3a6da80b081c 100644
--- a/drivers/serial/atmel_serial.c
+++ b/drivers/serial/atmel_serial.c
@@ -42,11 +42,11 @@
42#include <asm/io.h> 42#include <asm/io.h>
43 43
44#include <asm/mach/serial_at91.h> 44#include <asm/mach/serial_at91.h>
45#include <asm/arch/board.h> 45#include <mach/board.h>
46 46
47#ifdef CONFIG_ARM 47#ifdef CONFIG_ARM
48#include <asm/arch/cpu.h> 48#include <mach/cpu.h>
49#include <asm/arch/gpio.h> 49#include <mach/gpio.h>
50#endif 50#endif
51 51
52#define PDC_BUFFER_SIZE 512 52#define PDC_BUFFER_SIZE 512
@@ -662,14 +662,14 @@ static void atmel_rx_from_ring(struct uart_port *port)
662 * uart_start(), which takes the lock. 662 * uart_start(), which takes the lock.
663 */ 663 */
664 spin_unlock(&port->lock); 664 spin_unlock(&port->lock);
665 tty_flip_buffer_push(port->info->tty); 665 tty_flip_buffer_push(port->info->port.tty);
666 spin_lock(&port->lock); 666 spin_lock(&port->lock);
667} 667}
668 668
669static void atmel_rx_from_dma(struct uart_port *port) 669static void atmel_rx_from_dma(struct uart_port *port)
670{ 670{
671 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); 671 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
672 struct tty_struct *tty = port->info->tty; 672 struct tty_struct *tty = port->info->port.tty;
673 struct atmel_dma_buffer *pdc; 673 struct atmel_dma_buffer *pdc;
674 int rx_idx = atmel_port->pdc_rx_idx; 674 int rx_idx = atmel_port->pdc_rx_idx;
675 unsigned int head; 675 unsigned int head;
@@ -794,7 +794,7 @@ static void atmel_tasklet_func(unsigned long data)
794static int atmel_startup(struct uart_port *port) 794static int atmel_startup(struct uart_port *port)
795{ 795{
796 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); 796 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
797 struct tty_struct *tty = port->info->tty; 797 struct tty_struct *tty = port->info->port.tty;
798 int retval; 798 int retval;
799 799
800 /* 800 /*
@@ -956,6 +956,20 @@ static void atmel_shutdown(struct uart_port *port)
956} 956}
957 957
958/* 958/*
959 * Flush any TX data submitted for DMA. Called when the TX circular
960 * buffer is reset.
961 */
962static void atmel_flush_buffer(struct uart_port *port)
963{
964 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
965
966 if (atmel_use_dma_tx(port)) {
967 UART_PUT_TCR(port, 0);
968 atmel_port->pdc_tx.ofs = 0;
969 }
970}
971
972/*
959 * Power / Clock management. 973 * Power / Clock management.
960 */ 974 */
961static void atmel_serial_pm(struct uart_port *port, unsigned int state, 975static void atmel_serial_pm(struct uart_port *port, unsigned int state,
@@ -1189,6 +1203,7 @@ static struct uart_ops atmel_pops = {
1189 .break_ctl = atmel_break_ctl, 1203 .break_ctl = atmel_break_ctl,
1190 .startup = atmel_startup, 1204 .startup = atmel_startup,
1191 .shutdown = atmel_shutdown, 1205 .shutdown = atmel_shutdown,
1206 .flush_buffer = atmel_flush_buffer,
1192 .set_termios = atmel_set_termios, 1207 .set_termios = atmel_set_termios,
1193 .type = atmel_type, 1208 .type = atmel_type,
1194 .release_port = atmel_release_port, 1209 .release_port = atmel_release_port,