diff options
Diffstat (limited to 'drivers/usb/serial/ti_usb_3410_5052.c')
-rw-r--r-- | drivers/usb/serial/ti_usb_3410_5052.c | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 2620bf6fe5e1..0a64bac306ee 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
@@ -50,11 +50,10 @@ | |||
50 | 50 | ||
51 | #define TI_TRANSFER_TIMEOUT 2 | 51 | #define TI_TRANSFER_TIMEOUT 2 |
52 | 52 | ||
53 | #define TI_DEFAULT_LOW_LATENCY 0 | ||
54 | #define TI_DEFAULT_CLOSING_WAIT 4000 /* in .01 secs */ | 53 | #define TI_DEFAULT_CLOSING_WAIT 4000 /* in .01 secs */ |
55 | 54 | ||
56 | /* supported setserial flags */ | 55 | /* supported setserial flags */ |
57 | #define TI_SET_SERIAL_FLAGS (ASYNC_LOW_LATENCY) | 56 | #define TI_SET_SERIAL_FLAGS 0 |
58 | 57 | ||
59 | /* read urb states */ | 58 | /* read urb states */ |
60 | #define TI_READ_URB_RUNNING 0 | 59 | #define TI_READ_URB_RUNNING 0 |
@@ -161,7 +160,6 @@ static int ti_buf_get(struct circ_buf *cb, char *buf, int count); | |||
161 | 160 | ||
162 | /* module parameters */ | 161 | /* module parameters */ |
163 | static int debug; | 162 | static int debug; |
164 | static int low_latency = TI_DEFAULT_LOW_LATENCY; | ||
165 | static int closing_wait = TI_DEFAULT_CLOSING_WAIT; | 163 | static int closing_wait = TI_DEFAULT_CLOSING_WAIT; |
166 | static ushort vendor_3410[TI_EXTRA_VID_PID_COUNT]; | 164 | static ushort vendor_3410[TI_EXTRA_VID_PID_COUNT]; |
167 | static unsigned int vendor_3410_count; | 165 | static unsigned int vendor_3410_count; |
@@ -296,10 +294,6 @@ MODULE_FIRMWARE("mts_edge.fw"); | |||
296 | module_param(debug, bool, S_IRUGO | S_IWUSR); | 294 | module_param(debug, bool, S_IRUGO | S_IWUSR); |
297 | MODULE_PARM_DESC(debug, "Enable debugging, 0=no, 1=yes"); | 295 | MODULE_PARM_DESC(debug, "Enable debugging, 0=no, 1=yes"); |
298 | 296 | ||
299 | module_param(low_latency, bool, S_IRUGO | S_IWUSR); | ||
300 | MODULE_PARM_DESC(low_latency, | ||
301 | "TTY low_latency flag, 0=off, 1=on, default is off"); | ||
302 | |||
303 | module_param(closing_wait, int, S_IRUGO | S_IWUSR); | 297 | module_param(closing_wait, int, S_IRUGO | S_IWUSR); |
304 | MODULE_PARM_DESC(closing_wait, | 298 | MODULE_PARM_DESC(closing_wait, |
305 | "Maximum wait for data to drain in close, in .01 secs, default is 4000"); | 299 | "Maximum wait for data to drain in close, in .01 secs, default is 4000"); |
@@ -448,7 +442,6 @@ static int ti_startup(struct usb_serial *serial) | |||
448 | spin_lock_init(&tport->tp_lock); | 442 | spin_lock_init(&tport->tp_lock); |
449 | tport->tp_uart_base_addr = (i == 0 ? | 443 | tport->tp_uart_base_addr = (i == 0 ? |
450 | TI_UART1_BASE_ADDR : TI_UART2_BASE_ADDR); | 444 | TI_UART1_BASE_ADDR : TI_UART2_BASE_ADDR); |
451 | tport->tp_flags = low_latency ? ASYNC_LOW_LATENCY : 0; | ||
452 | tport->tp_closing_wait = closing_wait; | 445 | tport->tp_closing_wait = closing_wait; |
453 | init_waitqueue_head(&tport->tp_msr_wait); | 446 | init_waitqueue_head(&tport->tp_msr_wait); |
454 | init_waitqueue_head(&tport->tp_write_wait); | 447 | init_waitqueue_head(&tport->tp_write_wait); |
@@ -528,10 +521,6 @@ static int ti_open(struct tty_struct *tty, | |||
528 | if (mutex_lock_interruptible(&tdev->td_open_close_lock)) | 521 | if (mutex_lock_interruptible(&tdev->td_open_close_lock)) |
529 | return -ERESTARTSYS; | 522 | return -ERESTARTSYS; |
530 | 523 | ||
531 | if (tty) | ||
532 | tty->low_latency = | ||
533 | (tport->tp_flags & ASYNC_LOW_LATENCY) ? 1 : 0; | ||
534 | |||
535 | port_number = port->number - port->serial->minor; | 524 | port_number = port->number - port->serial->minor; |
536 | 525 | ||
537 | memset(&(tport->tp_icount), 0x00, sizeof(tport->tp_icount)); | 526 | memset(&(tport->tp_icount), 0x00, sizeof(tport->tp_icount)); |
@@ -1215,20 +1204,22 @@ static void ti_bulk_in_callback(struct urb *urb) | |||
1215 | } | 1204 | } |
1216 | 1205 | ||
1217 | tty = tty_port_tty_get(&port->port); | 1206 | tty = tty_port_tty_get(&port->port); |
1218 | if (tty && urb->actual_length) { | 1207 | if (tty) { |
1219 | usb_serial_debug_data(debug, dev, __func__, | 1208 | if (urb->actual_length) { |
1220 | urb->actual_length, urb->transfer_buffer); | 1209 | usb_serial_debug_data(debug, dev, __func__, |
1221 | 1210 | urb->actual_length, urb->transfer_buffer); | |
1222 | if (!tport->tp_is_open) | 1211 | |
1223 | dbg("%s - port closed, dropping data", __func__); | 1212 | if (!tport->tp_is_open) |
1224 | else | 1213 | dbg("%s - port closed, dropping data", |
1225 | ti_recv(&urb->dev->dev, tty, | 1214 | __func__); |
1215 | else | ||
1216 | ti_recv(&urb->dev->dev, tty, | ||
1226 | urb->transfer_buffer, | 1217 | urb->transfer_buffer, |
1227 | urb->actual_length); | 1218 | urb->actual_length); |
1228 | 1219 | spin_lock(&tport->tp_lock); | |
1229 | spin_lock(&tport->tp_lock); | 1220 | tport->tp_icount.rx += urb->actual_length; |
1230 | tport->tp_icount.rx += urb->actual_length; | 1221 | spin_unlock(&tport->tp_lock); |
1231 | spin_unlock(&tport->tp_lock); | 1222 | } |
1232 | tty_kref_put(tty); | 1223 | tty_kref_put(tty); |
1233 | } | 1224 | } |
1234 | 1225 | ||
@@ -1452,7 +1443,6 @@ static int ti_set_serial_info(struct tty_struct *tty, struct ti_port *tport, | |||
1452 | return -EFAULT; | 1443 | return -EFAULT; |
1453 | 1444 | ||
1454 | tport->tp_flags = new_serial.flags & TI_SET_SERIAL_FLAGS; | 1445 | tport->tp_flags = new_serial.flags & TI_SET_SERIAL_FLAGS; |
1455 | tty->low_latency = (tport->tp_flags & ASYNC_LOW_LATENCY) ? 1 : 0; | ||
1456 | tport->tp_closing_wait = new_serial.closing_wait; | 1446 | tport->tp_closing_wait = new_serial.closing_wait; |
1457 | 1447 | ||
1458 | return 0; | 1448 | return 0; |