summaryrefslogtreecommitdiff
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorMaarten Brock <m.brock@vanmierlo.com>2016-02-14 15:05:26 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-14 17:39:36 -0800
commita3f0b77f36ca5c5871fb8daf7e66fa409abe1ed5 (patch)
tree886eea57b71b25383edf40fd21c2c3a0c198aefd /drivers/tty/serial
parentb7dfdea85917909b0b85913a0a727ff9dfd047f7 (diff)
sc16is7xx: implemented get_mctrl
Add support for manual getting the modem control lines. Signed-off-by: Maarten Brock <m.brock@vanmierlo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/sc16is7xx.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 025a4264430e..e78fa99475c0 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -822,10 +822,16 @@ static unsigned int sc16is7xx_tx_empty(struct uart_port *port)
static unsigned int sc16is7xx_get_mctrl(struct uart_port *port)
{
- /* DCD and DSR are not wired and CTS/RTS is handled automatically
- * so just indicate DSR and CAR asserted
- */
- return TIOCM_DSR | TIOCM_CAR;
+ unsigned int msr;
+ unsigned int ret = 0;
+
+ msr = sc16is7xx_port_read(port, SC16IS7XX_MSR_REG);
+
+ ret |= (msr & SC16IS7XX_MSR_CTS_BIT) ? TIOCM_CTS : 0;
+ ret |= (msr & SC16IS7XX_MSR_DSR_BIT) ? TIOCM_DSR : 0;
+ ret |= (msr & SC16IS7XX_MSR_RI_BIT) ? TIOCM_RNG : 0;
+ ret |= (msr & SC16IS7XX_MSR_CD_BIT) ? TIOCM_CAR : 0;
+ return ret;
}
static void sc16is7xx_set_mctrl(struct uart_port *port, unsigned int mctrl)