diff options
Diffstat (limited to 'drivers/tty/serial/mvf.c')
-rw-r--r-- | drivers/tty/serial/mvf.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/tty/serial/mvf.c b/drivers/tty/serial/mvf.c index 0ea0181cd455..a174b63e2225 100644 --- a/drivers/tty/serial/mvf.c +++ b/drivers/tty/serial/mvf.c @@ -97,7 +97,7 @@ struct imx_port { void *rx_buf; unsigned char *tx_buf; unsigned int rx_bytes, tx_bytes; - struct work_struct tsk_rx, tsk_dma_tx; + struct work_struct tsk_dma_tx; unsigned int dma_tx_nents; bool dma_is_rxing, dma_is_txing; wait_queue_head_t dma_wait; @@ -368,17 +368,6 @@ out: return IRQ_HANDLED; } -static void rx_work(struct work_struct *w) -{ - struct imx_port *sport = container_of(w, struct imx_port, tsk_rx); - struct tty_struct *tty = sport->port.state->port.tty; - - if (sport->rx_bytes) { - tty_flip_buffer_push(tty); - sport->rx_bytes = 0; - } -} - static irqreturn_t imx_rxint(int irq, void *dev_id) { struct imx_port *sport = dev_id; @@ -450,6 +439,7 @@ out: tty_flip_buffer_push(tty); sport->rx_bytes = 0; } + return IRQ_HANDLED; } @@ -553,6 +543,10 @@ static int imx_setup_watermark(struct imx_port *sport, unsigned int mode) MXC_UARTCR2_RIE | MXC_UARTCR2_RE); writeb(cr2, sport->port.membase + MXC_UARTCR2); + /* Clear pending receive interrupt if needed */ + while (readb(sport->port.membase + MXC_UARTSR1) & MXC_UARTSR1_RDRF) + val = readb(sport->port.membase + MXC_UARTDR); + val = TXTL; writeb(val, sport->port.membase + MXC_UARTTWFIFO); val = RXTL; @@ -564,6 +558,7 @@ static int imx_setup_watermark(struct imx_port *sport, unsigned int mode) MXC_UARTPFIFO_TXFIFOSIZE_MASK) + 1); sport->rx_fifo_size = 0x1 << (((val >> MXC_UARTPFIFO_RXFIFOSIZE_OFF) & MXC_UARTPFIFO_RXFIFOSIZE_MASK) + 1); + writeb(val | MXC_UARTPFIFO_TXFE | MXC_UARTPFIFO_RXFE, sport->port.membase + MXC_UARTPFIFO); @@ -588,10 +583,8 @@ static int imx_startup(struct uart_port *port) struct tty_struct *tty; struct imxuart_platform_data *pdata = port->dev->platform_data; -#ifndef CONFIG_SERIAL_CORE_CONSOLE if (sport->fifo_en) imx_setup_watermark(sport, 0); -#endif /* * Allocate the IRQ(s) @@ -616,9 +609,7 @@ static int imx_startup(struct uart_port *port) temp |= MXC_UARTCR5_TDMAS; writeb(temp, sport->port.membase + MXC_UARTCR5); - sport->port.flags |= UPF_LOW_LATENCY; INIT_WORK(&sport->tsk_dma_tx, dma_tx_work); - INIT_WORK(&sport->tsk_rx, rx_work); init_waitqueue_head(&sport->dma_wait); } |