Thread (15 messages) 15 messages, 2 authors, 2016-04-13
STALE3707d

[PATCH v2 1/6] serial: imx: fix polarity of RI

From: Uwe Kleine-König <hidden>
Date: 2016-03-24 13:24:20
Also in: linux-serial
Subsystem: the rest, tty layer and serial drivers · Maintainers: Linus Torvalds, Greg Kroah-Hartman, Jiri Slaby

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 <redacted>
---
 drivers/tty/serial/imx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 231e7d5caf6c..bfc4555c63d1 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -797,9 +797,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;
 }
-- 
2.7.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help