diff options
Diffstat (limited to 'drivers/usb/serial/cp210x.c')
-rw-r--r-- | drivers/usb/serial/cp210x.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 4a208fe85bc9..bd254ec97d14 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
@@ -50,6 +50,8 @@ static int cp210x_tiocmset_port(struct usb_serial_port *port, struct file *, | |||
50 | static void cp210x_break_ctl(struct tty_struct *, int); | 50 | static void cp210x_break_ctl(struct tty_struct *, int); |
51 | static int cp210x_startup(struct usb_serial *); | 51 | static int cp210x_startup(struct usb_serial *); |
52 | static void cp210x_disconnect(struct usb_serial *); | 52 | static void cp210x_disconnect(struct usb_serial *); |
53 | static void cp210x_dtr_rts(struct usb_serial_port *p, int on); | ||
54 | static int cp210x_carrier_raised(struct usb_serial_port *p); | ||
53 | 55 | ||
54 | static int debug; | 56 | static int debug; |
55 | 57 | ||
@@ -113,6 +115,7 @@ static struct usb_device_id id_table [] = { | |||
113 | { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */ | 115 | { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */ |
114 | { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */ | 116 | { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */ |
115 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ | 117 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ |
118 | { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */ | ||
116 | { } /* Terminating Entry */ | 119 | { } /* Terminating Entry */ |
117 | }; | 120 | }; |
118 | 121 | ||
@@ -142,6 +145,8 @@ static struct usb_serial_driver cp210x_device = { | |||
142 | .tiocmset = cp210x_tiocmset, | 145 | .tiocmset = cp210x_tiocmset, |
143 | .attach = cp210x_startup, | 146 | .attach = cp210x_startup, |
144 | .disconnect = cp210x_disconnect, | 147 | .disconnect = cp210x_disconnect, |
148 | .dtr_rts = cp210x_dtr_rts, | ||
149 | .carrier_raised = cp210x_carrier_raised | ||
145 | }; | 150 | }; |
146 | 151 | ||
147 | /* Config request types */ | 152 | /* Config request types */ |
@@ -745,6 +750,14 @@ static int cp210x_tiocmset_port(struct usb_serial_port *port, struct file *file, | |||
745 | return cp210x_set_config(port, CP210X_SET_MHS, &control, 2); | 750 | return cp210x_set_config(port, CP210X_SET_MHS, &control, 2); |
746 | } | 751 | } |
747 | 752 | ||
753 | static void cp210x_dtr_rts(struct usb_serial_port *p, int on) | ||
754 | { | ||
755 | if (on) | ||
756 | cp210x_tiocmset_port(p, NULL, TIOCM_DTR|TIOCM_RTS, 0); | ||
757 | else | ||
758 | cp210x_tiocmset_port(p, NULL, 0, TIOCM_DTR|TIOCM_RTS); | ||
759 | } | ||
760 | |||
748 | static int cp210x_tiocmget (struct tty_struct *tty, struct file *file) | 761 | static int cp210x_tiocmget (struct tty_struct *tty, struct file *file) |
749 | { | 762 | { |
750 | struct usb_serial_port *port = tty->driver_data; | 763 | struct usb_serial_port *port = tty->driver_data; |
@@ -767,6 +780,15 @@ static int cp210x_tiocmget (struct tty_struct *tty, struct file *file) | |||
767 | return result; | 780 | return result; |
768 | } | 781 | } |
769 | 782 | ||
783 | static int cp210x_carrier_raised(struct usb_serial_port *p) | ||
784 | { | ||
785 | unsigned int control; | ||
786 | cp210x_get_config(p, CP210X_GET_MDMSTS, &control, 1); | ||
787 | if (control & CONTROL_DCD) | ||
788 | return 1; | ||
789 | return 0; | ||
790 | } | ||
791 | |||
770 | static void cp210x_break_ctl (struct tty_struct *tty, int break_state) | 792 | static void cp210x_break_ctl (struct tty_struct *tty, int break_state) |
771 | { | 793 | { |
772 | struct usb_serial_port *port = tty->driver_data; | 794 | struct usb_serial_port *port = tty->driver_data; |