diff options
author | Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> | 2017-05-23 15:02:46 +0530 |
---|---|---|
committer | Philippe Schenker <philippe.schenker@toradex.com> | 2019-05-24 11:34:15 +0200 |
commit | ed2f24abd5927dadceefdd36349ebbd24a117557 (patch) | |
tree | 1c61e889610df7c203512842e1834875377593e2 | |
parent | eeb6e572f541cd9ee93f82d3b653437c2a06e8b4 (diff) |
tty: serial: imx: Add support for enabling RS485 via device tree
Add support to enable RS485 via device tree
Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
(cherry picked from commit b8e5d21a1351bc0e45ae1762f0799b428d9993ea)
(cherry picked from commit d0fa202ec506027902b3a2a427db4a494df8d64c)
Conflicts:
drivers/tty/serial/imx.c
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
-rw-r--r-- | drivers/tty/serial/imx.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 76a157fd6b4a..2a8062cbe984 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -2120,6 +2120,11 @@ static int serial_imx_probe_dt(struct imx_port *sport, if (of_get_property(np, "rts-gpios", NULL)) sport->have_rtsgpio = 1; + if (of_property_read_bool(np, "linux,rs485-enabled-at-boot-time")) { + sport->port.rs485.flags |= SER_RS485_ENABLED; + sport->port.rs485.flags |= SER_RS485_RTS_AFTER_SEND; + } + return 0; } #else @@ -2187,8 +2192,6 @@ static int serial_imx_probe(struct platform_device *pdev) sport->port.fifosize = 32; 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; sport->port.flags = UPF_BOOT_AUTOCONF; init_timer(&sport->timer); sport->timer.function = imx_timeout; |