a06557542a0c6e31b79efc479acaa5167c533b0c
[openwrt/openwrt.git] / target / linux / imx6 / patches-4.4 / 111-serial-imx-fix-polarity-of-RI.patch
1 From 9a061cea4477f26a1dfcc0a08dc20575016e91df Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
3 Date: Thu, 24 Mar 2016 14:24:20 +0100
4 Subject: [PATCH 1/3] serial: imx: fix polarity of RI
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 When in DTE mode, the bit USR2_RIIN is active low. So invert the logic
10 accordingly.
11
12 Fixes: 90ebc4838666 ("serial: imx: repair and complete handshaking")
13 Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
14 Signed-off-by: Petr Štetiar <ynezz@true.cz>
15 ---
16 drivers/tty/serial/imx.c | 6 +++---
17 1 file changed, 3 insertions(+), 3 deletions(-)
18
19 diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
20 index 231e7d5..bfc4555 100644
21 --- a/drivers/tty/serial/imx.c
22 +++ b/drivers/tty/serial/imx.c
23 @@ -797,9 +797,9 @@ static unsigned int imx_get_hwmctrl(struct imx_port *sport)
24 if (!(usr1 & USR2_DCDIN))
25 tmp |= TIOCM_CAR;
26
27 - /* in DCE mode RIIN is always 0 */
28 - if (readl(sport->port.membase + USR2) & USR2_RIIN)
29 - tmp |= TIOCM_RI;
30 + if (sport->dte_mode)
31 + if (!(readl(sport->port.membase + USR2) & USR2_RIIN))
32 + tmp |= TIOCM_RI;
33
34 return tmp;
35 }
36 --
37 1.9.1
38