提交 6b471a98 编写于 作者: H Huang Shijie 提交者: Greg Kroah-Hartman

serial: imx: add support for loopback mode.

Add the loopback mode support for imx uart driver.
Signed-off-by: NHuang Shijie <b32955@freescale.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 17438217
...@@ -806,6 +806,9 @@ static unsigned int imx_get_mctrl(struct uart_port *port) ...@@ -806,6 +806,9 @@ static unsigned int imx_get_mctrl(struct uart_port *port)
if (readl(sport->port.membase + UCR2) & UCR2_CTS) if (readl(sport->port.membase + UCR2) & UCR2_CTS)
tmp |= TIOCM_RTS; tmp |= TIOCM_RTS;
if (readl(sport->port.membase + uts_reg(sport)) & UTS_LOOP)
tmp |= TIOCM_LOOP;
return tmp; return tmp;
} }
...@@ -821,6 +824,11 @@ static void imx_set_mctrl(struct uart_port *port, unsigned int mctrl) ...@@ -821,6 +824,11 @@ static void imx_set_mctrl(struct uart_port *port, unsigned int mctrl)
temp |= UCR2_CTS; temp |= UCR2_CTS;
writel(temp, sport->port.membase + UCR2); 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));
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册