aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Rorvick <chris@rorvick.com>2015-02-11 00:03:13 -0500
committerTakashi Iwai <tiwai@suse.de>2015-02-11 04:33:55 -0500
commite64e94df9916a1db6c85a3677e20926c99a1d0b3 (patch)
tree5048af8fa1eaceaa34029d44865462bbbd16256c
parent1b006996b6c44d9d95462e382921954756cec99b (diff)
ALSA: line6: Add delay before reading status
The device indicates the result of a read/write operation by making the status available on a subsequent request from the driver. This is not ready immediately, though, so the driver is currently slamming the device with hundreds of pointless requests before getting the expected response. Add a two millisecond delay before each attempt. This is approximately the behavior observed with version 4.2.7.1 of the Windows driver. Signed-off-by: Chris Rorvick <chris@rorvick.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/usb/line6/driver.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c
index 626b0c3244cf..2f9b74e7accb 100644
--- a/sound/usb/line6/driver.c
+++ b/sound/usb/line6/driver.c
@@ -296,6 +296,8 @@ static void line6_data_received(struct urb *urb)
296 line6_start_listen(line6); 296 line6_start_listen(line6);
297} 297}
298 298
299#define LINE6_READ_WRITE_STATUS_DELAY 2 /* milliseconds */
300
299/* 301/*
300 Read data from device. 302 Read data from device.
301*/ 303*/
@@ -319,6 +321,8 @@ int line6_read_data(struct usb_line6 *line6, int address, void *data,
319 321
320 /* Wait for data length. We'll get 0xff until length arrives. */ 322 /* Wait for data length. We'll get 0xff until length arrives. */
321 do { 323 do {
324 mdelay(LINE6_READ_WRITE_STATUS_DELAY);
325
322 ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0), 0x67, 326 ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0), 0x67,
323 USB_TYPE_VENDOR | USB_RECIP_DEVICE | 327 USB_TYPE_VENDOR | USB_RECIP_DEVICE |
324 USB_DIR_IN, 328 USB_DIR_IN,
@@ -376,6 +380,8 @@ int line6_write_data(struct usb_line6 *line6, int address, void *data,
376 } 380 }
377 381
378 do { 382 do {
383 mdelay(LINE6_READ_WRITE_STATUS_DELAY);
384
379 ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0), 385 ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0),
380 0x67, 386 0x67,
381 USB_TYPE_VENDOR | USB_RECIP_DEVICE | 387 USB_TYPE_VENDOR | USB_RECIP_DEVICE |