summaryrefslogtreecommitdiff
path: root/recipes-kernel/linux/linux-at91-5.4.81/mtcdt/linux-5.4-rs485-atmel-crtscts.patch
blob: d17ed3743d4e71ae95e54c29a521686b05fbcf8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
This patch allows RS485 Half Duplex (ATMEL_US_USMODE_RS485 is half duplex) to
work even if handshaking is turned on.  This mimics the behavior of the EXAR
USB/Serial driver known as Vizzini.  It is impossible to use handshaking when
using ATMEL_US_USMODE_RS485.  This provides compatibility between MTCDT-0.1 and
MTCDT-0.2.
=======================================================================================
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 28d4a92c0d63..2d17558a807d 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -2250,6 +2250,9 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
 		atmel_uart_writel(port, ATMEL_US_TTGR,
 				  port->rs485.delay_rts_after_send);
 		mode |= ATMEL_US_USMODE_RS485;
+		/* CRTSCTS is impossible in RS485 mode, and breaks the driver
+		 * so we cannot do a send. */
+		termios->c_cflag &= ~CRTSCTS;
 	} else if (port->iso7816.flags & SER_ISO7816_ENABLED) {
 		atmel_uart_writel(port, ATMEL_US_TTGR, port->iso7816.tg);
 		/* select mck clock, and output  */
-- 
2.25.1