aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorEldad Zack <eldad@fogrefinery.com>2013-08-03 04:50:21 -0400
committerTakashi Iwai <tiwai@suse.de>2013-08-06 04:51:48 -0400
commit914273c714845e2f3363e962f6dff59626a79fa3 (patch)
tree6b08a703929667e9c9e6387b4272518abedab5f8 /sound/usb
parent95fec88332dbbe4344ffc1b564480402a89ee805 (diff)
ALSA: usb-audio: remove is_playback from implicit feedback quirks
An implicit feedback endpoint can only be a capture source. The consumer (sink) of the implicit feedback endpoint is therefore limited to playback EPs. Check if the target endpoint is a playback first and remove redundant checks. Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/pcm.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index bb2e0f52e92f..af30e08e3d3b 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -334,41 +334,39 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs,
334{ 334{
335 struct usb_host_interface *alts; 335 struct usb_host_interface *alts;
336 struct usb_interface *iface; 336 struct usb_interface *iface;
337 int is_playback = subs->direction == SNDRV_PCM_STREAM_PLAYBACK;
338 int implicit_fb = 0; 337 int implicit_fb = 0;
339 unsigned int ep; 338 unsigned int ep;
340 339
340 /* Implicit feedback sync EPs consumers are always playback EPs */
341 if (subs->direction != SNDRV_PCM_STREAM_PLAYBACK)
342 return 0;
343
341 switch (subs->stream->chip->usb_id) { 344 switch (subs->stream->chip->usb_id) {
342 case USB_ID(0x0763, 0x2030): /* M-Audio Fast Track C400 */ 345 case USB_ID(0x0763, 0x2030): /* M-Audio Fast Track C400 */
343 case USB_ID(0x0763, 0x2031): /* M-Audio Fast Track C600 */ 346 case USB_ID(0x0763, 0x2031): /* M-Audio Fast Track C600 */
344 if (is_playback) { 347 implicit_fb = 1;
345 implicit_fb = 1; 348 ep = 0x81;
346 ep = 0x81; 349 iface = usb_ifnum_to_if(dev, 3);
347 iface = usb_ifnum_to_if(dev, 3);
348 350
349 if (!iface || iface->num_altsetting == 0) 351 if (!iface || iface->num_altsetting == 0)
350 return -EINVAL; 352 return -EINVAL;
351 353
352 alts = &iface->altsetting[1]; 354 alts = &iface->altsetting[1];
353 goto add_sync_ep; 355 goto add_sync_ep;
354 }
355 break; 356 break;
356 case USB_ID(0x0763, 0x2080): /* M-Audio FastTrack Ultra */ 357 case USB_ID(0x0763, 0x2080): /* M-Audio FastTrack Ultra */
357 case USB_ID(0x0763, 0x2081): 358 case USB_ID(0x0763, 0x2081):
358 if (is_playback) { 359 implicit_fb = 1;
359 implicit_fb = 1; 360 ep = 0x81;
360 ep = 0x81; 361 iface = usb_ifnum_to_if(dev, 2);
361 iface = usb_ifnum_to_if(dev, 2);
362 362
363 if (!iface || iface->num_altsetting == 0) 363 if (!iface || iface->num_altsetting == 0)
364 return -EINVAL; 364 return -EINVAL;
365 365
366 alts = &iface->altsetting[1]; 366 alts = &iface->altsetting[1];
367 goto add_sync_ep; 367 goto add_sync_ep;
368 }
369 } 368 }
370 if (is_playback && 369 if (attr == USB_ENDPOINT_SYNC_ASYNC &&
371 attr == USB_ENDPOINT_SYNC_ASYNC &&
372 altsd->bInterfaceClass == USB_CLASS_VENDOR_SPEC && 370 altsd->bInterfaceClass == USB_CLASS_VENDOR_SPEC &&
373 altsd->bInterfaceProtocol == 2 && 371 altsd->bInterfaceProtocol == 2 &&
374 altsd->bNumEndpoints == 1 && 372 altsd->bNumEndpoints == 1 &&