Commit 6eaf0b95 authored by Rafael Gago's avatar Rafael Gago Committed by Greg Kroah-Hartman

tty: omap-serial: Fix initial on-boot RTS GPIO level

The rs485 flag "SER_RS485_RTS_AFTER_SEND" was wrongly read from the GPIO
flags. This caused the RTS pin to be high during boot.
Signed-off-by: default avatarRafael Gago Castano <rgc@hms.se>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e50af488
......@@ -1602,7 +1602,6 @@ static int serial_omap_probe_rs485(struct uart_omap_port *up,
struct device_node *np)
{
struct serial_rs485 *rs485conf = &up->port.rs485;
enum of_gpio_flags flags;
int ret;
rs485conf->flags = 0;
......@@ -1622,13 +1621,13 @@ static int serial_omap_probe_rs485(struct uart_omap_port *up,
}
/* check for tx enable gpio */
up->rts_gpio = of_get_named_gpio_flags(np, "rts-gpio", 0, &flags);
up->rts_gpio = of_get_named_gpio(np, "rts-gpio", 0);
if (gpio_is_valid(up->rts_gpio)) {
ret = devm_gpio_request(up->dev, up->rts_gpio, "omap-serial");
if (ret < 0)
return ret;
ret = gpio_direction_output(up->rts_gpio,
flags & SER_RS485_RTS_AFTER_SEND);
ret = rs485conf->flags & SER_RS485_RTS_AFTER_SEND ? 1 : 0;
ret = gpio_direction_output(up->rts_gpio, ret);
if (ret < 0)
return ret;
} else if (up->rts_gpio == -EPROBE_DEFER) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment