serial: imx: fix polarity of RI
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 24 Mar 2016 13:24:20 +0000 (14:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 30 Apr 2016 16:26:55 +0000 (09:26 -0700)
When in DTE mode, the bit USR2_RIIN is active low. So invert the logic
accordingly.

Fixes: 90ebc4838666 ("serial: imx: repair and complete handshaking")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c

index 66cc3d198dcf439933a83cb102363f96ccf26489..7cfb482bbc5c10835918a4d69d7ba6f2df271449 100644 (file)
@@ -800,9 +800,9 @@ static unsigned int imx_get_hwmctrl(struct imx_port *sport)
        if (!(usr1 & USR2_DCDIN))
                tmp |= TIOCM_CAR;
 
-       /* in DCE mode RIIN is always 0 */
-       if (readl(sport->port.membase + USR2) & USR2_RIIN)
-               tmp |= TIOCM_RI;
+       if (sport->dte_mode)
+               if (!(readl(sport->port.membase + USR2) & USR2_RIIN))
+                       tmp |= TIOCM_RI;
 
        return tmp;
 }