From 785ec3d7873ae4883313058c1b0186eb31fd0439 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 23 Nov 2023 11:53:07 +0000 Subject: [PATCH] 6.5-stable patches added patches: asoc-codecs-wsa883x-make-use-of-new-mute_unmute_on_trigger-flag.patch asoc-soc-dai-add-flag-to-mute-and-unmute-stream-during-trigger.patch --- ...e-of-new-mute_unmute_on_trigger-flag.patch | 66 +++++++++++++ ...ute-and-unmute-stream-during-trigger.patch | 93 +++++++++++++++++++ queue-6.5/series | 2 + 3 files changed, 161 insertions(+) create mode 100644 queue-6.5/asoc-codecs-wsa883x-make-use-of-new-mute_unmute_on_trigger-flag.patch create mode 100644 queue-6.5/asoc-soc-dai-add-flag-to-mute-and-unmute-stream-during-trigger.patch diff --git a/queue-6.5/asoc-codecs-wsa883x-make-use-of-new-mute_unmute_on_trigger-flag.patch b/queue-6.5/asoc-codecs-wsa883x-make-use-of-new-mute_unmute_on_trigger-flag.patch new file mode 100644 index 00000000000..65f6f3e9391 --- /dev/null +++ b/queue-6.5/asoc-codecs-wsa883x-make-use-of-new-mute_unmute_on_trigger-flag.patch @@ -0,0 +1,66 @@ +From stable+bounces-26-greg=kroah.com@vger.kernel.org Thu Nov 23 09:48:30 2023 +From: Johan Hovold +Date: Thu, 23 Nov 2023 10:47:49 +0100 +Subject: ASoC: codecs: wsa883x: make use of new mute_unmute_on_trigger flag +To: Greg Kroah-Hartman +Cc: Sasha Levin , Mark Brown , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Srinivas Kandagatla , linux-sound@vger.kernel.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold +Message-ID: <20231123094749.20462-3-johan+linaro@kernel.org> + +From: Johan Hovold + +From: Srinivas Kandagatla + +commit 805ce81826c896dd3c351a32814b28557f9edf54 upstream. + +In the current setup the PA is left unmuted even when the +Soundwire ports are not started streaming. This can lead to click +and pop sounds during start. +There is a same issue in the reverse order where in the PA is +left unmute even after the data stream is stopped, the time +between data stream stopping and port closing is long enough +to accumulate DC on the line resulting in Click/Pop noise +during end of stream. + +making use of new mute_unmute_on_trigger flag is helping a +lot with this Click/Pop issues reported on this Codec + +Signed-off-by: Srinivas Kandagatla +Tested-by: Johan Hovold +Link: https://lore.kernel.org/r/20231027105747.32450-3-srinivas.kandagatla@linaro.org +Signed-off-by: Mark Brown +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/codecs/wsa883x.c | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +--- a/sound/soc/codecs/wsa883x.c ++++ b/sound/soc/codecs/wsa883x.c +@@ -1203,9 +1203,6 @@ static int wsa883x_spkr_event(struct snd + break; + } + +- snd_soc_component_write_field(component, WSA883X_DRE_CTL_1, +- WSA883X_DRE_GAIN_EN_MASK, +- WSA883X_DRE_GAIN_FROM_CSR); + if (wsa883x->port_enable[WSA883X_PORT_COMP]) + snd_soc_component_write_field(component, WSA883X_DRE_CTL_0, + WSA883X_DRE_OFFSET_MASK, +@@ -1218,9 +1215,6 @@ static int wsa883x_spkr_event(struct snd + snd_soc_component_write_field(component, WSA883X_PDM_WD_CTL, + WSA883X_PDM_EN_MASK, + WSA883X_PDM_ENABLE); +- snd_soc_component_write_field(component, WSA883X_PA_FSM_CTL, +- WSA883X_GLOBAL_PA_EN_MASK, +- WSA883X_GLOBAL_PA_ENABLE); + + break; + case SND_SOC_DAPM_PRE_PMD: +@@ -1346,6 +1340,7 @@ static const struct snd_soc_dai_ops wsa8 + .hw_free = wsa883x_hw_free, + .mute_stream = wsa883x_digital_mute, + .set_stream = wsa883x_set_sdw_stream, ++ .mute_unmute_on_trigger = true, + }; + + static struct snd_soc_dai_driver wsa883x_dais[] = { diff --git a/queue-6.5/asoc-soc-dai-add-flag-to-mute-and-unmute-stream-during-trigger.patch b/queue-6.5/asoc-soc-dai-add-flag-to-mute-and-unmute-stream-during-trigger.patch new file mode 100644 index 00000000000..d4d59fadda0 --- /dev/null +++ b/queue-6.5/asoc-soc-dai-add-flag-to-mute-and-unmute-stream-during-trigger.patch @@ -0,0 +1,93 @@ +From stable+bounces-27-greg=kroah.com@vger.kernel.org Thu Nov 23 09:48:30 2023 +From: Johan Hovold +Date: Thu, 23 Nov 2023 10:47:48 +0100 +Subject: ASoC: soc-dai: add flag to mute and unmute stream during trigger +To: Greg Kroah-Hartman +Cc: Sasha Levin , Mark Brown , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Srinivas Kandagatla , linux-sound@vger.kernel.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold +Message-ID: <20231123094749.20462-2-johan+linaro@kernel.org> + +From: Johan Hovold + +From: Srinivas Kandagatla + +commit f0220575e65abe09c09cd17826a3cdea76e8d58f upstream. + +In some setups like Speaker amps which are very sensitive, ex: keeping them +unmute without actual data stream for very short duration results in a +static charge and results in pop and clicks. To minimize this, provide a way +to mute and unmute such codecs during trigger callbacks. + +Signed-off-by: Srinivas Kandagatla +Tested-by: Johan Hovold +Link: https://lore.kernel.org/r/20231027105747.32450-2-srinivas.kandagatla@linaro.org +Signed-off-by: Mark Brown +[ johan: backport to v6.6.2 ] +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + include/sound/soc-dai.h | 1 + + sound/soc/soc-dai.c | 7 +++++++ + sound/soc/soc-pcm.c | 12 ++++++++---- + 3 files changed, 16 insertions(+), 4 deletions(-) + +--- a/include/sound/soc-dai.h ++++ b/include/sound/soc-dai.h +@@ -355,6 +355,7 @@ struct snd_soc_dai_ops { + + /* bit field */ + unsigned int no_capture_mute:1; ++ unsigned int mute_unmute_on_trigger:1; + }; + + struct snd_soc_cdai_ops { +--- a/sound/soc/soc-dai.c ++++ b/sound/soc/soc-dai.c +@@ -641,6 +641,10 @@ int snd_soc_pcm_dai_trigger(struct snd_p + ret = soc_dai_trigger(dai, substream, cmd); + if (ret < 0) + break; ++ ++ if (dai->driver->ops && dai->driver->ops->mute_unmute_on_trigger) ++ snd_soc_dai_digital_mute(dai, 0, substream->stream); ++ + soc_dai_mark_push(dai, substream, trigger); + } + break; +@@ -651,6 +655,9 @@ int snd_soc_pcm_dai_trigger(struct snd_p + if (rollback && !soc_dai_mark_match(dai, substream, trigger)) + continue; + ++ if (dai->driver->ops && dai->driver->ops->mute_unmute_on_trigger) ++ snd_soc_dai_digital_mute(dai, 1, substream->stream); ++ + r = soc_dai_trigger(dai, substream, cmd); + if (r < 0) + ret = r; /* use last ret */ +--- a/sound/soc/soc-pcm.c ++++ b/sound/soc/soc-pcm.c +@@ -896,8 +896,10 @@ static int __soc_pcm_prepare(struct snd_ + snd_soc_dapm_stream_event(rtd, substream->stream, + SND_SOC_DAPM_STREAM_START); + +- for_each_rtd_dais(rtd, i, dai) +- snd_soc_dai_digital_mute(dai, 0, substream->stream); ++ for_each_rtd_dais(rtd, i, dai) { ++ if (dai->driver->ops && !dai->driver->ops->mute_unmute_on_trigger) ++ snd_soc_dai_digital_mute(dai, 0, substream->stream); ++ } + + out: + return soc_pcm_ret(rtd, ret); +@@ -939,8 +941,10 @@ static int soc_pcm_hw_clean(struct snd_s + if (snd_soc_dai_active(dai) == 1) + soc_pcm_set_dai_params(dai, NULL); + +- if (snd_soc_dai_stream_active(dai, substream->stream) == 1) +- snd_soc_dai_digital_mute(dai, 1, substream->stream); ++ if (snd_soc_dai_stream_active(dai, substream->stream) == 1) { ++ if (dai->driver->ops && !dai->driver->ops->mute_unmute_on_trigger) ++ snd_soc_dai_digital_mute(dai, 1, substream->stream); ++ } + } + + /* run the stream event */ diff --git a/queue-6.5/series b/queue-6.5/series index d21ffa29ba4..b338e0bc6ac 100644 --- a/queue-6.5/series +++ b/queue-6.5/series @@ -326,3 +326,5 @@ ima-annotate-iint-mutex-to-avoid-lockdep-false-positive-warnings.patch ima-detect-changes-to-the-backing-overlay-file.patch netfilter-nf_tables-remove-catchall-element-in-gc-sy.patch netfilter-nf_tables-split-async-and-sync-catchall-in.patch +asoc-soc-dai-add-flag-to-mute-and-unmute-stream-during-trigger.patch +asoc-codecs-wsa883x-make-use-of-new-mute_unmute_on_trigger-flag.patch -- 2.47.3