]> git.karo-electronics.de Git - linux-beck.git/commitdiff
serial: imx: Fix DCD reading
authorSascha Hauer <s.hauer@pengutronix.de>
Mon, 26 Sep 2016 13:55:31 +0000 (15:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Sep 2016 10:55:27 +0000 (12:55 +0200)
The USR2_DCDIN bit is tested for in register usr1. As the name
suggests the usr2 register should be used instead. This fixes
reading the Carrier detect status.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Fixes: 90ebc4838666 ("serial: imx: repair and complete handshaking")
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: <stable@vger.kernel.org> # 4.5+
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c

index a1d8174a098bdca005b19269aff85a5623d330f9..a70356dad1b75a4a1e4a5d68344aaf51f6f96ef7 100644 (file)
@@ -763,12 +763,13 @@ static unsigned int imx_get_hwmctrl(struct imx_port *sport)
 {
        unsigned int tmp = TIOCM_DSR;
        unsigned usr1 = readl(sport->port.membase + USR1);
+       unsigned usr2 = readl(sport->port.membase + USR2);
 
        if (usr1 & USR1_RTSS)
                tmp |= TIOCM_CTS;
 
        /* in DCE mode DCDIN is always 0 */
-       if (!(usr1 & USR2_DCDIN))
+       if (!(usr2 & USR2_DCDIN))
                tmp |= TIOCM_CAR;
 
        if (sport->dte_mode)