From: Fugang Duan Date: Fri, 19 Sep 2014 07:26:40 +0000 (+0800) Subject: serial: imx: fix throttle/unthrottle callbacks for hardware assisted flow control X-Git-Tag: firefly_0821_release~176^2~3120^2~13 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bb2f861ad00fc09dab955d22280c51cead795bca;p=firefly-linux-kernel-4.4.55.git serial: imx: fix throttle/unthrottle callbacks for hardware assisted flow control when the 'CTSC' bit is negated. 'CTS' has no function when 'CTSC' is asserted. 0: The CTS pin is high (inactive) 1: The CTS pin is low (active) For throttle, it needs to clear 'CTS' and 'CTSC' bits. For unthrottle, it needs to enable 'CTS' and 'CTSC' bits. The patch just fix the issue. Signed-off-by: Fugang Duan Signed-off-by: Huang Shijie Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index be13eb39fbf4..c7683d747c18 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -817,11 +817,9 @@ static void imx_set_mctrl(struct uart_port *port, unsigned int mctrl) struct imx_port *sport = (struct imx_port *)port; unsigned long temp; - temp = readl(sport->port.membase + UCR2) & ~UCR2_CTS; - + temp = readl(sport->port.membase + UCR2) & ~(UCR2_CTS | UCR2_CTSC); if (mctrl & TIOCM_RTS) - if (!sport->dma_is_enabled) - temp |= UCR2_CTS; + temp |= UCR2_CTS | UCR2_CTSC; writel(temp, sport->port.membase + UCR2);