]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: Refcount multiple accesses on the single clock
authorTakashi Iwai <tiwai@suse.de>
Mon, 16 May 2022 10:48:07 +0000 (12:48 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 16 May 2022 10:49:03 +0000 (12:49 +0200)
commit2bf7e912cb233c84f18cf1aeb2b438c53fa66626
treee5f1db89edb15c8c82bb7efad9fd8c4090ef3498
parent29f43e55378d37c8b54313ef55d0b1e8d571e718
ALSA: usb-audio: Refcount multiple accesses on the single clock

When a clock source is connected to multiple nodes / endpoints, the
current USB-audio driver tries to set up at each time one of them is
configured.  Although it reads the current rate and updates only if it
differs, some devices seem unhappy with this behavior and spew the
errors when reading/updating the rate unnecessarily.

This patch tries to reduce the redundant clock setup by introducing a
refcount for each clock source.  When the stream is actually running,
a clock rate is "locked", and it bypasses the clock and/or refuse to
change any longer.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215934
Link: https://lore.kernel.org/r/20220516104807.16482-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/card.c
sound/usb/card.h
sound/usb/endpoint.c
sound/usb/usbaudio.h