Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168709
b: refs/heads/master
c: d94c7bd
h: refs/heads/master
i:
  168707: 8d36bf8
v: v3
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Nov 18, 2009
1 parent d2b0d05 commit 921f050
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4175f3e31cc7157669aa66d46dc79de6ae0126ce
refs/heads/master: d94c7bd4c1361cab58a21d530078c5673863dcc2
21 changes: 21 additions & 0 deletions trunk/drivers/usb/serial/cp210x.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ static int cp210x_tiocmset_port(struct usb_serial_port *port, struct file *,
static void cp210x_break_ctl(struct tty_struct *, int);
static int cp210x_startup(struct usb_serial *);
static void cp210x_disconnect(struct usb_serial *);
static void cp210x_dtr_rts(struct usb_serial_port *p, int on);
static int cp210x_carrier_raised(struct usb_serial_port *p);

static int debug;

Expand Down Expand Up @@ -143,6 +145,8 @@ static struct usb_serial_driver cp210x_device = {
.tiocmset = cp210x_tiocmset,
.attach = cp210x_startup,
.disconnect = cp210x_disconnect,
.dtr_rts = cp210x_dtr_rts,
.carrier_raised = cp210x_carrier_raised
};

/* Config request types */
Expand Down Expand Up @@ -746,6 +750,14 @@ static int cp210x_tiocmset_port(struct usb_serial_port *port, struct file *file,
return cp210x_set_config(port, CP210X_SET_MHS, &control, 2);
}

static void cp210x_dtr_rts(struct usb_serial_port *p, int on)
{
if (on)
cp210x_tiocmset_port(p, NULL, TIOCM_DTR|TIOCM_RTS, 0);
else
cp210x_tiocmset_port(p, NULL, 0, TIOCM_DTR|TIOCM_RTS);
}

static int cp210x_tiocmget (struct tty_struct *tty, struct file *file)
{
struct usb_serial_port *port = tty->driver_data;
Expand All @@ -768,6 +780,15 @@ static int cp210x_tiocmget (struct tty_struct *tty, struct file *file)
return result;
}

static int cp210x_carrier_raised(struct usb_serial_port *p)
{
unsigned int control;
cp210x_get_config(p, CP210X_GET_MDMSTS, &control, 1);
if (control & CONTROL_DCD)
return 1;
return 0;
}

static void cp210x_break_ctl (struct tty_struct *tty, int break_state)
{
struct usb_serial_port *port = tty->driver_data;
Expand Down

0 comments on commit 921f050

Please sign in to comment.