ALSA: usb-audio: Restrict rates for the shared clocks
authorTakashi Iwai <tiwai@suse.de>
Wed, 29 Sep 2021 08:08:36 +0000 (10:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Dec 2021 08:04:36 +0000 (09:04 +0100)
commit8f0a376b2eaac189e4ad72fcea05175d9c5f81b2
tree5661aab06ca3a55a9bc5a7ae4c808cd92d5a96ab
parenta2547651bc896f95a3680a6a0a27401e7c7a1080
ALSA: usb-audio: Restrict rates for the shared clocks

commit 4e7cf1fbb34ecb472c073980458cbe413afd4d64 upstream.

When a single clock source is shared among several endpoints, we have
to keep the same rate on all active endpoints as long as the clock is
being used.  For dealing with such a case, this patch adds one more
check in the hw params constraint for the rate to take the shared
clocks into account.  The current rate is evaluated from the endpoint
list that applies the same clock source.

BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1190418
Link: https://lore.kernel.org/r/20210929080844.11583-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/card.h
sound/usb/endpoint.c
sound/usb/endpoint.h
sound/usb/pcm.c