|
@@ -384,10 +384,6 @@ static void ch341_set_termios(struct tty_struct *tty,
|
|
ctrl |= CH341_LCR_STOP_BITS_2;
|
|
ctrl |= CH341_LCR_STOP_BITS_2;
|
|
|
|
|
|
if (baud_rate) {
|
|
if (baud_rate) {
|
|
- spin_lock_irqsave(&priv->lock, flags);
|
|
|
|
- priv->line_control |= (CH341_BIT_DTR | CH341_BIT_RTS);
|
|
|
|
- spin_unlock_irqrestore(&priv->lock, flags);
|
|
|
|
-
|
|
|
|
priv->baud_rate = baud_rate;
|
|
priv->baud_rate = baud_rate;
|
|
|
|
|
|
r = ch341_init_set_baudrate(port->serial->dev, priv, ctrl);
|
|
r = ch341_init_set_baudrate(port->serial->dev, priv, ctrl);
|
|
@@ -395,14 +391,16 @@ static void ch341_set_termios(struct tty_struct *tty,
|
|
priv->baud_rate = tty_termios_baud_rate(old_termios);
|
|
priv->baud_rate = tty_termios_baud_rate(old_termios);
|
|
tty_termios_copy_hw(&tty->termios, old_termios);
|
|
tty_termios_copy_hw(&tty->termios, old_termios);
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- spin_lock_irqsave(&priv->lock, flags);
|
|
|
|
- priv->line_control &= ~(CH341_BIT_DTR | CH341_BIT_RTS);
|
|
|
|
- spin_unlock_irqrestore(&priv->lock, flags);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- ch341_set_handshake(port->serial->dev, priv->line_control);
|
|
|
|
|
|
+ spin_lock_irqsave(&priv->lock, flags);
|
|
|
|
+ if (C_BAUD(tty) == B0)
|
|
|
|
+ priv->line_control &= ~(CH341_BIT_DTR | CH341_BIT_RTS);
|
|
|
|
+ else if (old_termios && (old_termios->c_cflag & CBAUD) == B0)
|
|
|
|
+ priv->line_control |= (CH341_BIT_DTR | CH341_BIT_RTS);
|
|
|
|
+ spin_unlock_irqrestore(&priv->lock, flags);
|
|
|
|
|
|
|
|
+ ch341_set_handshake(port->serial->dev, priv->line_control);
|
|
}
|
|
}
|
|
|
|
|
|
static void ch341_break_ctl(struct tty_struct *tty, int break_state)
|
|
static void ch341_break_ctl(struct tty_struct *tty, int break_state)
|