summaryrefslogtreecommitdiff
path: root/sound/soc/generic
diff options
context:
space:
mode:
authorXiubo Li <Li.Xiubo@freescale.com>2013-12-23 08:57:01 +0400
committerMark Brown <broonie@linaro.org>2013-12-31 16:38:10 +0400
commitd4c22094b256a7327346738721b89a78d4680b08 (patch)
treea1e9037df78dff20aa97b0e6ed5a0dfc967325b0 /sound/soc/generic
parente1acb40a3addc9aceb4600f04c9c86b50770b9b8 (diff)
downloadlinux-d4c22094b256a7327346738721b89a78d4680b08.tar.xz
ASoC: simple-card: Add DAPM routes parse from device tree
Parses a simple DAPM route table from device tree. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/generic')
-rw-r--r--sound/soc/generic/simple-card.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 3d190d05ad4a..6230efb05fd7 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -116,12 +116,18 @@ static int asoc_simple_card_parse_of(struct device_node *node,
{
struct device_node *np;
char *name;
- int ret = 0;
+ int ret;
/* get CPU/CODEC common format via simple-audio-card,format */
info->daifmt = snd_soc_of_parse_daifmt(node, "simple-audio-card,") &
(SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_INV_MASK);
+ /* DAPM routes */
+ ret = snd_soc_of_parse_audio_routing(&info->snd_card,
+ "simple-audio-routing");
+ if (ret)
+ return ret;
+
/* CPU sub-node */
ret = -EINVAL;
np = of_get_child_by_name(node, "simple-audio-card,cpu");
@@ -182,6 +188,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
cinfo = devm_kzalloc(dev, sizeof(*cinfo), GFP_KERNEL);
if (cinfo) {
int ret;
+ cinfo->snd_card.dev = &pdev->dev;
ret = asoc_simple_card_parse_of(np, cinfo, dev,
&of_cpu,
&of_codec,
@@ -193,6 +200,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
}
}
} else {
+ cinfo->snd_card.dev = &pdev->dev;
cinfo = pdev->dev.platform_data;
}
@@ -232,7 +240,6 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
cinfo->snd_card.owner = THIS_MODULE;
cinfo->snd_card.dai_link = &cinfo->snd_link;
cinfo->snd_card.num_links = 1;
- cinfo->snd_card.dev = &pdev->dev;
return devm_snd_soc_register_card(&pdev->dev, &cinfo->snd_card);
}