|
74 | 74 | #define IMX21_UTS 0xb4 /* UART Test Register on all other i.mx*/ |
75 | 75 |
|
76 | 76 | /* UART Control Register Bit Fields.*/ |
| 77 | +#define URXD_DUMMY_READ (1<<16) |
77 | 78 | #define URXD_CHARRDY (1<<15) |
78 | 79 | #define URXD_ERR (1<<14) |
79 | 80 | #define URXD_OVRRUN (1<<13) |
@@ -710,6 +711,9 @@ static irqreturn_t imx_rxint(int irq, void *dev_id) |
710 | 711 | #endif |
711 | 712 | } |
712 | 713 |
|
| 714 | + if (sport->port.ignore_status_mask & URXD_DUMMY_READ) |
| 715 | + goto out; |
| 716 | + |
713 | 717 | tty_insert_flip_char(port, rx, flg); |
714 | 718 | } |
715 | 719 |
|
@@ -910,7 +914,8 @@ static void dma_rx_callback(void *data) |
910 | 914 | dev_dbg(sport->port.dev, "We get %d bytes.\n", count); |
911 | 915 |
|
912 | 916 | if (count) { |
913 | | - tty_insert_flip_string(port, sport->rx_buf, count); |
| 917 | + if (!(sport->port.ignore_status_mask & URXD_DUMMY_READ)) |
| 918 | + tty_insert_flip_string(port, sport->rx_buf, count); |
914 | 919 | tty_flip_buffer_push(port); |
915 | 920 |
|
916 | 921 | start_rx_dma(sport); |
@@ -1330,6 +1335,9 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios, |
1330 | 1335 | sport->port.ignore_status_mask |= URXD_OVRRUN; |
1331 | 1336 | } |
1332 | 1337 |
|
| 1338 | + if ((termios->c_cflag & CREAD) == 0) |
| 1339 | + sport->port.ignore_status_mask |= URXD_DUMMY_READ; |
| 1340 | + |
1333 | 1341 | /* |
1334 | 1342 | * Update the per-port timeout. |
1335 | 1343 | */ |
|
0 commit comments