diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/usb/serial/ch341.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/usb/serial/ch341.c')
-rw-r--r-- | drivers/usb/serial/ch341.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index 63f7cc45bcac..6ae1c0688b5e 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c | |||
@@ -75,6 +75,7 @@ static int debug; | |||
75 | static const struct usb_device_id id_table[] = { | 75 | static const struct usb_device_id id_table[] = { |
76 | { USB_DEVICE(0x4348, 0x5523) }, | 76 | { USB_DEVICE(0x4348, 0x5523) }, |
77 | { USB_DEVICE(0x1a86, 0x7523) }, | 77 | { USB_DEVICE(0x1a86, 0x7523) }, |
78 | { USB_DEVICE(0x1a86, 0x5523) }, | ||
78 | { }, | 79 | { }, |
79 | }; | 80 | }; |
80 | MODULE_DEVICE_TABLE(usb, id_table); | 81 | MODULE_DEVICE_TABLE(usb, id_table); |
@@ -431,7 +432,7 @@ out: | |||
431 | kfree(break_reg); | 432 | kfree(break_reg); |
432 | } | 433 | } |
433 | 434 | ||
434 | static int ch341_tiocmset(struct tty_struct *tty, struct file *file, | 435 | static int ch341_tiocmset(struct tty_struct *tty, |
435 | unsigned int set, unsigned int clear) | 436 | unsigned int set, unsigned int clear) |
436 | { | 437 | { |
437 | struct usb_serial_port *port = tty->driver_data; | 438 | struct usb_serial_port *port = tty->driver_data; |
@@ -486,12 +487,22 @@ static void ch341_read_int_callback(struct urb *urb) | |||
486 | if (actual_length >= 4) { | 487 | if (actual_length >= 4) { |
487 | struct ch341_private *priv = usb_get_serial_port_data(port); | 488 | struct ch341_private *priv = usb_get_serial_port_data(port); |
488 | unsigned long flags; | 489 | unsigned long flags; |
490 | u8 prev_line_status = priv->line_status; | ||
489 | 491 | ||
490 | spin_lock_irqsave(&priv->lock, flags); | 492 | spin_lock_irqsave(&priv->lock, flags); |
491 | priv->line_status = (~(data[2])) & CH341_BITS_MODEM_STAT; | 493 | priv->line_status = (~(data[2])) & CH341_BITS_MODEM_STAT; |
492 | if ((data[1] & CH341_MULT_STAT)) | 494 | if ((data[1] & CH341_MULT_STAT)) |
493 | priv->multi_status_change = 1; | 495 | priv->multi_status_change = 1; |
494 | spin_unlock_irqrestore(&priv->lock, flags); | 496 | spin_unlock_irqrestore(&priv->lock, flags); |
497 | |||
498 | if ((priv->line_status ^ prev_line_status) & CH341_BIT_DCD) { | ||
499 | struct tty_struct *tty = tty_port_tty_get(&port->port); | ||
500 | if (tty) | ||
501 | usb_serial_handle_dcd_change(port, tty, | ||
502 | priv->line_status & CH341_BIT_DCD); | ||
503 | tty_kref_put(tty); | ||
504 | } | ||
505 | |||
495 | wake_up_interruptible(&priv->delta_msr_wait); | 506 | wake_up_interruptible(&priv->delta_msr_wait); |
496 | } | 507 | } |
497 | 508 | ||
@@ -542,8 +553,7 @@ static int wait_modem_info(struct usb_serial_port *port, unsigned int arg) | |||
542 | return 0; | 553 | return 0; |
543 | } | 554 | } |
544 | 555 | ||
545 | /*static int ch341_ioctl(struct usb_serial_port *port, struct file *file,*/ | 556 | static int ch341_ioctl(struct tty_struct *tty, |
546 | static int ch341_ioctl(struct tty_struct *tty, struct file *file, | ||
547 | unsigned int cmd, unsigned long arg) | 557 | unsigned int cmd, unsigned long arg) |
548 | { | 558 | { |
549 | struct usb_serial_port *port = tty->driver_data; | 559 | struct usb_serial_port *port = tty->driver_data; |
@@ -562,7 +572,7 @@ static int ch341_ioctl(struct tty_struct *tty, struct file *file, | |||
562 | return -ENOIOCTLCMD; | 572 | return -ENOIOCTLCMD; |
563 | } | 573 | } |
564 | 574 | ||
565 | static int ch341_tiocmget(struct tty_struct *tty, struct file *file) | 575 | static int ch341_tiocmget(struct tty_struct *tty) |
566 | { | 576 | { |
567 | struct usb_serial_port *port = tty->driver_data; | 577 | struct usb_serial_port *port = tty->driver_data; |
568 | struct ch341_private *priv = usb_get_serial_port_data(port); | 578 | struct ch341_private *priv = usb_get_serial_port_data(port); |