From: Greg Kroah-Hartman Date: Mon, 11 Dec 2023 12:41:21 +0000 (+0100) Subject: 6.6-stable patches X-Git-Tag: v4.14.333~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7f9b2c254b8dd902db48571e4811325cd205fcd7;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: asoc-ops-add-correct-range-check-for-limiting-volume.patch asoc-qcom-sc8280xp-limit-speaker-digital-volumes.patch --- diff --git a/queue-6.6/asoc-ops-add-correct-range-check-for-limiting-volume.patch b/queue-6.6/asoc-ops-add-correct-range-check-for-limiting-volume.patch new file mode 100644 index 00000000000..22ff7fe6fd4 --- /dev/null +++ b/queue-6.6/asoc-ops-add-correct-range-check-for-limiting-volume.patch @@ -0,0 +1,35 @@ +From fb9ad24485087e0f00d84bee7a5914640b2b9024 Mon Sep 17 00:00:00 2001 +From: Srinivas Kandagatla +Date: Mon, 4 Dec 2023 12:47:35 +0000 +Subject: ASoC: ops: add correct range check for limiting volume + +From: Srinivas Kandagatla + +commit fb9ad24485087e0f00d84bee7a5914640b2b9024 upstream. + +Volume can have ranges that start with negative values, ex: -84dB to ++40dB. Apply correct range check in snd_soc_limit_volume before setting +the platform_max. Without this patch, for example setting a 0dB limit on +a volume range of -84dB to +40dB would fail. + +Signed-off-by: Srinivas Kandagatla +Tested-by: Johan Hovold +Reviewed-by: Johan Hovold +Link: https://lore.kernel.org/r/20231204124736.132185-2-srinivas.kandagatla@linaro.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/soc-ops.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/soc/soc-ops.c ++++ b/sound/soc/soc-ops.c +@@ -661,7 +661,7 @@ int snd_soc_limit_volume(struct snd_soc_ + kctl = snd_soc_card_get_kcontrol(card, name); + if (kctl) { + struct soc_mixer_control *mc = (struct soc_mixer_control *)kctl->private_value; +- if (max <= mc->max) { ++ if (max <= mc->max - mc->min) { + mc->platform_max = max; + ret = 0; + } diff --git a/queue-6.6/asoc-qcom-sc8280xp-limit-speaker-digital-volumes.patch b/queue-6.6/asoc-qcom-sc8280xp-limit-speaker-digital-volumes.patch new file mode 100644 index 00000000000..d6e43ac0268 --- /dev/null +++ b/queue-6.6/asoc-qcom-sc8280xp-limit-speaker-digital-volumes.patch @@ -0,0 +1,51 @@ +From 716d4e5373e9d1ae993485ab2e3b893bf7104fb1 Mon Sep 17 00:00:00 2001 +From: Srinivas Kandagatla +Date: Mon, 4 Dec 2023 12:47:36 +0000 +Subject: ASoC: qcom: sc8280xp: Limit speaker digital volumes + +From: Srinivas Kandagatla + +commit 716d4e5373e9d1ae993485ab2e3b893bf7104fb1 upstream. + +Limit the speaker digital gains to 0dB so that the users will not damage them. +Currently there is a limit in UCM, but this does not stop the user form +changing the digital gains from command line. So limit this in driver +which makes the speakers more safer without active speaker protection in +place. + +Signed-off-by: Srinivas Kandagatla +Reviewed-by: Johan Hovold +Tested-by: Johan Hovold +Link: https://lore.kernel.org/r/20231204124736.132185-3-srinivas.kandagatla@linaro.org +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/qcom/sc8280xp.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +--- a/sound/soc/qcom/sc8280xp.c ++++ b/sound/soc/qcom/sc8280xp.c +@@ -27,6 +27,23 @@ struct sc8280xp_snd_data { + static int sc8280xp_snd_init(struct snd_soc_pcm_runtime *rtd) + { + struct sc8280xp_snd_data *data = snd_soc_card_get_drvdata(rtd->card); ++ struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); ++ struct snd_soc_card *card = rtd->card; ++ ++ switch (cpu_dai->id) { ++ case WSA_CODEC_DMA_RX_0: ++ case WSA_CODEC_DMA_RX_1: ++ /* ++ * set limit of 0dB on Digital Volume for Speakers, ++ * this can prevent damage of speakers to some extent without ++ * active speaker protection ++ */ ++ snd_soc_limit_volume(card, "WSA_RX0 Digital Volume", 84); ++ snd_soc_limit_volume(card, "WSA_RX1 Digital Volume", 84); ++ break; ++ default: ++ break; ++ } + + return qcom_snd_wcd_jack_setup(rtd, &data->jack, &data->jack_setup); + } diff --git a/queue-6.6/series b/queue-6.6/series index 03253d805f5..28fa3575512 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -205,4 +205,5 @@ drm-amdgpu-disable-mcbp-by-default.patch perf-fix-perf_event_validate_size.patch x86-sev-fix-kernel-crash-due-to-late-update-to-read-.patch gpiolib-sysfs-fix-error-handling-on-failed-export.patch -drm-amd-display-increase-num-voltage-states-to-40.patch +asoc-ops-add-correct-range-check-for-limiting-volume.patch +asoc-qcom-sc8280xp-limit-speaker-digital-volumes.patch