ASoC: qcom: sc8280xp: Limit speaker digital volumes
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Mon, 4 Dec 2023 12:47:36 +0000 (12:47 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Dec 2023 17:45:35 +0000 (18:45 +0100)
commitba6e4b997181497e51419fad2b73d229bffa1787
treedb8888c16da0d229f7b8ee4778f15a9730efe866
parentc66d39f18e0ef16bac8c8491b657051f531a1eba
ASoC: qcom: sc8280xp: Limit speaker digital volumes

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