developer | ec4ebe4 | 2022-04-12 11:17:45 +0800 | [diff] [blame^] | 1 | --- a/drivers/tty/serial/8250/8250.h |
| 2 | +++ b/drivers/tty/serial/8250/8250.h |
| 3 | @@ -82,6 +82,7 @@ struct serial8250_config { |
| 4 | #define UART_CAP_MINI (1 << 17) /* Mini UART on BCM283X family lacks: |
| 5 | * STOP PARITY EPAR SPAR WLEN5 WLEN6 |
| 6 | */ |
| 7 | +#define UART_CAP_NMOD (1 << 18) /* UART doesn't do termios */ |
| 8 | |
| 9 | #define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */ |
| 10 | #define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */ |
| 11 | --- a/drivers/tty/serial/8250/8250_port.c |
| 12 | +++ b/drivers/tty/serial/8250/8250_port.c |
| 13 | @@ -291,7 +291,7 @@ static const struct serial8250_config ua |
| 14 | .tx_loadsz = 16, |
| 15 | .fcr = UART_FCR_ENABLE_FIFO | |
| 16 | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, |
| 17 | - .flags = UART_CAP_FIFO, |
| 18 | + .flags = UART_CAP_FIFO | UART_CAP_NMOD, |
| 19 | }, |
| 20 | [PORT_NPCM] = { |
| 21 | .name = "Nuvoton 16550", |
| 22 | @@ -2598,6 +2598,11 @@ serial8250_do_set_termios(struct uart_po |
| 23 | unsigned long flags; |
| 24 | unsigned int baud, quot, frac = 0; |
| 25 | |
| 26 | + if (up->capabilities & UART_CAP_NMOD) { |
| 27 | + termios->c_cflag = 0; |
| 28 | + return; |
| 29 | + } |
| 30 | + |
| 31 | if (up->capabilities & UART_CAP_MINI) { |
| 32 | termios->c_cflag &= ~(CSTOPB | PARENB | PARODD | CMSPAR); |
| 33 | if ((termios->c_cflag & CSIZE) == CS5 || |