ASoC: qcom: apq8016-sbc: add support to routing via DT
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tue, 6 Sep 2016 09:57:43 +0000 (10:57 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 6 Sep 2016 11:28:23 +0000 (12:28 +0100)
This patch adds support to allow audio routing via Device Tree.
This is mostly used to specify MICBIAS and other power supplies
relation.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Documentation/devicetree/bindings/sound/qcom,apq8016-sbc.txt
sound/soc/qcom/apq8016_sbc.c

index 4812936..d9d8635 100644 (file)
@@ -16,6 +16,24 @@ Required properties:
                                * "spkr-iomux"
 - qcom,model           : Name of the sound card.
 
+- qcom,audio-routing   : A list of the connections between audio components.
+                         Each entry is a pair of strings, the first being the
+                         connection's sink, the second being the connection's
+                         source. Valid names could be power supplies, MicBias
+                         of msm8x16_wcd codec and the jacks on the board:
+
+                         Power supplies:
+                         * MIC BIAS External1
+                         * MIC BIAS External2
+                         * MIC BIAS Internal1
+                         * MIC BIAS Internal2
+
+                         Board connectors:
+                         * Headset Mic
+                         * Secondary Mic",
+                         * DMIC
+                         * Ext Spk
+
 Dai-link subnode properties and subnodes:
 
 Required dai-link subnodes:
@@ -37,6 +55,18 @@ sound: sound {
        reg-names = "mic-iomux", "spkr-iomux";
        qcom,model = "DB410c";
 
+       qcom,audio-routing =
+               "MIC BIAS External1", "Handset Mic",
+               "MIC BIAS Internal2", "Headset Mic",
+               "MIC BIAS External1", "Secondary Mic",
+               "AMIC1", "MIC BIAS External1",
+               "AMIC2", "MIC BIAS Internal2",
+               "AMIC3", "MIC BIAS External1",
+               "DMIC1", "MIC BIAS Internal1",
+               "MIC BIAS Internal1", "Digital Mic1",
+               "DMIC2", "MIC BIAS Internal1",
+               "MIC BIAS Internal1", "Digital Mic2";
+
        /* I2S - Internal codec */
        internal-dai-link@0 {
                cpu { /* PRIMARY */
index 5c3ccf3..07f91e9 100644 (file)
@@ -85,6 +85,15 @@ static struct apq8016_sbc_data *apq8016_sbc_parse_of(struct snd_soc_card *card)
                return ERR_PTR(ret);
        }
 
+       /* DAPM routes */
+       if (of_property_read_bool(node, "qcom,audio-routing")) {
+               ret = snd_soc_of_parse_audio_routing(card,
+                                       "qcom,audio-routing");
+               if (ret)
+                       return ERR_PTR(ret);
+       }
+
+
        /* Populate links */
        num_links = of_get_child_count(node);