linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Angelo Dureghello <angelo.dureghello@timesys.com>,
	Fugang Duan <fugang.duan@nxp.com>,
	Philippe Schenker <philippe.schenker@toradex.com>,
	Michael Walle <michael@walle.cc>
Subject: [PATCH 6/8] serial: fsl_lpuart: remove manual RTSCTS control from 8-bit LPUART
Date: Tue, 11 May 2021 22:01:46 +0200	[thread overview]
Message-ID: <20210511200148.11934-7-michael@walle.cc> (raw)
In-Reply-To: <20210511200148.11934-1-michael@walle.cc>

The LPUART doesn't have the ability to control the RTS or CTS line
manually. Instead it will set it automatically when data is send or
handle it when data is received. Thus drop the wrong code in set_mctrl.
For the 32 bit version this was already done in the commit 2b30efe2e88a
("tty: serial: lpuart: Remove unnecessary code from set_mctrl"). Keep
the 8-bit version in sync and remove it there, too.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 drivers/tty/serial/fsl_lpuart.c | 28 +---------------------------
 1 file changed, 1 insertion(+), 27 deletions(-)

diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 74c04dba02d4..19714047d571 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -1403,17 +1403,7 @@ static int lpuart32_config_rs485(struct uart_port *port,
 
 static unsigned int lpuart_get_mctrl(struct uart_port *port)
 {
-	unsigned int temp = 0;
-	unsigned char reg;
-
-	reg = readb(port->membase + UARTMODEM);
-	if (reg & UARTMODEM_TXCTSE)
-		temp |= TIOCM_CTS;
-
-	if (reg & UARTMODEM_RXRTSE)
-		temp |= TIOCM_RTS;
-
-	return temp;
+	return 0;
 }
 
 static unsigned int lpuart32_get_mctrl(struct uart_port *port)
@@ -1423,23 +1413,7 @@ static unsigned int lpuart32_get_mctrl(struct uart_port *port)
 
 static void lpuart_set_mctrl(struct uart_port *port, unsigned int mctrl)
 {
-	unsigned char temp;
-	struct lpuart_port *sport = container_of(port,
-				struct lpuart_port, port);
-
-	/* Make sure RXRTSE bit is not set when RS485 is enabled */
-	if (!(sport->port.rs485.flags & SER_RS485_ENABLED)) {
-		temp = readb(sport->port.membase + UARTMODEM) &
-			~(UARTMODEM_RXRTSE | UARTMODEM_TXCTSE);
-
-		if (mctrl & TIOCM_RTS)
-			temp |= UARTMODEM_RXRTSE;
 
-		if (mctrl & TIOCM_CTS)
-			temp |= UARTMODEM_TXCTSE;
-
-		writeb(temp, port->membase + UARTMODEM);
-	}
 }
 
 static void lpuart32_set_mctrl(struct uart_port *port, unsigned int mctrl)
-- 
2.20.1


  parent reply	other threads:[~2021-05-11 20:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 20:01 [PATCH 0/8] serial: fsl_lpuart: sysrq, loopback support and fixes Michael Walle
2021-05-11 20:01 ` [PATCH 1/8] serial: fsl_lpuart: don't modify arbitrary data on lpuart32 Michael Walle
2021-05-11 20:01 ` [PATCH 2/8] serial: fsl_lpuart: use UARTDATA_MASK macro Michael Walle
2021-05-11 20:01 ` [PATCH 3/8] serial: fsl_lpuart: don't restore interrupt state in ISR Michael Walle
2021-05-12  9:25   ` Johan Hovold
2021-05-12  9:42     ` Michael Walle
2021-05-11 20:01 ` [PATCH 4/8] serial: fsl_lpuart: handle break and make sysrq work Michael Walle
2021-05-12  9:30   ` Johan Hovold
2021-05-12  9:46     ` Michael Walle
2021-05-12 10:07       ` Johan Hovold
2021-05-12 10:31         ` Michael Walle
2021-05-12 11:18           ` Johan Hovold
2021-05-11 20:01 ` [PATCH 5/8] serial: fsl_lpuart: remove RTSCTS handling from get_mctrl() Michael Walle
2021-05-11 20:01 ` Michael Walle [this message]
2021-05-11 20:01 ` [PATCH 7/8] serial: fsl_lpuart: add loopback support Michael Walle
2021-05-11 20:01 ` [PATCH 8/8] serial: fsl_lpuart: disable DMA for console and fix sysrq Michael Walle

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=20210511200148.11934-7-michael@walle.cc \
    --to=michael@walle.cc \
    --cc=angelo.dureghello@timesys.com \
    --cc=fugang.duan@nxp.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=philippe.schenker@toradex.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 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).