Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Rafael Gago Castano <rgc@hms.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Rafael Gago and committed by
Greg Kroah-Hartman
6eaf0b95 e50af488

+3 -4
+3 -4
drivers/tty/serial/omap-serial.c
··· 1602 1602 struct device_node *np) 1603 1603 { 1604 1604 struct serial_rs485 *rs485conf = &up->port.rs485; 1605 - enum of_gpio_flags flags; 1606 1605 int ret; 1607 1606 1608 1607 rs485conf->flags = 0; ··· 1621 1622 } 1622 1623 1623 1624 /* check for tx enable gpio */ 1624 - up->rts_gpio = of_get_named_gpio_flags(np, "rts-gpio", 0, &flags); 1625 + up->rts_gpio = of_get_named_gpio(np, "rts-gpio", 0); 1625 1626 if (gpio_is_valid(up->rts_gpio)) { 1626 1627 ret = devm_gpio_request(up->dev, up->rts_gpio, "omap-serial"); 1627 1628 if (ret < 0) 1628 1629 return ret; 1629 - ret = gpio_direction_output(up->rts_gpio, 1630 - flags & SER_RS485_RTS_AFTER_SEND); 1630 + ret = rs485conf->flags & SER_RS485_RTS_AFTER_SEND ? 1 : 0; 1631 + ret = gpio_direction_output(up->rts_gpio, ret); 1631 1632 if (ret < 0) 1632 1633 return ret; 1633 1634 } else if (up->rts_gpio == -EPROBE_DEFER) {