]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Dec 2023 13:40:50 +0000 (14:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Dec 2023 13:40:50 +0000 (14:40 +0100)
added patches:
asoc-qcom-sc8280xp-limit-speaker-digital-volumes.patch

queue-6.6/asoc-qcom-sc8280xp-limit-speaker-digital-volumes.patch [new file with mode: 0644]
queue-6.6/series

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 (file)
index 0000000..1d4c0ec
--- /dev/null
@@ -0,0 +1,53 @@
+From 716d4e5373e9d1ae993485ab2e3b893bf7104fb1 Mon Sep 17 00:00:00 2001
+From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+Date: Mon, 4 Dec 2023 12:47:36 +0000
+Subject: ASoC: qcom: sc8280xp: Limit speaker digital volumes
+
+From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+
+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 <srinivas.kandagatla@linaro.org>
+Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
+Tested-by: Johan Hovold <johan+linaro@kernel.org>
+Link: https://lore.kernel.org/r/20231204124736.132185-3-srinivas.kandagatla@linaro.org
+Signed-off-by: Mark Brown <broonie@kernel.org>
+[ johan: backport to 6.6; rename snd_soc_rtd_to_cpu() ]
+Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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 = asoc_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);
+ }
index da4ba72b43b880c1168db2b540a2e5529484ab04..c9e4a33a7a75ccc40699a0aa05d8058f5ce2ce09 100644 (file)
@@ -236,3 +236,4 @@ mips-loongson64-reserve-vgabios-memory-on-boot.patch
 mips-loongson64-handle-more-memory-types-passed-from-firmware.patch
 mips-loongson64-enable-dma-noncoherent-support.patch
 netfilter-nft_set_pipapo-skip-inactive-elements-during-set-walk.patch
+asoc-qcom-sc8280xp-limit-speaker-digital-volumes.patch