serial: 8250_fintek: Disable delays for ports != 0
authorRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Mon, 6 Nov 2017 10:49:13 +0000 (11:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Nov 2017 12:09:35 +0000 (13:09 +0100)
According to the datasheet, only the first port supports delay before
send and delay after send.

Reported-by: "Ji-Ze Hong (Peter Hong)" <hpeter@gmail.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_fintek.c

index 6c7910d..ae7d86e 100644 (file)
@@ -212,6 +212,12 @@ static int fintek_8250_rs485_config(struct uart_port *port,
        rs485->flags &= SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND |
                        SER_RS485_RTS_AFTER_SEND;
 
+       /* Only the first port supports delays */
+       if (pdata->index) {
+               rs485->delay_rts_before_send = 0;
+               rs485->delay_rts_after_send = 0;
+       }
+
        if (rs485->delay_rts_before_send) {
                rs485->delay_rts_before_send = 1;
                config |= TXW4C_IRA;