summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-09-21 10:13:11 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-03 20:23:38 +0200
commit8b25deb18ba3f9b1af1ff9395b8de2bdb9d9fdbf (patch)
treec6f08949e78420cbf169fd370e7c39947a97b51b
parentbe7da1a2b714a387e6ac5e3db21a1760c9969ae0 (diff)
serial: imx: Use common rs485 device tree parsing function
This adds support for the rs485 specific properties defined in Documentation/devicetree/bindings/serial/rs485.txt. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Forwarded: id:20170913081833.2740-7-u.kleine-koenig@pengutronix.de (v5) Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/imx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index fe368a46f8fe..283cfd96c0f8 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2051,6 +2051,8 @@ static int serial_imx_probe_dt(struct imx_port *sport,
if (of_get_property(np, "rts-gpios", NULL))
sport->have_rtsgpio = 1;
+ of_get_rs485_mode(np, &sport->port.rs485);
+
return 0;
}
#else
@@ -2112,7 +2114,7 @@ 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;
+ sport->port.rs485.flags |= SER_RS485_RTS_ON_SEND;
sport->port.flags = UPF_BOOT_AUTOCONF;
init_timer(&sport->timer);
sport->timer.function = imx_timeout;