aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/usb/quirks.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-01-08 08:52:18 +0100
committerTakashi Iwai <tiwai@suse.de>2021-01-08 23:43:38 +0100
commiteae4d054f909d9e9589d0940f9b5b0cd68de1e2e (patch)
tree18afa9fb9f8e30b92798111518479a76ad560c86 /sound/usb/quirks.c
parentALSA: usb-audio: Avoid unnecessary interface re-setup (diff)
downloadwireguard-linux-eae4d054f909d9e9589d0940f9b5b0cd68de1e2e.tar.xz
wireguard-linux-eae4d054f909d9e9589d0940f9b5b0cd68de1e2e.zip
ALSA: usb-audio: Annotate the endpoint index in audioformat
There are devices that have multiple endpoints sharing the same iface/altset not only for sync but also for the actual streams, and the audioformat for such an endpoint needs to be handled with the proper endpoint index; otherwise it confuses the endpoint management. This patch extends the audioformat to annotate the endpoint index, and put the proper ep_idx=1 to Pioneer device quirk entries accordingly. Fixes: bf6313a0ff76 ("ALSA: usb-audio: Refactor endpoint management") Link: https://lore.kernel.org/r/20210108075219.21463-5-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/quirks.c')
-rw-r--r--sound/usb/quirks.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index b70e2ebc3e29..89e172642d98 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -194,7 +194,7 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
}
alts = &iface->altsetting[fp->altset_idx];
altsd = get_iface_desc(alts);
- if (altsd->bNumEndpoints < 1) {
+ if (altsd->bNumEndpoints <= fp->ep_idx) {
err = -EINVAL;
goto error;
}
@@ -204,7 +204,7 @@ static int create_fixed_stream_quirk(struct snd_usb_audio *chip,
if (fp->datainterval == 0)
fp->datainterval = snd_usb_parse_datainterval(chip, alts);
if (fp->maxpacksize == 0)
- fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
+ fp->maxpacksize = le16_to_cpu(get_endpoint(alts, fp->ep_idx)->wMaxPacketSize);
if (!fp->fmt_type)
fp->fmt_type = UAC_FORMAT_TYPE_I;