Skip to contentSkip to conversation

serial: imx: fix throttle/unthrottle callbacks for hardware assisted flow control

PATCH New Fugang Duan 1 participant 1 message Sep 19, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: imx: fix throttle/unthrottle callbacks for hardware assisted flow control

From: Fugang Duan <[email protected]>

Quoted 1 line

From datasheet, UCR2[CTS] bit controls the 'CTS' bit and takes effort only

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.

---
 drivers/tty/serial/imx.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/tty/serial/imx.c +2 -4
index 044e86d..070a37e 100644
@@ -823,11 +823,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);
 
Signature · 1 line
1.7.8