diff options
author | Lukas Wunner <lukas@wunner.de> | 2017-11-25 01:26:40 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-28 18:05:19 +0300 |
commit | f1e5b618c1c26cb8b5818e36f996e8c2fbedbeb7 (patch) | |
tree | d75fec5220f2f86305a22a7c877cfe272d85309a /drivers/tty/serial/omap-serial.c | |
parent | 6abe9ea8a5a5904d935b8a482117a7fd9b25f09e (diff) | |
download | linux-f1e5b618c1c26cb8b5818e36f996e8c2fbedbeb7.tar.xz |
serial: core: Support common rs485 binding for RTS polarity
When a driver invokes the uart_get_rs485_mode() helper, set the RTS
polarity to active high by default unless the newly introduced
"rs485-rts-active-low" property was specified.
imx contains a line to set the default RTS polarity to active high,
it is now superfluous and hence deleted.
omap-serial historically defaults to active low and supports an
"rs485-rts-active-high" property to inverse the polarity.
Retain that behavior for compatibility.
Cc: Mark Jackson <mpfj@newflow.co.uk>
Cc: Michał Oleszczyk <oleszczyk.m@gmail.com>
Cc: Rafael Gago Castano <rgc@hms.se>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/omap-serial.c')
-rw-r--r-- | drivers/tty/serial/omap-serial.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 227347548fff..56e683373d6d 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1613,10 +1613,13 @@ static int serial_omap_probe_rs485(struct uart_omap_port *up, uart_get_rs485_mode(up->dev, rs485conf); - if (of_property_read_bool(np, "rs485-rts-active-high")) + if (of_property_read_bool(np, "rs485-rts-active-high")) { rs485conf->flags |= SER_RS485_RTS_ON_SEND; - else + rs485conf->flags &= ~SER_RS485_RTS_AFTER_SEND; + } else { + rs485conf->flags &= ~SER_RS485_RTS_ON_SEND; rs485conf->flags |= SER_RS485_RTS_AFTER_SEND; + } /* check for tx enable gpio */ up->rts_gpio = of_get_named_gpio_flags(np, "rts-gpio", 0, &flags); |