summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2013-11-29 17:29:24 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-08 17:09:07 -0800
commit6b471a9840eefc96abb3fbd9eb71e1eb93399daa (patch)
tree73c96875e1b3ec2c91e0383c226d0609c403216b /drivers/tty
parent17438217a6f5e33d920ed3821a4b857311cc2872 (diff)
downloadlinux-6b471a9840eefc96abb3fbd9eb71e1eb93399daa.tar.gz
linux-6b471a9840eefc96abb3fbd9eb71e1eb93399daa.tar.bz2
linux-6b471a9840eefc96abb3fbd9eb71e1eb93399daa.zip
serial: imx: add support for loopback mode.
Add the loopback mode support for imx uart driver. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/imx.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index b2cfdb661947..d799140e53b6 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -806,6 +806,9 @@ static unsigned int imx_get_mctrl(struct uart_port *port)
if (readl(sport->port.membase + UCR2) & UCR2_CTS)
tmp |= TIOCM_RTS;
+ if (readl(sport->port.membase + uts_reg(sport)) & UTS_LOOP)
+ tmp |= TIOCM_LOOP;
+
return tmp;
}
@@ -821,6 +824,11 @@ static void imx_set_mctrl(struct uart_port *port, unsigned int mctrl)
temp |= UCR2_CTS;
writel(temp, sport->port.membase + UCR2);
+
+ temp = readl(sport->port.membase + uts_reg(sport)) & ~UTS_LOOP;
+ if (mctrl & TIOCM_LOOP)
+ temp |= UTS_LOOP;
+ writel(temp, sport->port.membase + uts_reg(sport));
}
/*