[PATCH v2 16/22] usb: serial: ti_usb_3410_5052: Raise DTR and RTS flags if speed is not null anymore

Mathieu OTHACEHE
2016-07-26T18:04:20Z

If speed is non null anymore, we can raise DTR and RTS flags in
ti_set_termios.

Signed-off-by: Mathieu OTHACEHE <m.othacehe@gmail.com>
---
drivers/usb/serial/ti_usb_3410_5052.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index d488237..472971b 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -1111,6 +1111,9 @@ static void ti_set_termios(struct tty_struct *tty,
/* if baud rate is B0, clear RTS and DTR */
if (C_BAUD(tty) == B0)
mcr &= ~(TI_MCR_DTR | TI_MCR_RTS);
+ else if (old_termios && (old_termios->c_cflag & CBAUD) == B0)
+ mcr |= TI_MCR_DTR | TI_MCR_RTS;
+
status = ti_set_mcr(tport, mcr);
if (status)
dev_err(&port->dev,
--
2.9.0