diff options
author | Stephan Gerhold <stephan@gerhold.net> | 2021-12-14 17:20:48 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-12-23 21:34:26 +0300 |
commit | 2623e66de125ba153e41be6a0b8af24cae8aa436 (patch) | |
tree | 181c114e846f88be859b4b732166f77d149d0f72 /sound | |
parent | 37a49da9a7d5ac1f7128000de42ff222da46ba7a (diff) | |
download | linux-2623e66de125ba153e41be6a0b8af24cae8aa436.tar.xz |
ASoC: qcom: common: Parse "pin-switches" and "widgets" from DT
Use the DT helpers in the ASoC core to parse the "pin-switches" and
"widgets" properties from the device tree. This allows adding extra
mixers to disable e.g. an extra speaker amplifier that would be
normally powered on automatically because it is connected to a shared
output pin.
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20211214142049.20422-4-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/qcom/common.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c index e1bf04d00625..c407684ce1a2 100644 --- a/sound/soc/qcom/common.c +++ b/sound/soc/qcom/common.c @@ -26,6 +26,12 @@ int qcom_snd_parse_of(struct snd_soc_card *card) return ret; } + if (of_property_read_bool(dev->of_node, "widgets")) { + ret = snd_soc_of_parse_audio_simple_widgets(card, "widgets"); + if (ret) + return ret; + } + /* DAPM routes */ if (of_property_read_bool(dev->of_node, "audio-routing")) { ret = snd_soc_of_parse_audio_routing(card, "audio-routing"); @@ -39,6 +45,10 @@ int qcom_snd_parse_of(struct snd_soc_card *card) return ret; } + ret = snd_soc_of_parse_pin_switches(card, "pin-switches"); + if (ret) + return ret; + ret = snd_soc_of_parse_aux_devs(card, "aux-devs"); if (ret) return ret; |