410-bt-mtk-serial-fix.patch 1.1 KB

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