diff options
author | Katsunaga Kinoshita <katsu@katsu-ubuntu.(none)> | 2012-06-22 17:09:54 +0900 |
---|---|---|
committer | Justin Waters <justin.waters@timesys.com> | 2012-07-03 17:15:22 -0400 |
commit | 98b03585409921146ac2ed06b9aa0320cb9eed38 (patch) | |
tree | d3cb5bbeb33d8dd1a67e32a7126366fe809de776 | |
parent | 0a5809910344264575ec8116c9fa5f126f92e0af (diff) |
fix: serial driver
-rw-r--r-- | drivers/tty/serial/serial_mvf.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/tty/serial/serial_mvf.c b/drivers/tty/serial/serial_mvf.c index f834177a916b..378123cd27ee 100644 --- a/drivers/tty/serial/serial_mvf.c +++ b/drivers/tty/serial/serial_mvf.c @@ -1,7 +1,7 @@ /* * Driver for MVF serial ports * - * Copyright 2012 + * Copyright 2012 Freescale * * Based on drivers/tty/serial/imx.c * @@ -173,8 +173,10 @@ static void mvf_stop_tx(struct uart_port *port) unsigned char c2; c2 = readb(sport->port.membase + MVF_UART_C2); - writeb(c2 & ~(UART_C2_TCIE), - sport->port.membase + MVF_UART_C2); + if ( readb(sport->port.membase + MVF_UART_SFIFO) & UART_SFIFO_TXEMPT) { + writeb(c2 & ~(UART_C2_TCIE | UART_C2_TE), + sport->port.membase + MVF_UART_C2); + } } /* @@ -220,8 +222,10 @@ static inline void mvf_transmit_buffer(struct mvf_port *sport) if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) uart_write_wakeup(&sport->port); +#if 0 if (uart_circ_empty(xmit)) mvf_stop_tx(&sport->port); +#endif } @@ -346,7 +350,9 @@ static irqreturn_t mvf_int(int irq, void *dev_id) /* Check RXINT */ if (s1 & UART_S1_RDRF) { mvf_rxint(irq, dev_id); - }else if (s1 & UART_S1_TDRE){ + } + + if (s1 & UART_S1_TDRE){ mvf_txint(irq, dev_id); } @@ -807,7 +813,7 @@ static int serial_mvf_resume(struct platform_device *dev) return 0; } -static consit struct dev_pm_ops serial_mvf_pm_ops = { +static const struct dev_pm_ops serial_mvf_pm_ops = { .suspend = serial_mvf_suspend, .resume = serial_mvf_resume, }; |