Skip to content

Commit

Permalink
ASoC: qcom: common: Parse "pin-switches" and "widgets" from DT
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephan Gerhold authored and Mark Brown committed Dec 23, 2021

Unverified

No user is associated with the committer email.
1 parent 37a49da commit 2623e66
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sound/soc/qcom/common.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 2623e66

Please sign in to comment.