]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: qcom: apq8016-sbc: Add support to multi codec.
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Thu, 20 Oct 2016 14:20:48 +0000 (15:20 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 24 Oct 2016 17:02:31 +0000 (18:02 +0100)
This patch adds support to multi codec, as the msm8916 codec is now
split into two codecs, Analog and Digital.

Also update the bindings and example to show that the card supports
multicodec.

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

index 72c192801a691c7d220ce1350185ffb25ef6fdea..6a4aadc4ce06b27ff059c64f6c438d0fef863b21 100644 (file)
@@ -44,7 +44,7 @@ Required dai-link subnodes:
 Required CPU/CODEC subnodes properties:
 
 -link-name             : Name of the dai link.
--sound-dai             : phandle and port of CPU/CODEC
+-sound-dai             : phandle/s and port of CPU/CODEC
 
 Example:
 
@@ -72,7 +72,7 @@ sound: sound {
                        sound-dai = <&lpass MI2S_PRIMARY>;
                };
                codec {
-                       sound-dai = <&wcd_codec 0>;
+                       sound-dai = <&lpass_codec 0>, <&wcd_codec 0>;
                };
        };
 
index 07f91e918b2349b75271ac319f85e6416a4199e6..d084d746829988f5e76c3131e894e3e74e1ff786 100644 (file)
@@ -123,20 +123,15 @@ static struct apq8016_sbc_data *apq8016_sbc_parse_of(struct snd_soc_card *card)
                        return ERR_PTR(-EINVAL);
                }
 
-               link->codec_of_node = of_parse_phandle(codec, "sound-dai", 0);
-               if (!link->codec_of_node) {
-                       dev_err(card->dev, "error getting codec phandle\n");
-                       return ERR_PTR(-EINVAL);
-               }
-
                ret = snd_soc_of_get_dai_name(cpu, &link->cpu_dai_name);
                if (ret) {
                        dev_err(card->dev, "error getting cpu dai name\n");
                        return ERR_PTR(ret);
                }
 
-               ret = snd_soc_of_get_dai_name(codec, &link->codec_dai_name);
-               if (ret) {
+               ret = snd_soc_of_get_dai_link_codecs(dev, codec, link);
+
+               if (ret < 0) {
                        dev_err(card->dev, "error getting codec dai name\n");
                        return ERR_PTR(ret);
                }