summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorJakub Kicinski <kubakici@wp.pl>2015-05-29 21:20:26 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-06-01 06:45:28 +0900
commit5451bb29f725c099e7ea78262610c8c1b6caf008 (patch)
treedf9cb1b631504b63c3cfaab376830993b783c0c6 /drivers/tty
parent8f4a91202203624cbd8fe565cbdd5c876b652a5d (diff)
sc16is7xx: remove RS-485 delay RTS handling
Users of RS-485 can request via ioctl that RTS signals should be activated selected number of milliseconds before the actual data transmission or delay reception certain number of milli- seconds after the transmission is finished. In sc16is7xx, however, RTS signalling is handled by the hardware and driver has no way of providing this feature. We still try to provide .delay_rts_before_send by delaying transmission but without actual effect on the RTS line. Note: this change will make the driver return -EINVAL when the feature is requested (.delay_rts_after_send is set). Signed-off-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/sc16is7xx.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index d1c046da7853..64b1b9db1299 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -652,21 +652,6 @@ static void sc16is7xx_wq_proc(struct work_struct *ws)
static void sc16is7xx_stop_tx(struct uart_port* port)
{
- struct sc16is7xx_one *one = to_sc16is7xx_one(port, port);
- struct circ_buf *xmit = &one->port.state->xmit;
-
- /* handle rs485 */
- if (port->rs485.flags & SER_RS485_ENABLED) {
- /* do nothing if current tx not yet completed */
- int lsr = sc16is7xx_port_read(port, SC16IS7XX_LSR_REG);
- if (!(lsr & SC16IS7XX_LSR_TEMT_BIT))
- return;
-
- if (uart_circ_empty(xmit) &&
- (port->rs485.delay_rts_after_send > 0))
- mdelay(port->rs485.delay_rts_after_send);
- }
-
sc16is7xx_port_update(port, SC16IS7XX_IER_REG,
SC16IS7XX_IER_THRI_BIT,
0);
@@ -852,6 +837,14 @@ static int sc16is7xx_config_rs485(struct uart_port *port,
dev_err(port->dev,
"unsupported RTS signalling on_send:%d after_send:%d - exactly one of RS485 RTS flags should be set\n",
rts_during_tx, rts_during_rx);
+
+ /*
+ * RTS signal is handled by HW, it's timing can't be influenced.
+ * However, it's sometimes useful to delay TX even without RTS
+ * control therefore we try to handle .delay_rts_before_send.
+ */
+ if (rs485->delay_rts_after_send)
+ return -EINVAL;
}
sc16is7xx_port_update(port, SC16IS7XX_EFCR_REG, mask, efcr);