serial: fsl_lpuart: clear parity enable bit when disable parity
authorAndy Duan <fugang.duan@nxp.com>
Tue, 16 Oct 2018 07:32:22 +0000 (07:32 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Nov 2018 16:48:57 +0000 (08:48 -0800)
Current driver only enable parity enable bit and never clear it
when user set the termios. The fix clear the parity enable bit when
PARENB flag is not set in termios->c_cflag.

Cc: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Andy Duan <fugang.duan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/fsl_lpuart.c

index cabae83..241a48e 100644 (file)
@@ -1479,6 +1479,8 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios,
                        else
                                cr1 &= ~UARTCR1_PT;
                }
+       } else {
+               cr1 &= ~UARTCR1_PE;
        }
 
        /* ask the core to calculate the divisor */
@@ -1690,6 +1692,8 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
                        else
                                ctrl &= ~UARTCTRL_PT;
                }
+       } else {
+               ctrl &= ~UARTCTRL_PE;
        }
 
        /* ask the core to calculate the divisor */