ALSA: usb-audio: Check implicit feedback EP generically for UAC2
authorTakashi Iwai <tiwai@suse.de>
Mon, 23 Nov 2020 08:53:10 +0000 (09:53 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 23 Nov 2020 14:11:46 +0000 (15:11 +0100)
commit2e43aae2bf5a4ede98cbe0c85ad104dd7ba5dfd2
tree6ac300ec3274a1580ceb833cc0ca299c267afe7b
parent93db51d06b32227319dae2ac289029ccf1b33181
ALSA: usb-audio: Check implicit feedback EP generically for UAC2

It seems that many UAC2 devices are with the implicit feedback, but
they couldn't be probed properly because the assumption the driver
takes currently isn't applied: they have the single endpoint for both
data and implicit-fb streams, while we checked only the classical sync
endpoints assigned to the next altsetting in the same interface.

This patch extends the search to match with those typical cases where
the implicit fb stream is found in the next interface number.

While we're at it, slightly refactor the code, not returning 0/-ERROR
but use the standard bool to success/failur, which is more intuitive
in this particular case.

Reported-by: Dylan Robinson <dylan_robinson@motu.com>
Tested-by: Keith Milner <kamilner@superlative.org>
Tested-by: Dylan Robinson <dylan_robinson@motu.com>
Link: https://lore.kernel.org/r/20201123085347.19667-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/pcm.c