summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/clps711x.c
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2012-10-14 11:05:27 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-24 22:39:47 +0400
commitcf03a884b9f4a63d4bcf29614fe03ca3f8299138 (patch)
tree0fba4e463e736e5f279992a7e21e444f98d65348 /drivers/tty/serial/clps711x.c
parentc08f0153f54ee0a7f3eeaf7f48dce1a71b3f8c7d (diff)
downloadlinux-cf03a884b9f4a63d4bcf29614fe03ca3f8299138.tar.xz
serial: clps711x: Improved TX FIFO handling
Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/clps711x.c')
-rw-r--r--drivers/tty/serial/clps711x.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c
index 0884939d29cf..d37460965ba7 100644
--- a/drivers/tty/serial/clps711x.c
+++ b/drivers/tty/serial/clps711x.c
@@ -155,7 +155,6 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id)
struct uart_port *port = dev_id;
struct clps711x_port *s = dev_get_drvdata(port->dev);
struct circ_buf *xmit = &port->state->xmit;
- int count;
if (port->x_char) {
clps_writel(port->x_char, UARTDR(port));
@@ -170,14 +169,13 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id)
return IRQ_HANDLED;
}
- count = port->fifosize >> 1;
- do {
- clps_writel(xmit->buf[xmit->tail], UARTDR(port));
+ while (!uart_circ_empty(xmit)) {
+ clps_writew(xmit->buf[xmit->tail], UARTDR(port));
xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
port->icount.tx++;
- if (uart_circ_empty(xmit))
+ if (clps_readl(SYSFLG(port) & SYSFLG_UTXFF))
break;
- } while (--count > 0);
+ }
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
uart_write_wakeup(port);
@@ -327,8 +325,9 @@ clps711xuart_set_termios(struct uart_port *port, struct ktermios *termios,
if (!(termios->c_cflag & PARODD))
ubrlcr |= UBRLCR_EVENPRT;
}
- if (port->fifosize > 1)
- ubrlcr |= UBRLCR_FIFOEN;
+
+ /* Enable FIFO */
+ ubrlcr |= UBRLCR_FIFOEN;
spin_lock_irqsave(&port->lock, flags);