]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Jun 2022 10:31:09 +0000 (12:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Jun 2022 10:31:09 +0000 (12:31 +0200)
added patches:
alsa-usb-audio-optimize-teac-clock-quirk.patch

queue-5.18/alsa-usb-audio-optimize-teac-clock-quirk.patch [new file with mode: 0644]
queue-5.18/series

diff --git a/queue-5.18/alsa-usb-audio-optimize-teac-clock-quirk.patch b/queue-5.18/alsa-usb-audio-optimize-teac-clock-quirk.patch
new file mode 100644 (file)
index 0000000..d3eaca2
--- /dev/null
@@ -0,0 +1,50 @@
+From 3753fcc22974affa26160ce1c46a6ebaaaa86758 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 31 May 2022 15:07:49 +0200
+Subject: ALSA: usb-audio: Optimize TEAC clock quirk
+
+From: Takashi Iwai <tiwai@suse.de>
+
+commit 3753fcc22974affa26160ce1c46a6ebaaaa86758 upstream.
+
+Maris found out that the quirk for TEAC devices to work around the
+clock setup is needed to apply only when the base clock is changed,
+e.g. from 48000-based clocks (48000, 96000, 192000, 384000) to
+44100-based clocks (44100, 88200, 176400, 352800), or vice versa,
+while switching to another clock with the same base clock doesn't need
+the (forcible) interface setup.
+
+This patch implements the optimization for the TEAC clock quirk to
+avoid the unnecessary interface re-setup.
+
+Fixes: 5ce0b06ae5e6 ("ALSA: usb-audio: Workaround for clock setup on TEAC devices")
+Reported-by: Maris Abele <maris7abele@gmail.com>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20220531130749.30357-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/usb/clock.c |   12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+--- a/sound/usb/clock.c
++++ b/sound/usb/clock.c
+@@ -573,10 +573,14 @@ static int set_sample_rate_v2v3(struct s
+       }
+       /* FIXME - TEAC devices require the immediate interface setup */
+-      if (rate != prev_rate && USB_ID_VENDOR(chip->usb_id) == 0x0644) {
+-              usb_set_interface(chip->dev, fmt->iface, fmt->altsetting);
+-              if (chip->quirk_flags & QUIRK_FLAG_IFACE_DELAY)
+-                      msleep(50);
++      if (USB_ID_VENDOR(chip->usb_id) == 0x0644) {
++              bool cur_base_48k = (rate % 48000 == 0);
++              bool prev_base_48k = (prev_rate % 48000 == 0);
++              if (cur_base_48k != prev_base_48k) {
++                      usb_set_interface(chip->dev, fmt->iface, fmt->altsetting);
++                      if (chip->quirk_flags & QUIRK_FLAG_IFACE_DELAY)
++                              msleep(50);
++              }
+       }
+ validation:
index f7cda20b29f028d5cf2367ef85c2a6f8da67ee97..21d52e249f5ab3da84e9cd027195ee1ec1602f27 100644 (file)
@@ -64,3 +64,4 @@ bpf-fix-excessive-memory-allocation-in-stack_map_alloc.patch
 bpf-reject-writes-for-ptr_to_map_key-in-check_helper_mem_access.patch
 bpf-check-ptr_to_mem-mem_rdonly-in-check_helper_mem_access.patch
 bpf-do-write-access-check-for-kfunc-and-global-func.patch
+alsa-usb-audio-optimize-teac-clock-quirk.patch