提交 a3f0b77f 编写于 作者: M Maarten Brock 提交者: Greg Kroah-Hartman

sc16is7xx: implemented get_mctrl

Add support for manual getting the modem control lines.
Signed-off-by: NMaarten Brock <m.brock@vanmierlo.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 b7dfdea8
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册