[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190221171758.10322-6-martin.kepplinger@ginzinger.com>
Date: Thu, 21 Feb 2019 18:17:55 +0100
From: Martin Kepplinger <martin.kepplinger@...zinger.com>
To: <gregkh@...uxfoundation.org>, <robh+dt@...nel.org>,
<mark.rutland@....com>, <jslaby@...e.com>, <corbet@....net>,
<richard.genoud@...il.com>, <nicolas.ferre@...rochip.com>,
<alexandre.belloni@...tlin.com>, <ludovic.desroches@...rochip.com>,
<mcoquelin.stm32@...il.com>, <alexandre.torgue@...com>,
<linux-serial@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-stm32@...md-mailman.stormreply.com>
CC: <linux-kernel@...r.kernel.org>,
Martin Kepplinger <martin.kepplinger@...zinger.com>
Subject: [PATCH v2 6/9] serial: sc16is7xx: add support for rs485 RTS delays in microseconds
Read struct serial_rs485's flag SER_RS485_DELAY_IN_USEC and apply the delay
accordingly.
Signed-off-by: Martin Kepplinger <martin.kepplinger@...zinger.com>
---
drivers/tty/serial/sc16is7xx.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 635178cf3eed..b0e00b9fb177 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -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);
--
2.20.1
Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (3616 bytes)
Powered by blists - more mailing lists