From: Eldad Zack <eldad@fogrefinery.com>
Date: Wed, 28 Nov 2012 22:55:41 +0000 (+0100)
Subject: ALSA: usb-audio: FT C400 sync playback EP to capture EP
X-Git-Tag: firefly_0821_release~3680^2~1370^2~57
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ca10a7ebdff1c862ca1ef1d7bd2c6810e3c87e17;p=firefly-linux-kernel-4.4.55.git

ALSA: usb-audio: FT C400 sync playback EP to capture EP

The playback endpoint uses implicit feedback mode, similar
to the M-Audio FTU. Like with the FTU, we need to associate
the sync pipe ourselves.

Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---

diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index f488a493a98e..769821c30031 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -362,6 +362,19 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt)
 	attr = fmt->ep_attr & USB_ENDPOINT_SYNCTYPE;
 
 	switch (subs->stream->chip->usb_id) {
+	case USB_ID(0x0763, 0x2030): /* M-Audio Fast Track C400 */
+		if (is_playback) {
+			implicit_fb = 1;
+			ep = 0x81;
+			iface = usb_ifnum_to_if(dev, 3);
+
+			if (!iface || iface->num_altsetting == 0)
+				return -EINVAL;
+
+			alts = &iface->altsetting[1];
+			goto add_sync_ep;
+		}
+		break;
 	case USB_ID(0x0763, 0x2080): /* M-Audio FastTrack Ultra */
 	case USB_ID(0x0763, 0x2081):
 		if (is_playback) {