diff options
Diffstat (limited to 'drivers/usb/class/cdc-acm.c')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index f763ed7ba91e..6e49ec6f3adc 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <linux/serial.h> | 39 | #include <linux/serial.h> |
40 | #include <linux/tty_driver.h> | 40 | #include <linux/tty_driver.h> |
41 | #include <linux/tty_flip.h> | 41 | #include <linux/tty_flip.h> |
42 | #include <linux/serial.h> | ||
43 | #include <linux/module.h> | 42 | #include <linux/module.h> |
44 | #include <linux/mutex.h> | 43 | #include <linux/mutex.h> |
45 | #include <linux/uaccess.h> | 44 | #include <linux/uaccess.h> |
@@ -818,15 +817,11 @@ static const __u32 acm_tty_speed[] = { | |||
818 | 2500000, 3000000, 3500000, 4000000 | 817 | 2500000, 3000000, 3500000, 4000000 |
819 | }; | 818 | }; |
820 | 819 | ||
821 | static const __u8 acm_tty_size[] = { | ||
822 | 5, 6, 7, 8 | ||
823 | }; | ||
824 | |||
825 | static void acm_tty_set_termios(struct tty_struct *tty, | 820 | static void acm_tty_set_termios(struct tty_struct *tty, |
826 | struct ktermios *termios_old) | 821 | struct ktermios *termios_old) |
827 | { | 822 | { |
828 | struct acm *acm = tty->driver_data; | 823 | struct acm *acm = tty->driver_data; |
829 | struct ktermios *termios = tty->termios; | 824 | struct ktermios *termios = &tty->termios; |
830 | struct usb_cdc_line_coding newline; | 825 | struct usb_cdc_line_coding newline; |
831 | int newctrl = acm->ctrlout; | 826 | int newctrl = acm->ctrlout; |
832 | 827 | ||
@@ -835,7 +830,21 @@ static void acm_tty_set_termios(struct tty_struct *tty, | |||
835 | newline.bParityType = termios->c_cflag & PARENB ? | 830 | newline.bParityType = termios->c_cflag & PARENB ? |
836 | (termios->c_cflag & PARODD ? 1 : 2) + | 831 | (termios->c_cflag & PARODD ? 1 : 2) + |
837 | (termios->c_cflag & CMSPAR ? 2 : 0) : 0; | 832 | (termios->c_cflag & CMSPAR ? 2 : 0) : 0; |
838 | newline.bDataBits = acm_tty_size[(termios->c_cflag & CSIZE) >> 4]; | 833 | switch (termios->c_cflag & CSIZE) { |
834 | case CS5: | ||
835 | newline.bDataBits = 5; | ||
836 | break; | ||
837 | case CS6: | ||
838 | newline.bDataBits = 6; | ||
839 | break; | ||
840 | case CS7: | ||
841 | newline.bDataBits = 7; | ||
842 | break; | ||
843 | case CS8: | ||
844 | default: | ||
845 | newline.bDataBits = 8; | ||
846 | break; | ||
847 | } | ||
839 | /* FIXME: Needs to clear unsupported bits in the termios */ | 848 | /* FIXME: Needs to clear unsupported bits in the termios */ |
840 | acm->clocal = ((termios->c_cflag & CLOCAL) != 0); | 849 | acm->clocal = ((termios->c_cflag & CLOCAL) != 0); |
841 | 850 | ||
@@ -1234,7 +1243,7 @@ made_compressed_probe: | |||
1234 | 1243 | ||
1235 | if (usb_endpoint_xfer_int(epwrite)) | 1244 | if (usb_endpoint_xfer_int(epwrite)) |
1236 | usb_fill_int_urb(snd->urb, usb_dev, | 1245 | usb_fill_int_urb(snd->urb, usb_dev, |
1237 | usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress), | 1246 | usb_sndintpipe(usb_dev, epwrite->bEndpointAddress), |
1238 | NULL, acm->writesize, acm_write_bulk, snd, epwrite->bInterval); | 1247 | NULL, acm->writesize, acm_write_bulk, snd, epwrite->bInterval); |
1239 | else | 1248 | else |
1240 | usb_fill_bulk_urb(snd->urb, usb_dev, | 1249 | usb_fill_bulk_urb(snd->urb, usb_dev, |
@@ -1299,7 +1308,8 @@ skip_countries: | |||
1299 | usb_set_intfdata(data_interface, acm); | 1308 | usb_set_intfdata(data_interface, acm); |
1300 | 1309 | ||
1301 | usb_get_intf(control_interface); | 1310 | usb_get_intf(control_interface); |
1302 | tty_register_device(acm_tty_driver, minor, &control_interface->dev); | 1311 | tty_port_register_device(&acm->port, acm_tty_driver, minor, |
1312 | &control_interface->dev); | ||
1303 | 1313 | ||
1304 | return 0; | 1314 | return 0; |
1305 | alloc_fail7: | 1315 | alloc_fail7: |
@@ -1551,6 +1561,9 @@ static const struct usb_device_id acm_ids[] = { | |||
1551 | Maybe we should define a new | 1561 | Maybe we should define a new |
1552 | quirk for this. */ | 1562 | quirk for this. */ |
1553 | }, | 1563 | }, |
1564 | { USB_DEVICE(0x0572, 0x1340), /* Conexant CX93010-2x UCMxx */ | ||
1565 | .driver_info = NO_UNION_NORMAL, | ||
1566 | }, | ||
1554 | { USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */ | 1567 | { USB_DEVICE(0x1bbb, 0x0003), /* Alcatel OT-I650 */ |
1555 | .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ | 1568 | .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */ |
1556 | }, | 1569 | }, |