aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ch341.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/ch341.c')
-rw-r--r--drivers/usb/serial/ch341.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index 63f7cc45bcac..7b8815ddf368 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -486,12 +486,22 @@ static void ch341_read_int_callback(struct urb *urb)
486 if (actual_length >= 4) { 486 if (actual_length >= 4) {
487 struct ch341_private *priv = usb_get_serial_port_data(port); 487 struct ch341_private *priv = usb_get_serial_port_data(port);
488 unsigned long flags; 488 unsigned long flags;
489 u8 prev_line_status = priv->line_status;
489 490
490 spin_lock_irqsave(&priv->lock, flags); 491 spin_lock_irqsave(&priv->lock, flags);
491 priv->line_status = (~(data[2])) & CH341_BITS_MODEM_STAT; 492 priv->line_status = (~(data[2])) & CH341_BITS_MODEM_STAT;
492 if ((data[1] & CH341_MULT_STAT)) 493 if ((data[1] & CH341_MULT_STAT))
493 priv->multi_status_change = 1; 494 priv->multi_status_change = 1;
494 spin_unlock_irqrestore(&priv->lock, flags); 495 spin_unlock_irqrestore(&priv->lock, flags);
496
497 if ((priv->line_status ^ prev_line_status) & CH341_BIT_DCD) {
498 struct tty_struct *tty = tty_port_tty_get(&port->port);
499 if (tty)
500 usb_serial_handle_dcd_change(port, tty,
501 priv->line_status & CH341_BIT_DCD);
502 tty_kref_put(tty);
503 }
504
495 wake_up_interruptible(&priv->delta_msr_wait); 505 wake_up_interruptible(&priv->delta_msr_wait);
496 } 506 }
497 507