diff options
author | Jiada Wang <jiada_wang@mentor.com> | 2014-12-09 18:11:22 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-09 14:23:06 -0800 |
commit | 55d8693acd65b1c14e011cbcbfad2a15626472cd (patch) | |
tree | c64907ccfb3f97012c45584bba2598adb3da2298 /drivers/tty | |
parent | 1842dc2e29855ef2d8ec2e5ff9f29add7e999ce8 (diff) | |
download | linux-55d8693acd65b1c14e011cbcbfad2a15626472cd.tar.gz linux-55d8693acd65b1c14e011cbcbfad2a15626472cd.tar.bz2 linux-55d8693acd65b1c14e011cbcbfad2a15626472cd.zip |
serial: imx: add CREAD flag support
Add CREAD flag hanlding in set_termios and UART DMA mode
which ignores all received chars when CREAD flag cleared.
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Anton Bondarenko <anton_bondarenko@mentor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/imx.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 4c5e9092e2d7..eb2210fa972e 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -74,6 +74,7 @@ #define IMX21_UTS 0xb4 /* UART Test Register on all other i.mx*/ /* UART Control Register Bit Fields.*/ +#define URXD_DUMMY_READ (1<<16) #define URXD_CHARRDY (1<<15) #define URXD_ERR (1<<14) #define URXD_OVRRUN (1<<13) @@ -710,6 +711,9 @@ static irqreturn_t imx_rxint(int irq, void *dev_id) #endif } + if (sport->port.ignore_status_mask & URXD_DUMMY_READ) + goto out; + tty_insert_flip_char(port, rx, flg); } @@ -910,7 +914,8 @@ static void dma_rx_callback(void *data) dev_dbg(sport->port.dev, "We get %d bytes.\n", count); if (count) { - tty_insert_flip_string(port, sport->rx_buf, count); + if (!(sport->port.ignore_status_mask & URXD_DUMMY_READ)) + tty_insert_flip_string(port, sport->rx_buf, count); tty_flip_buffer_push(port); start_rx_dma(sport); @@ -1330,6 +1335,9 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios, sport->port.ignore_status_mask |= URXD_OVRRUN; } + if ((termios->c_cflag & CREAD) == 0) + sport->port.ignore_status_mask |= URXD_DUMMY_READ; + /* * Update the per-port timeout. */ |