aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2013-04-09 12:56:03 -0400
committerTakashi Iwai <tiwai@suse.de>2013-04-10 03:21:43 -0400
commit21bb5aafce4350e243f9be3d981c0beb2e2c5ab4 (patch)
tree41dfd36deccedeff13266cb71b0b79b69c830130 /sound/usb
parent78daea29f2e5312bce9d7781a5400026b71ed29b (diff)
ALSA: snd-usb: Playback Design: use usb_set_inferface quirk from more locations
It turns out the devices from Playback Design need the delay quirk after usb_set_interface from clocks.c as well. Make it a proper quirks function and factor out the code to quirks.c. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/clock.c3
-rw-r--r--sound/usb/pcm.c7
-rw-r--r--sound/usb/quirks.c10
-rw-r--r--sound/usb/quirks.h1
4 files changed, 15 insertions, 6 deletions
diff --git a/sound/usb/clock.c b/sound/usb/clock.c
index ae35e7d22e73..b0ec3643eb62 100644
--- a/sound/usb/clock.c
+++ b/sound/usb/clock.c
@@ -32,6 +32,7 @@
32#include "card.h" 32#include "card.h"
33#include "helper.h" 33#include "helper.h"
34#include "clock.h" 34#include "clock.h"
35#include "quirks.h"
35 36
36static struct uac_clock_source_descriptor * 37static struct uac_clock_source_descriptor *
37 snd_usb_find_clock_source(struct usb_host_interface *ctrl_iface, 38 snd_usb_find_clock_source(struct usb_host_interface *ctrl_iface,
@@ -392,7 +393,9 @@ static int set_sample_rate_v2(struct snd_usb_audio *chip, int iface,
392 * interface is active. */ 393 * interface is active. */
393 if (rate != prev_rate) { 394 if (rate != prev_rate) {
394 usb_set_interface(dev, iface, 0); 395 usb_set_interface(dev, iface, 0);
396 snd_usb_set_interface_quirk(dev);
395 usb_set_interface(dev, iface, fmt->altsetting); 397 usb_set_interface(dev, iface, fmt->altsetting);
398 snd_usb_set_interface_quirk(dev);
396 } 399 }
397 400
398 return 0; 401 return 0;
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index 754cb5bb1f79..815a37d2e3e0 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -349,12 +349,7 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt)
349 subs->interface = fmt->iface; 349 subs->interface = fmt->iface;
350 subs->altset_idx = fmt->altset_idx; 350 subs->altset_idx = fmt->altset_idx;
351 351
352 /* 352 snd_usb_set_interface_quirk(dev);
353 * "Playback Design" products need a 50ms delay after setting the
354 * USB interface.
355 */
356 if (le16_to_cpu(dev->descriptor.idVendor) == 0x23ba)
357 mdelay(50);
358 } 353 }
359 354
360 subs->data_endpoint = snd_usb_add_endpoint(subs->stream->chip, 355 subs->data_endpoint = snd_usb_add_endpoint(subs->stream->chip,
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index a2ac004bbd9a..292798185afc 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -892,6 +892,16 @@ void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep)
892 ep->skip_packets = 16; 892 ep->skip_packets = 16;
893} 893}
894 894
895void snd_usb_set_interface_quirk(struct usb_device *dev)
896{
897 /*
898 * "Playback Design" products need a 50ms delay after setting the
899 * USB interface.
900 */
901 if (le16_to_cpu(dev->descriptor.idVendor) == 0x23ba)
902 mdelay(50);
903}
904
895void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe, 905void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
896 __u8 request, __u8 requesttype, __u16 value, 906 __u8 request, __u8 requesttype, __u16 value,
897 __u16 index, void *data, __u16 size) 907 __u16 index, void *data, __u16 size)
diff --git a/sound/usb/quirks.h b/sound/usb/quirks.h
index 0ca9e91067a6..7c3681fd1c3c 100644
--- a/sound/usb/quirks.h
+++ b/sound/usb/quirks.h
@@ -26,6 +26,7 @@ int snd_usb_is_big_endian_format(struct snd_usb_audio *chip,
26 26
27void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep); 27void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep);
28 28
29void snd_usb_set_interface_quirk(struct usb_device *dev);
29void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe, 30void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
30 __u8 request, __u8 requesttype, __u16 value, 31 __u8 request, __u8 requesttype, __u16 value,
31 __u16 index, void *data, __u16 size); 32 __u16 index, void *data, __u16 size);