diff options
author | Daniel Schürmann | 2013-04-20 23:06:17 +0200 |
---|---|---|
committer | Takashi Iwai | 2013-04-22 10:45:02 +0200 |
commit | b5f035dbca2895cd253141706b47b6cb8afc2ed5 (patch) | |
tree | f13f7d05eca12f485f7d09a78917f0890ede1e09 /sound/usb | |
parent | 47966e977952856f184c93c4ae5da11e151cb4a3 (diff) |
ALSA: snd-usb-audio: set the timeout for usb control set messages to 5000 ms
Set the timeout for USB control set messages according to the USB 2
spec, using the macros from include/linux/usb.h.
The get timout becomes 5000 ms even though it is 500 ms in the
spec. This patch is required to run the Hercules RMX2 which needs a
timeout of 1240 ms.
More notes from author:
I still distinguish between set and get but as long both are 5000 ms
GCC will remove it anyway. IMHO this is more easy read and there is no
need to explain why we use a get timeout for set messages.
Signed-off-by: Daniel Schürmann <daschuer@mixxx.org>
Acked-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/helper.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sound/usb/helper.c b/sound/usb/helper.c index c1db28f874c2..620902463c6e 100644 --- a/sound/usb/helper.c +++ b/sound/usb/helper.c @@ -86,14 +86,22 @@ int snd_usb_ctl_msg(struct usb_device *dev, unsigned int pipe, __u8 request, { int err; void *buf = NULL; + int timeout; if (size > 0) { buf = kmemdup(data, size, GFP_KERNEL); if (!buf) return -ENOMEM; } + + if (requesttype & USB_DIR_IN) + timeout = USB_CTRL_GET_TIMEOUT; + else + timeout = USB_CTRL_SET_TIMEOUT; + err = usb_control_msg(dev, pipe, request, requesttype, - value, index, buf, size, 1000); + value, index, buf, size, timeout); + if (size > 0) { memcpy(data, buf, size); kfree(buf); |