summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQipan Li <Qipan.Li@csr.com>2015-05-14 06:45:24 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-24 12:50:41 -0700
commitd9e8e976faef867f9be579d6a76e1271d5d30da8 (patch)
treedeff4a8a9272eaeaf2a752eb5ce06cb3fc65d421
parent36c0991089ef190ee5e3f72e1346c623b24a0e7d (diff)
downloadtalos-op-linux-d9e8e976faef867f9be579d6a76e1271d5d30da8.tar.gz
talos-op-linux-d9e8e976faef867f9be579d6a76e1271d5d30da8.zip
serial: sirf: add uart receive's some error counter and mark
add overrun error's flag mark and parity's counter, we can show the statistic from procfs node. BTW, let the indentation of stick bits configuration look better. Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/sirfsoc_uart.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/tty/serial/sirfsoc_uart.c b/drivers/tty/serial/sirfsoc_uart.c
index ffeb7663bd6e..a5007216338d 100644
--- a/drivers/tty/serial/sirfsoc_uart.c
+++ b/drivers/tty/serial/sirfsoc_uart.c
@@ -606,14 +606,18 @@ static irqreturn_t sirfsoc_uart_isr(int irq, void *dev_id)
if (uart_handle_break(port))
goto recv_char;
}
- if (intr_status & uint_st->sirfsoc_rx_oflow)
+ if (intr_status & uint_st->sirfsoc_rx_oflow) {
port->icount.overrun++;
+ flag = TTY_OVERRUN;
+ }
if (intr_status & uint_st->sirfsoc_frm_err) {
port->icount.frame++;
flag = TTY_FRAME;
}
- if (intr_status & uint_st->sirfsoc_parity_err)
+ if (intr_status & uint_st->sirfsoc_parity_err) {
+ port->icount.parity++;
flag = TTY_PARITY;
+ }
wr_regl(port, ureg->sirfsoc_rx_fifo_op, SIRFUART_FIFO_RESET);
wr_regl(port, ureg->sirfsoc_rx_fifo_op, 0);
wr_regl(port, ureg->sirfsoc_rx_fifo_op, SIRFUART_FIFO_START);
@@ -932,10 +936,11 @@ static void sirfsoc_uart_set_termios(struct uart_port *port,
config_reg |= SIRFUART_STICK_BIT_MARK;
else
config_reg |= SIRFUART_STICK_BIT_SPACE;
- } else if (termios->c_cflag & PARODD) {
- config_reg |= SIRFUART_STICK_BIT_ODD;
} else {
- config_reg |= SIRFUART_STICK_BIT_EVEN;
+ if (termios->c_cflag & PARODD)
+ config_reg |= SIRFUART_STICK_BIT_ODD;
+ else
+ config_reg |= SIRFUART_STICK_BIT_EVEN;
}
}
} else {
OpenPOWER on IntegriCloud