diff options
Diffstat (limited to 'drivers/usb/serial/mos7840.c')
-rw-r--r-- | drivers/usb/serial/mos7840.c | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 2c20e88a91b3..84fb1dcd30dc 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
@@ -38,7 +38,7 @@ | |||
38 | /* | 38 | /* |
39 | * Version Information | 39 | * Version Information |
40 | */ | 40 | */ |
41 | #define DRIVER_VERSION "1.3.1" | 41 | #define DRIVER_VERSION "1.3.2" |
42 | #define DRIVER_DESC "Moschip 7840/7820 USB Serial Driver" | 42 | #define DRIVER_DESC "Moschip 7840/7820 USB Serial Driver" |
43 | 43 | ||
44 | /* | 44 | /* |
@@ -123,6 +123,11 @@ | |||
123 | #define BANDB_DEVICE_ID_USOPTL4_4 0xAC44 | 123 | #define BANDB_DEVICE_ID_USOPTL4_4 0xAC44 |
124 | #define BANDB_DEVICE_ID_USOPTL4_2 0xAC42 | 124 | #define BANDB_DEVICE_ID_USOPTL4_2 0xAC42 |
125 | 125 | ||
126 | /* This driver also supports the ATEN UC2324 device since it is mos7840 based | ||
127 | * - if I knew the device id it would also support the ATEN UC2322 */ | ||
128 | #define USB_VENDOR_ID_ATENINTL 0x0557 | ||
129 | #define ATENINTL_DEVICE_ID_UC2324 0x2011 | ||
130 | |||
126 | /* Interrupt Routine Defines */ | 131 | /* Interrupt Routine Defines */ |
127 | 132 | ||
128 | #define SERIAL_IIR_RLS 0x06 | 133 | #define SERIAL_IIR_RLS 0x06 |
@@ -170,6 +175,7 @@ static struct usb_device_id moschip_port_id_table[] = { | |||
170 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, | 175 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, |
171 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, | 176 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, |
172 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, | 177 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, |
178 | {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, | ||
173 | {} /* terminating entry */ | 179 | {} /* terminating entry */ |
174 | }; | 180 | }; |
175 | 181 | ||
@@ -178,6 +184,7 @@ static __devinitdata struct usb_device_id moschip_id_table_combined[] = { | |||
178 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, | 184 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, |
179 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, | 185 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, |
180 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, | 186 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, |
187 | {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, | ||
181 | {} /* terminating entry */ | 188 | {} /* terminating entry */ |
182 | }; | 189 | }; |
183 | 190 | ||
@@ -1000,12 +1007,6 @@ static int mos7840_open(struct tty_struct *tty, | |||
1000 | status = mos7840_set_reg_sync(port, mos7840_port->ControlRegOffset, | 1007 | status = mos7840_set_reg_sync(port, mos7840_port->ControlRegOffset, |
1001 | Data); | 1008 | Data); |
1002 | 1009 | ||
1003 | /* force low_latency on so that our tty_push actually forces * | ||
1004 | * the data through,otherwise it is scheduled, and with * | ||
1005 | * high data rates (like with OHCI) data can get lost. */ | ||
1006 | if (tty) | ||
1007 | tty->low_latency = 1; | ||
1008 | |||
1009 | /* Check to see if we've set up our endpoint info yet * | 1010 | /* Check to see if we've set up our endpoint info yet * |
1010 | * (can't set it up in mos7840_startup as the structures * | 1011 | * (can't set it up in mos7840_startup as the structures * |
1011 | * were not set up at that time.) */ | 1012 | * were not set up at that time.) */ |
@@ -2477,9 +2478,14 @@ static int mos7840_startup(struct usb_serial *serial) | |||
2477 | mos7840_set_port_private(serial->port[i], mos7840_port); | 2478 | mos7840_set_port_private(serial->port[i], mos7840_port); |
2478 | spin_lock_init(&mos7840_port->pool_lock); | 2479 | spin_lock_init(&mos7840_port->pool_lock); |
2479 | 2480 | ||
2480 | mos7840_port->port_num = ((serial->port[i]->number - | 2481 | /* minor is not initialised until later by |
2481 | (serial->port[i]->serial->minor)) + | 2482 | * usb-serial.c:get_free_serial() and cannot therefore be used |
2482 | 1); | 2483 | * to index device instances */ |
2484 | mos7840_port->port_num = i + 1; | ||
2485 | dbg ("serial->port[i]->number = %d", serial->port[i]->number); | ||
2486 | dbg ("serial->port[i]->serial->minor = %d", serial->port[i]->serial->minor); | ||
2487 | dbg ("mos7840_port->port_num = %d", mos7840_port->port_num); | ||
2488 | dbg ("serial->minor = %d", serial->minor); | ||
2483 | 2489 | ||
2484 | if (mos7840_port->port_num == 1) { | 2490 | if (mos7840_port->port_num == 1) { |
2485 | mos7840_port->SpRegOffset = 0x0; | 2491 | mos7840_port->SpRegOffset = 0x0; |
@@ -2690,13 +2696,16 @@ static void mos7840_shutdown(struct usb_serial *serial) | |||
2690 | 2696 | ||
2691 | for (i = 0; i < serial->num_ports; ++i) { | 2697 | for (i = 0; i < serial->num_ports; ++i) { |
2692 | mos7840_port = mos7840_get_port_private(serial->port[i]); | 2698 | mos7840_port = mos7840_get_port_private(serial->port[i]); |
2693 | spin_lock_irqsave(&mos7840_port->pool_lock, flags); | 2699 | dbg ("mos7840_port %d = %p", i, mos7840_port); |
2694 | mos7840_port->zombie = 1; | 2700 | if (mos7840_port) { |
2695 | spin_unlock_irqrestore(&mos7840_port->pool_lock, flags); | 2701 | spin_lock_irqsave(&mos7840_port->pool_lock, flags); |
2696 | usb_kill_urb(mos7840_port->control_urb); | 2702 | mos7840_port->zombie = 1; |
2697 | kfree(mos7840_port->ctrl_buf); | 2703 | spin_unlock_irqrestore(&mos7840_port->pool_lock, flags); |
2698 | kfree(mos7840_port->dr); | 2704 | usb_kill_urb(mos7840_port->control_urb); |
2699 | kfree(mos7840_port); | 2705 | kfree(mos7840_port->ctrl_buf); |
2706 | kfree(mos7840_port->dr); | ||
2707 | kfree(mos7840_port); | ||
2708 | } | ||
2700 | mos7840_set_port_private(serial->port[i], NULL); | 2709 | mos7840_set_port_private(serial->port[i], NULL); |
2701 | } | 2710 | } |
2702 | 2711 | ||