[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200318142640.982763-2-heiko@sntech.de>
Date: Wed, 18 Mar 2020 15:26:34 +0100
From: Heiko Stuebner <heiko@...ech.de>
To: gregkh@...uxfoundation.org
Cc: jslaby@...e.com, andriy.shevchenko@...ux.intel.com,
matwey.kornilov@...il.com, linux-serial@...r.kernel.org,
linux-kernel@...r.kernel.org, heiko@...ech.de,
Giulio Benetti <giulio.benetti@...ronovasrl.com>,
Heiko Stuebner <heiko.stuebner@...obroma-systems.com>
Subject: [PATCH 1/7] serial: 8250: Make em485_rts_after_send() set mctrl according to rts state.
From: Giulio Benetti <giulio.benetti@...ronovasrl.com>
When rs485 enabled and RTS_AFTER_SEND set on startup, need to preserve
mctrl status, because later functions will call set_mctrl passing
port->mctrl=0 overriding rts status, resulting in rts pin in
transmission when idle.
Make mctrl reflect rts pin state.
Signed-off-by: Giulio Benetti <giulio.benetti@...ronovasrl.com>
Signed-off-by: Heiko Stuebner <heiko.stuebner@...obroma-systems.com>
---
drivers/tty/serial/8250/8250_port.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
index 8407166610ce..67aa3a2a9afa 100644
--- a/drivers/tty/serial/8250/8250_port.c
+++ b/drivers/tty/serial/8250/8250_port.c
@@ -565,10 +565,13 @@ static inline void serial8250_em485_rts_after_send(struct uart_8250_port *p)
{
unsigned char mcr = serial8250_in_MCR(p);
- if (p->port.rs485.flags & SER_RS485_RTS_AFTER_SEND)
+ if (p->port.rs485.flags & SER_RS485_RTS_AFTER_SEND) {
mcr |= UART_MCR_RTS;
- else
+ p->port.mctrl |= TIOCM_RTS;
+ } else {
mcr &= ~UART_MCR_RTS;
+ p->port.mctrl &= ~TIOCM_RTS;
+ }
serial8250_out_MCR(p, mcr);
}
--
2.24.1
Powered by blists - more mailing lists