From f6581c0e5d297cc1e0d7eb7c2603097f532e629a Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 23 Nov 2020 09:53:14 +0100 Subject: ALSA: usb-audio: Track implicit fb sync endpoint in audioformat list Instead of parsing and evaluating the sync endpoint and the implicit feedback mode at each time the audio stream is opened, let's parse it once at the probe time, as the all needed information can be obtained statically from the descriptor or from the quirk. This patch extends audioformat struct to record the sync endpoint, interface and altsetting as well as the implicit feedback flag, which are filled at parsing the streams. Then, set_sync_endpoint() is much simplified just to follow the already parsed data. Tested-by: Keith Milner Tested-by: Dylan Robinson Link: https://lore.kernel.org/r/20201123085347.19667-9-tiwai@suse.de Signed-off-by: Takashi Iwai --- sound/usb/stream.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound/usb/stream.c') diff --git a/sound/usb/stream.c b/sound/usb/stream.c index f17913e0b5b4..7087ee2c8174 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c @@ -1193,6 +1193,8 @@ static int __snd_usb_parse_audio_interface(struct snd_usb_audio *chip, continue; } + snd_usb_audioformat_set_sync_ep(chip, fp); + dev_dbg(&dev->dev, "%u:%d: add audio endpoint %#x\n", iface_no, altno, fp->endpoint); if (protocol == UAC_VERSION_3) err = snd_usb_add_audio_stream_v3(chip, stream, fp, pd); -- cgit v1.2.3