@@ -743,7 +743,13 @@ static void sc16is7xx_tx_proc(struct kthread_work *ws)
struct uart_port *port = &(to_sc16is7xx_one(ws, tx_work)->port);
if ((port->rs485.flags & SER_RS485_ENABLED) &&
- (port->rs485.delay_rts_before_send > 0))
+ (port->rs485.delay_rts_before_send > 0) &&
+ (port->rs485.flags & SER_RS485_DELAY_IN_USEC))
+ usleep_range(port->rs485.delay_rts_before_send,
+ port->rs485.delay_rts_before_send);
+ else if ((port->rs485.flags & SER_RS485_ENABLED) &&
+ (port->rs485.delay_rts_before_send > 0) &&
+ !(port->rs485.flags & SER_RS485_DELAY_IN_USEC))
msleep(port->rs485.delay_rts_before_send);
sc16is7xx_handle_tx(port);
Read struct serial_rs485's flag SER_RS485_DELAY_IN_USEC and apply the delay accordingly. Signed-off-by: Martin Kepplinger <martin.kepplinger@ginzinger.com> --- drivers/tty/serial/sc16is7xx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)