From nobody Wed Dec 17 17:22:20 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7985C5AD4C for ; Thu, 23 Nov 2023 09:24:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229714AbjKWJTQ (ORCPT ); Thu, 23 Nov 2023 04:19:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjKWJTO (ORCPT ); Thu, 23 Nov 2023 04:19:14 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 365FE19E for ; Thu, 23 Nov 2023 01:19:21 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1886C433C8; Thu, 23 Nov 2023 09:19:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700731160; bh=INV4VXsAI81QuQ1I3t6WPmgl0c6clKa/3BaJIVhZGXA=; h=From:To:Cc:Subject:Date:From; b=F0JhFyVM2+BsueqEwbUbsiJI7zpElGUGGbhwNiyktyYVGV3GyH4f3LCTjpN9Z29Tp uhH2WNC4c3OvQZpqAP7ZVDom4noucMZ5mvFtIcAx8UTzmIXxpVL8biqaNdVnls0A2P k2xw4kRTC/IpYpr9GoR5INBe6vd4olAvAbcdruzuGsEbhe+h+3qcWyWoDmYuMJi/OT awBD8DtkO9GNwA31w8icWPi7tjr8SpwBcQRiDYPkaPq+4rlAW87ezMBB/UAHxe7p45 jSueeQ8vMDLXarBKHQuVp/Oqj96sRrYmjrQNQPxffAxXtvOtFrdx2wwLuPG9Y8Zb/G Kq+ge42mcL6Zg== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from ) id 1r65s1-0005iG-32; Thu, 23 Nov 2023 10:19:37 +0100 From: Johan Hovold To: Mark Brown Cc: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Srinivas Kandagatla , Chancel Liu , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH] ASoC: soc-pcm: fix up bad merge Date: Thu, 23 Nov 2023 10:18:15 +0100 Message-ID: <20231123091815.21933-1-johan+linaro@kernel.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" A recent change to address pops and clicks with codecs like WSA883X touched the same code paths as a fix for clearing DAI parameters and resulted in a bad merge. Specifically, commit f0220575e65a ("ASoC: soc-dai: add flag to mute and unmute stream during trigger") made mute at stream close conditional, while commit 3efcb471f871 ("ASoC: soc-pcm.c: Make sure DAI parameters cleared if the DAI becomes inactive") moved that same mute call back to soc_pcm_hw_clean(). Fix up the bad merge by dropping the second mute call from soc_pcm_clean() and making sure that the call in soc_pcm_hw_clean() is conditional as intended. Fixes: bdb7e1922052 ("ASoC: Merge up workaround for CODECs that play noise = on stopped stream") Signed-off-by: Johan Hovold --- sound/soc/soc-pcm.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 323e4d7b6adf..f6d1b2e11795 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -704,11 +704,6 @@ static int soc_pcm_clean(struct snd_soc_pcm_runtime *r= td, if (snd_soc_dai_active(dai) =3D=3D 0 && (dai->rate || dai->channels || dai->sample_bits)) soc_pcm_set_dai_params(dai, NULL); - - if (snd_soc_dai_stream_active(dai, substream->stream) =3D=3D 0) { - if (dai->driver->ops && !dai->driver->ops->mute_unmute_on_trigger) - snd_soc_dai_digital_mute(dai, 1, substream->stream); - } } } =20 @@ -947,8 +942,10 @@ static int soc_pcm_hw_clean(struct snd_soc_pcm_runtime= *rtd, if (snd_soc_dai_active(dai) =3D=3D 1) soc_pcm_set_dai_params(dai, NULL); =20 - if (snd_soc_dai_stream_active(dai, substream->stream) =3D=3D 1) - snd_soc_dai_digital_mute(dai, 1, substream->stream); + if (snd_soc_dai_stream_active(dai, substream->stream) =3D=3D 1) { + if (dai->driver->ops && !dai->driver->ops->mute_unmute_on_trigger) + snd_soc_dai_digital_mute(dai, 1, substream->stream); + } } =20 /* run the stream event */ --=20 2.41.0