All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+kernel@arm.linux.org.uk>
To: Tony Lindgren <tony@atomide.com>, Alan Cox <alan@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
	linux-serial@vger.kernel.org
Subject: [RFC 18/24] SERIAL: omap: move xon/xoff setting earlier
Date: Sat, 06 Oct 2012 13:45:07 +0100	[thread overview]
Message-ID: <E1TKTkh-0002na-4w@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20121006123803.GD15246@n2100.arm.linux.org.uk>

Take advantage of the switch to mode B for accessing the TCR register,
and move the xon/xoff configuration there.  This allows further
simplication of this sequence.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/tty/serial/omap-serial.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 22877ac..e786eac 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -871,16 +871,20 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
 	else
 		serial_out(up, UART_OMAP_MDR1, up->mdr1);
 
-	/* Enable access to TCR/TLR */
+	/* Configure flow control */
 	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
+
+	/* XON1/XOFF1 accessible mode B, TCRTLR=0, ECB=0 */
+	serial_out(up, UART_XON1, termios->c_cc[VSTART]);
+	serial_out(up, UART_XOFF1, termios->c_cc[VSTOP]);
+
+	/* Enable access to TCR/TLR */
 	serial_out(up, UART_EFR, up->efr | UART_EFR_ECB);
 	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
 	serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR);
 
 	serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG);
 
-	/* Hardware Flow Control Configuration */
-
 	if (termios->c_cflag & CRTSCTS) {
 		/* Enable AUTORTS and AUTOCTS */
 		up->efr |= UART_EFR_CTS | UART_EFR_RTS;
@@ -897,9 +901,6 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
 	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
 	serial_out(up, UART_EFR, up->efr);
 
-	serial_out(up, UART_XON1, termios->c_cc[VSTART]);
-	serial_out(up, UART_XOFF1, termios->c_cc[VSTOP]);
-
 	/* clear SW control mode bits */
 	up->efr &= OMAP_UART_SW_CLR;
 
-- 
1.7.4.4


WARNING: multiple messages have this Message-ID (diff)
From: rmk+kernel@arm.linux.org.uk (Russell King)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 18/24] SERIAL: omap: move xon/xoff setting earlier
Date: Sat, 06 Oct 2012 13:45:07 +0100	[thread overview]
Message-ID: <E1TKTkh-0002na-4w@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20121006123803.GD15246@n2100.arm.linux.org.uk>

Take advantage of the switch to mode B for accessing the TCR register,
and move the xon/xoff configuration there.  This allows further
simplication of this sequence.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/tty/serial/omap-serial.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 22877ac..e786eac 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -871,16 +871,20 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
 	else
 		serial_out(up, UART_OMAP_MDR1, up->mdr1);
 
-	/* Enable access to TCR/TLR */
+	/* Configure flow control */
 	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
+
+	/* XON1/XOFF1 accessible mode B, TCRTLR=0, ECB=0 */
+	serial_out(up, UART_XON1, termios->c_cc[VSTART]);
+	serial_out(up, UART_XOFF1, termios->c_cc[VSTOP]);
+
+	/* Enable access to TCR/TLR */
 	serial_out(up, UART_EFR, up->efr | UART_EFR_ECB);
 	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
 	serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR);
 
 	serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG);
 
