lkml.org 
[lkml]   [2017]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] serial: imx: allow enabling RX during TX operation with DT option
Date
This commit changes the driver behaviour: new default is no RX during
TX when RS485 is also enabled, so boards requiring this should explicitly
enable rs485-rx-during-tx in their device trees.

Signed-off-by: Alexey Ignatov <lexszero@gmail.com>
---
drivers/tty/serial/imx.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 38c55c309953..a1d4ed71312f 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2050,6 +2050,10 @@ static int serial_imx_probe_dt(struct imx_port *sport,

if (of_property_read_bool(np, "linux,rs485-enabled-at-boot-time"))
sport->port.rs485.flags |= SER_RS485_ENABLED;
+
+ if (of_get_property(np, "rs485-rx-during-tx", NULL))
+ sport->port.rs485.flags |= SER_RS485_RX_DURING_TX;
+
return 0;
}
#else
@@ -2112,7 +2116,7 @@ static int serial_imx_probe(struct platform_device *pdev)
sport->port.ops = &imx_pops;
sport->port.rs485_config = imx_rs485_config;
sport->port.rs485.flags |=
- SER_RS485_RTS_ON_SEND | SER_RS485_RX_DURING_TX;
+ SER_RS485_RTS_ON_SEND;
sport->port.flags = UPF_BOOT_AUTOCONF;
init_timer(&sport->timer);
sport->timer.function = imx_timeout;
--
2.12.2
\
 
 \ /
  Last update: 2017-04-18 18:57    [W:0.102 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site