sc16is7xx: implemented set_mctrl
authorMaarten Brock <m.brock@vanmierlo.com>
Sun, 14 Feb 2016 14:05:25 +0000 (15:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Feb 2016 01:39:36 +0000 (17:39 -0800)
Add support for manual setting the modem control lines.

Signed-off-by: Maarten Brock <m.brock@vanmierlo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sc16is7xx.c

index 311e7bc07a2448242b072ec99d3730aa7cf878c8..025a4264430e80d280d2144828a51f5f79482a86 100644 (file)
@@ -761,12 +761,20 @@ static void sc16is7xx_reg_proc(struct kthread_work *ws)
        memset(&one->config, 0, sizeof(one->config));
        spin_unlock_irqrestore(&one->port.lock, irqflags);
 
-       if (config.flags & SC16IS7XX_RECONF_MD)
+       if (config.flags & SC16IS7XX_RECONF_MD) {
                sc16is7xx_port_update(&one->port, SC16IS7XX_MCR_REG,
                                      SC16IS7XX_MCR_LOOP_BIT,
                                      (one->port.mctrl & TIOCM_LOOP) ?
                                      SC16IS7XX_MCR_LOOP_BIT : 0);
-
+               sc16is7xx_port_update(&one->port, SC16IS7XX_MCR_REG,
+                                     SC16IS7XX_MCR_RTS_BIT,
+                                     (one->port.mctrl & TIOCM_RTS) ?
+                                     SC16IS7XX_MCR_RTS_BIT : 0);
+               sc16is7xx_port_update(&one->port, SC16IS7XX_MCR_REG,
+                                     SC16IS7XX_MCR_DTR_BIT,
+                                     (one->port.mctrl & TIOCM_DTR) ?
+                                     SC16IS7XX_MCR_DTR_BIT : 0);
+       }
        if (config.flags & SC16IS7XX_RECONF_IER)
                sc16is7xx_port_update(&one->port, SC16IS7XX_IER_REG,
                                      config.ier_clear, 0);