-	/* Hardware Flow Control Configuration */
-
 	if (termios->c_cflag & CRTSCTS) {
 		/* Enable AUTORTS and AUTOCTS */
 		up->efr |= UART_EFR_CTS | UART_EFR_RTS;
@@ -897,9 +901,6 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
 	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
 	serial_out(up, UART_EFR, up->efr);
 
-	serial_out(up, UART_XON1, termios->c_cc[VSTART]);
-	serial_out(up, UART_XOFF1, termios->c_cc[VSTOP]);
-
 	/* clear SW control mode bits */
 	up->efr &= OMAP_UART_SW_CLR;
 
-- 
1.7.4.4

  parent reply	other threads:[~2012-10-06 12:45 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-06 12:38 [RFC 00/24] OMAP serial driver flow control fixes, and preparation for DMA engine conversion Russell King - ARM Linux
2012-10-06 12:38 ` Russell King - ARM Linux
2012-10-06 12:39 ` [RFC 01/24] SERIAL: omap: fix set_mctrl() breakage Russell King
2012-10-06 12:39   ` Russell King
2012-10-06 12:39 ` [RFC 02/24] SERIAL: omap: fix bit masks for software flow control Russell King
2012-10-06 12:39   ` Russell King
2012-10-06 12:40 ` [RFC 03/24] SERIAL: omap: remove setting of EFR SCD bit Russell King
2012-10-06 12:40   ` Russell King
2012-10-06 12:40 ` [RFC 04/24] SERIAL: omap: fix MCR TCRTLR bit handling Russell King
2012-10-06 12:40   ` Russell King
2012-10-06 12:40 ` [RFC 05/24] SERIAL: omap: no need to re-read EFR Russell King
2012-10-06 12:40   ` Russell King
2012-10-06 12:41 ` [RFC 06/24] SERIAL: omap: allow hardware assisted rts/cts modes to be disabled Russell King
2012-10-06 12:41   ` Russell King
2012-10-06 12:41 ` [RFC 07/24] SERIAL: omap: allow hardware assisted IXANY mode " Russell King
2012-10-06 12:41   ` Russell King
2012-10-06 12:41 ` [RFC 08/24] SERIAL: core: use local variable uport in uart_set_termios() Russell King
2012-10-06 12:41   ` Russell King
2012-10-06 12:42 ` [RFC 09/24] SERIAL: core: add hardware assisted s/w flow control support Russell King
2012-10-06 12:42   ` Russell King
2012-10-06 12:42 ` [RFC 10/24] SERIAL: core: add hardware assisted h/w " Russell King
2012-10-06 12:42   ` Russell King
2012-10-06 12:42 ` [RFC 11/24] SERIAL: core: add throttle/unthrottle callbacks for hardware assisted flow control Russell King
2012-10-06 12:42   ` Russell King
2012-10-06 12:43 ` [RFC 12/24] SERIAL: omap: fix " Russell King
2012-10-06 12:43   ` Russell King
2012-10-06 12:43 ` [RFC 13/24] SERIAL: omap: configure xon/xoff before setting modem control lines Russell King
2012-10-06 12:43   ` Russell King
2012-10-06 12:43 ` [RFC 14/24] SERIAL: omap: serial_omap_configure_xonxoff() contents into set_termios Russell King
2012-10-06 12:43   ` Russell King
2012-10-06 12:44 ` [RFC 15/24] SERIAL: omap: don't read back LCR/MCR/EFR Russell King
2012-10-06 12:44   ` Russell King
2012-10-06 12:44 ` [RFC 16/24] SERIAL: omap: simplify Russell King
2012-10-06 12:44   ` Russell King
2012-10-06 12:44 ` [RFC 17/24] SERIAL: omap: always set TCR Russell King
2012-10-06 12:44   ` Russell King
2012-10-06 12:45 ` Russell King [this message]
2012-10-06 12:45   ` [RFC 18/24] SERIAL: omap: move xon/xoff setting earlier Russell King
2012-10-06 12:45 ` [RFC 19/24] SERIAL: omap: simplify (2) Russell King
2012-10-06 12:45   ` Russell King
2012-10-06 12:45 ` [RFC 20/24] SERIAL: core: add xmit buffer allocation callbacks Russell King
2012-10-06 12:45   ` Russell King
2012-10-06 15:49   ` Alan Cox
2012-10-06 15:49     ` Alan Cox
2012-10-06 16:51     ` Russell King - ARM Linux
2012-10-06 16:51       ` Russell King - ARM Linux
2012-10-06 12:46 ` [RFC 21/24] SERIAL: omap: use tx buffer allocation API Russell King
2012-10-06 12:46   ` Russell King
2012-10-06 12:46 ` [RFC 22/24] SERIAL: omap: typesafe conversion from uart_port to uart_omap_port Russell King
2012-10-06 12:46   ` Russell King
2012-10-06 12:46 ` [RFC 23/24] SERIAL: omap: move driver private definitions and structures to driver Russell King
2012-10-06 12:46   ` Russell King
2012-10-06 12:47 ` [RFC 24/24] SERIAL: omap: remove OMAP_UART_SYSC_RESET and OMAP_UART_FIFO_CLR Russell King
2012-10-06 12:47   ` Russell King
2012-10-06 14:23 ` [RFC 00/24] OMAP serial driver flow control fixes, and preparation for DMA engine conversion Russell King - ARM Linux
2012-10-06 14:23   ` Russell King - ARM Linux
2012-10-06 14:39 ` Russell King - ARM Linux
2012-10-06 14:39   ` Russell King - ARM Linux
2012-10-06 15:35 ` Russell King - ARM Linux
2012-10-06 15:35   ` Russell King - ARM Linux
2012-10-06 15:50 ` Alan Cox
2012-10-06 15:50   ` Alan Cox
2012-10-09 13:34 ` Sourav
2012-10-09 13:34   ` Sourav
2012-10-10 18:29   ` Kevin Hilman
2012-10-10 18:29     ` Kevin Hilman
2012-10-11  9:43     ` Sourav
2012-10-11  9:43       ` Sourav
2012-10-11  9:54       ` Russell King - ARM Linux
2012-10-11  9:54         ` Russell King - ARM Linux
2012-10-11 10:21         ` Sourav
2012-10-11 10:21           ` Sourav
2012-10-11 11:08           ` Russell King - ARM Linux
2012-10-11 11:08             ` Russell King - ARM Linux
2012-10-11 14:05           ` Jon Hunter
2012-10-11 14:05             ` Jon Hunter
2012-10-12 14:51           ` Grazvydas Ignotas
2012-10-12 14:51             ` Grazvydas Ignotas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1TKTkh-0002na-4w@rmk-PC.arm.linux.org.uk \
    --to=rmk+kernel@arm.linux.org.uk \
    --cc=alan@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.