MLK-17005: linux-imx: serial: fsl_lpuart: Clear LOOP mode when requested
authorAbel Vesa <abel.vesa@nxp.com>
Mon, 27 Nov 2017 16:10:11 +0000 (18:10 +0200)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:55:45 +0000 (15:55 -0500)
The LOOP mode remained always set after first use.
If the ioctl tiocmset gets called with TIOCMBIC for TIOCM_LOOP,
UARTCTRL_LOOPS needs to be cleared in the LPUART control register.

Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
drivers/tty/serial/fsl_lpuart.c

index 3971bc0..b89a1bc 100644 (file)
@@ -1126,6 +1126,9 @@ static void lpuart32_set_mctrl(struct uart_port *port, unsigned int mctrl)
        temp = lpuart32_read(port->membase + UARTCTRL);
        if (mctrl & TIOCM_LOOP)
                temp |= UARTCTRL_LOOPS;
+       else
+               temp &= ~UARTCTRL_LOOPS;
+
        lpuart32_write(temp, port->membase + UARTCTRL);
 }