* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: tty: cp210x: Fix carrier handling tty_port: If we are opened non blocking we still need to raise the carrier
···221221 the port has just hung up or is in another error state */222222 if ((filp->f_flags & O_NONBLOCK) ||223223 (tty->flags & (1 << TTY_IO_ERROR))) {224224+ /* Indicate we are open */225225+ if (tty->termios->c_cflag & CBAUD)226226+ tty_port_raise_dtr_rts(port);224227 port->flags |= ASYNC_NORMAL_ACTIVE;225228 return 0;226229 }
+21
drivers/usb/serial/cp210x.c
···5050static void cp210x_break_ctl(struct tty_struct *, int);5151static int cp210x_startup(struct usb_serial *);5252static void cp210x_disconnect(struct usb_serial *);5353+static void cp210x_dtr_rts(struct usb_serial_port *p, int on);5454+static int cp210x_carrier_raised(struct usb_serial_port *p);53555456static int debug;5557···145143 .tiocmset = cp210x_tiocmset,146144 .attach = cp210x_startup,147145 .disconnect = cp210x_disconnect,146146+ .dtr_rts = cp210x_dtr_rts,147147+ .carrier_raised = cp210x_carrier_raised148148};149149150150/* Config request types */···750746 return cp210x_set_config(port, CP210X_SET_MHS, &control, 2);751747}752748749749+static void cp210x_dtr_rts(struct usb_serial_port *p, int on)750750+{751751+ if (on)752752+ cp210x_tiocmset_port(p, NULL, TIOCM_DTR|TIOCM_RTS, 0);753753+ else754754+ cp210x_tiocmset_port(p, NULL, 0, TIOCM_DTR|TIOCM_RTS);755755+}756756+753757static int cp210x_tiocmget (struct tty_struct *tty, struct file *file)754758{755759 struct usb_serial_port *port = tty->driver_data;···778766 dbg("%s - control = 0x%.2x", __func__, control);779767780768 return result;769769+}770770+771771+static int cp210x_carrier_raised(struct usb_serial_port *p)772772+{773773+ unsigned int control;774774+ cp210x_get_config(p, CP210X_GET_MDMSTS, &control, 1);775775+ if (control & CONTROL_DCD)776776+ return 1;777777+ return 0;781778}782779783780static void cp210x_break_ctl (struct tty_struct *tty, int break_state)