ASoC: qcom: common: Parse auxiliary devices from device tree
Subsystems (5)
cover ASoC: qcom: common: Parse auxiliary devices from device tree
In some cases we need to probe additional audio components that do not appear as part of the DAI links specified in the device tree. Examples for this are auxiliary devices such as analog amplifiers or codecs.
The ASoC core provides a way to probe these components by adding them to snd_soc_card->aux_dev.
This patch set allows specifying them in the device tree through a new "aux-devs" property.
Stephan Gerhold (2):
ASoC: dt-bindings: qcom: Document "aux-devs" property
ASoC: qcom: common: Parse auxiliary devices from device tree
.../devicetree/bindings/sound/qcom,apq8016-sbc.txt | 7 +++++++ Documentation/devicetree/bindings/sound/qcom,apq8096.txt | 8 ++++++++ Documentation/devicetree/bindings/sound/qcom,sdm845.txt | 8 ++++++++ sound/soc/qcom/common.c | 4 ++++ 4 files changed, 27 insertions(+)
Signature · 1 line
2.28.0
PATCH 1/2 ASoC: dt-bindings: qcom: Document "aux-devs" property
In some cases we need to probe additional audio components that do not appear as part of the DAI links specified in the device tree. Examples for this are auxiliary devices such as analog amplifiers or codecs.
To make them work they need to be added as part of "aux-devs" and connected to some other audio component using the audio routes configurable using "(qcom,)audio-routing".
--- .../devicetree/bindings/sound/qcom,apq8016-sbc.txt | 7 +++++++ Documentation/devicetree/bindings/sound/qcom,apq8096.txt | 8 ++++++++ Documentation/devicetree/bindings/sound/qcom,sdm845.txt | 8 ++++++++ 3 files changed, 23 insertions(+)
Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt +7 -0
@@ -34,6 +34,13 @@ Required properties: * DMIC * Ext Spk +Optional properties: + +- aux-devs : A list of phandles for auxiliary devices (e.g. analog + amplifiers) that do not appear directly within the DAI + links. Should be connected to another audio component + using "qcom,audio-routing". + Dai-link subnode properties and subnodes: Required dai-link subnodes:
Documentation/devicetree/bindings/sound/qcom,apq8096.txt +8 -0
@@ -55,6 +55,14 @@ This binding describes the APQ8096 sound card, which uses qdsp for audio. Value type: <stringlist> Definition: The user-visible name of this sound card. +- aux-devs + Usage: optional + Value type: <phandles with arguments> + Definition: A list of phandles for auxiliary devices (e.g. analog + amplifiers) that do not appear directly within the DAI + links. Should be connected to another audio component + using "audio-routing". + = dailinks Each subnode of sndcard represents either a dailink, and subnodes of each dailinks would be cpu/codec/platform dais.
Documentation/devicetree/bindings/sound/qcom,sdm845.txt +8 -0
@@ -24,6 +24,14 @@ This binding describes the SDM845 sound card, which uses qdsp for audio. Value type: <stringlist> Definition: The user-visible name of this sound card. +- aux-devs + Usage: optional + Value type: <phandles with arguments> + Definition: A list of phandles for auxiliary devices (e.g. analog + amplifiers) that do not appear directly within the DAI + links. Should be connected to another audio component + using "audio-routing". + = dailinks Each subnode of sndcard represents either a dailink, and subnodes of each dailinks would be cpu/codec/platform dais.
Signature · 1 line
2.28.0
Rob Herring
maintainerRe: [PATCH 1/2] ASoC: dt-bindings: qcom: Document "aux-devs" property
Quoted 40 lines · Stephan Gerhold
In some cases we need to probe additional audio components that do not appear as part of the DAI links specified in the device tree. Examples for this are auxiliary devices such as analog amplifiers or codecs.
To make them work they need to be added as part of "aux-devs" and connected to some other audio component using the audio routes configurable using "(qcom,)audio-routing".
Cc Srinivas Kandagatla <[email protected]>Signed-off-by Stephan Gerhold <[email protected]>--- .../devicetree/bindings/sound/qcom,apq8016-sbc.txt | 7 +++++++ Documentation/devicetree/bindings/sound/qcom,apq8096.txt | 8 ++++++++ Documentation/devicetree/bindings/sound/qcom,sdm845.txt | 8 ++++++++ 3 files changed, 23 insertions(+)Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt +7
-0@@ -34,6 +34,13 @@ Required properties: * DMIC * Ext Spk +Optional properties: + +- aux-devs : A list of phandles for auxiliary devices (e.g. analog + amplifiers) that do not appear directly within the DAI + links. Should be connected to another audio component + using "qcom,audio-routing". + Dai-link subnode properties and subnodes: Required dai-link subnodes:Documentation/devicetree/bindings/sound/qcom,apq8096.txt +0
-0
Documentation/devicetree/bindings/sound/qcom,apq8096.txt This binding describes the APQ8096 sound card, which uses qdsp for audio. · line 60
Quoted 6 lines
Documentation/devicetree/bindings/sound/qcom,apq8096.txt +3
-0@@ -55,6 +55,14 @@ This binding describes the APQ8096 sound card, which uses qdsp for audio. Value type: <stringlist> Definition: The user-visible name of this sound card. +- aux-devs + Usage: optional + Value type: <phandles with arguments>
How do you know how many arguments? It either has to be fixed or needs a #.*cells in the phandles. For the latter, you'd need to come up with a common binding.
Quoted 30 lines
Documentation/devicetree/bindings/sound/qcom,apq8096.txt +5
-0+ Definition: A list of phandles for auxiliary devices (e.g. analog + amplifiers) that do not appear directly within the DAI + links. Should be connected to another audio component + using "audio-routing". + = dailinks Each subnode of sndcard represents either a dailink, and subnodes of each dailinks would be cpu/codec/platform dais.Documentation/devicetree/bindings/sound/qcom,sdm845.txt +8
-0@@ -24,6 +24,14 @@ This binding describes the SDM845 sound card, which uses qdsp for audio. Value type: <stringlist> Definition: The user-visible name of this sound card. +- aux-devs + Usage: optional + Value type: <phandles with arguments> + Definition: A list of phandles for auxiliary devices (e.g. analog + amplifiers) that do not appear directly within the DAI + links. Should be connected to another audio component + using "audio-routing". + = dailinks Each subnode of sndcard represents either a dailink, and subnodes of each dailinks would be cpu/codec/platform dais.Signature · 1 line
2.28.0
Re: [PATCH 1/2] ASoC: dt-bindings: qcom: Document "aux-devs" property
Quoted 44 lines · Rob Herring
Quoted 43 lines · Stephan Gerhold
In some cases we need to probe additional audio components that do not appear as part of the DAI links specified in the device tree. Examples for this are auxiliary devices such as analog amplifiers or codecs.
To make them work they need to be added as part of "aux-devs" and connected to some other audio component using the audio routes configurable using "(qcom,)audio-routing".
Cc Srinivas Kandagatla <[email protected]>Signed-off-by Stephan Gerhold <[email protected]>--- .../devicetree/bindings/sound/qcom,apq8016-sbc.txt | 7 +++++++ Documentation/devicetree/bindings/sound/qcom,apq8096.txt | 8 ++++++++ Documentation/devicetree/bindings/sound/qcom,sdm845.txt | 8 ++++++++ 3 files changed, 23 insertions(+)Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt +7
-0@@ -34,6 +34,13 @@ Required properties: * DMIC * Ext Spk +Optional properties: + +- aux-devs : A list of phandles for auxiliary devices (e.g. analog + amplifiers) that do not appear directly within the DAI + links. Should be connected to another audio component + using "qcom,audio-routing". + Dai-link subnode properties and subnodes: Required dai-link subnodes:Documentation/devicetree/bindings/sound/qcom,apq8096.txt +0
-0@@ -55,6 +55,14 @@ This binding describes the APQ8096 sound card, which uses qdsp for audio. Value type: <stringlist> Definition: The user-visible name of this sound card.
Quoted 8 lines
Documentation/devicetree/bindings/sound/qcom,apq8096.txt This binding describes the APQ8096 sound card, which uses qdsp for audio. · line 60
Quoted 3 lines
Documentation/devicetree/bindings/sound/qcom,apq8096.txt +3
-0+- aux-devs + Usage: optional + Value type: <phandles with arguments>How do you know how many arguments? It either has to be fixed or needs a #.*cells in the phandles. For the latter, you'd need to come up with a common binding.
Actually the phandle should not have any arguments, seems like I just copied this from some other entry. Will fix this, thank you!
Stephan
PATCH 2/2 ASoC: qcom: common: Parse auxiliary devices from device tree
In reply to Stephan GerholdIn some cases we need to probe additional audio components that do not appear as part of the DAI links specified in the device tree. Examples for this are auxiliary devices such as analog amplifiers or codecs.
The ASoC core provides a way to probe these components by adding them to snd_soc_card->aux_dev. We can use the snd_soc_of_parse_aux_devs() function to parse them from the device tree.
As an example for this, some MSM8916 smartphones have an analog speaker amplifier connected to the HPHR output. With the new property this can be modelled as follows:
speaker-amp: audio-amplifier {
compatible = "simple-audio-amplifier";
enable-gpios = <&msmgpio 114 GPIO_ACTIVE_HIGH>;
sound-name-prefix = "Speaker Amp";
};
&sound {
aux-devs = <&speaker_amp>;
audio-routing = "Speaker Amp IN", "HPHR";
};--- sound/soc/qcom/common.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/soc/qcom/common.c +4 -0
@@ -39,6 +39,10 @@ int qcom_snd_parse_of(struct snd_soc_card *card)return ret; } + ret =snd_soc_of_parse_aux_devs (card,"aux-devs" ); +if (ret) +return ret; +/* Populate links */ num_links =of_get_child_count (dev->of_node);
Signature · 1 line
2.28.0