summaryrefslogtreecommitdiff
path: root/recipes-kernel/linux
diff options
context:
space:
mode:
authorSerhii Voloshynov <serhii.voloshynov@globallogic.com>2022-01-11 14:30:05 +0200
committerSerhii Voloshynov <serhii.voloshynov@globallogic.com>2022-01-11 14:30:05 +0200
commit83b181fb3210fb09a3e4a5c9ef3d3b755fd1b85e (patch)
treeba53d67863199d7bca67e3448a109497b1980758 /recipes-kernel/linux
parent8d8681be8ea784d03d47668c8182e8efe31f9a33 (diff)
downloadmeta-multitech-atmel-83b181fb3210fb09a3e4a5c9ef3d3b755fd1b85e.tar.gz
meta-multitech-atmel-83b181fb3210fb09a3e4a5c9ef3d3b755fd1b85e.tar.bz2
meta-multitech-atmel-83b181fb3210fb09a3e4a5c9ef3d3b755fd1b85e.zip
Disable CRTSCTS when setting RS485 half duplex to match Vizzini driver - adaptation for 5.4 kernel
Diffstat (limited to 'recipes-kernel/linux')
-rw-r--r--recipes-kernel/linux/linux-at91-5.4.81/mtcdt/linux-5.4-rs485-atmel-crtscts.patch23
-rw-r--r--recipes-kernel/linux/linux-at91_5.4.81.bb1
2 files changed, 24 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-at91-5.4.81/mtcdt/linux-5.4-rs485-atmel-crtscts.patch b/recipes-kernel/linux/linux-at91-5.4.81/mtcdt/linux-5.4-rs485-atmel-crtscts.patch
new file mode 100644
index 0000000..d17ed37
--- /dev/null
+++ b/recipes-kernel/linux/linux-at91-5.4.81/mtcdt/linux-5.4-rs485-atmel-crtscts.patch
@@ -0,0 +1,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
+
diff --git a/recipes-kernel/linux/linux-at91_5.4.81.bb b/recipes-kernel/linux/linux-at91_5.4.81.bb
index f57d418..9a427d2 100644
--- a/recipes-kernel/linux/linux-at91_5.4.81.bb
+++ b/recipes-kernel/linux/linux-at91_5.4.81.bb
@@ -45,6 +45,7 @@ COMMON_PATCHES = " \
file://linux-5.4-OF-DT-Overlay-configfs-interface.patch \
file://linux-5.4-revert-net-macb-Properly-handle-phylink-on-at91rm9200.patch \
file://linux-5.4-bring-back-PAE-bit-and-fix-NCFGR-values-applicable-f.patch \
+ file://linux-5.4-rs485-atmel-crtscts.patch \
file://mt-at91.h \
"