linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: imx: fix throttle/unthrottle callbacks for hardware assisted flow control
@ 2014-09-19  7:17 Fugang Duan
  2014-09-19  7:46 ` fugang.duan
  0 siblings, 1 reply; 3+ messages in thread
From: Fugang Duan @ 2014-09-19  7:17 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial, b38611

From: Huang Shijie <b32955@freescale.com>

>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.

Signed-off-by: Fugang Duan  <B38611@freescale.com>
---
 drivers/tty/serial/imx.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 044e86d..070a37e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -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);
 
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] serial: imx: fix throttle/unthrottle callbacks for hardware assisted flow control
@ 2014-09-19  7:26 Fugang Duan
  0 siblings, 0 replies; 3+ messages in thread
From: Fugang Duan @ 2014-09-19  7:26 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial, b38611, shijie8

From: Fugang Duan <B38611@freescale.com>

>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.

Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Huang Shijie <shijie8@gmail.com>
---
 drivers/tty/serial/imx.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 044e86d..070a37e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -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);
 
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] serial: imx: fix throttle/unthrottle callbacks for hardware assisted flow control
  2014-09-19  7:17 Fugang Duan
@ 2014-09-19  7:46 ` fugang.duan
  0 siblings, 0 replies; 3+ messages in thread
From: fugang.duan @ 2014-09-19  7:46 UTC (permalink / raw)
  To: fugang.duan@freescale.com, gregkh@linuxfoundation.org
  Cc: linux-serial@vger.kernel.org

Pls ignore the patch.

From: Fugang Duan <b38611@freescale.com> Sent: Friday, September 19, 2014 3:17 PM
>To: gregkh@linuxfoundation.org
>Cc: linux-serial@vger.kernel.org; Duan Fugang-B38611
>Subject: [PATCH] serial: imx: fix throttle/unthrottle callbacks for
>hardware assisted flow control
>
>From: Huang Shijie <b32955@freescale.com>
>
>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.
>
>Signed-off-by: Fugang Duan  <B38611@freescale.com>
>---
> drivers/tty/serial/imx.c |    6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index
>044e86d..070a37e 100644
>--- a/drivers/tty/serial/imx.c
>+++ b/drivers/tty/serial/imx.c
>@@ -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);
>
>--
>1.7.8


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-19  8:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-19  7:26 [PATCH] serial: imx: fix throttle/unthrottle callbacks for hardware assisted flow control Fugang Duan
  -- strict thread matches above, loose matches on Subject: below --
2014-09-19  7:17 Fugang Duan
2014-09-19  7:46 ` fugang.duan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).