summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/tty/serial/imx.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 32f36d86a960..059ba354d17e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -974,10 +974,22 @@ static void imx_uart_set_mctrl(struct uart_port *port, unsigned int mctrl)
974 if (!(port->rs485.flags & SER_RS485_ENABLED)) { 974 if (!(port->rs485.flags & SER_RS485_ENABLED)) {
975 u32 ucr2; 975 u32 ucr2;
976 976
977 /*
978 * Turn off autoRTS if RTS is lowered and restore autoRTS
979 * setting if RTS is raised.
980 */
977 ucr2 = imx_uart_readl(sport, UCR2); 981 ucr2 = imx_uart_readl(sport, UCR2);
978 ucr2 &= ~(UCR2_CTS | UCR2_CTSC); 982 ucr2 &= ~(UCR2_CTS | UCR2_CTSC);
979 if (mctrl & TIOCM_RTS) 983 if (mctrl & TIOCM_RTS) {
980 ucr2 |= UCR2_CTS | UCR2_CTSC; 984 ucr2 |= UCR2_CTS;
985 /*
986 * UCR2_IRTS is unset if and only if the port is
987 * configured for CRTSCTS, so we use inverted UCR2_IRTS
988 * to get the state to restore to.
989 */
990 if (!(ucr2 & UCR2_IRTS))
991 ucr2 |= UCR2_CTSC;
992 }
981 imx_uart_writel(sport, ucr2, UCR2); 993 imx_uart_writel(sport, ucr2, UCR2);
982 } 994 }
983 995