diff options
author | Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> | 2017-05-23 15:02:46 +0530 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2020-02-09 22:45:35 +0100 |
commit | 99661d9d53174281c034a13eee1b80c265ddb04f (patch) | |
tree | 16449bc86ef987f383146c74123c1608c128e453 /drivers/tty/serial | |
parent | 2bdeee05c7f92a1ceef50d3b456c6c59e1bc6737 (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>
Diffstat (limited to 'drivers/tty/serial')
-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 8c13bb5d6a42..ee6d62966572 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; |