aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2015-04-10 11:09:21 -0400
committerMark Brown <broonie@kernel.org>2015-04-10 11:09:21 -0400
commit1ddca24c532247894eb4430e9315e690306cf860 (patch)
treee0021306bdc42615ba304b0ac4dd3db6b73cae55
parent5f97a4bd2c92aff216581d662a37163881ac3888 (diff)
parent3185878a70e721644b0e32ebbc0a039616551949 (diff)
Merge branch 'topic/dapm-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-core
-rw-r--r--include/sound/soc.h5
-rw-r--r--sound/soc/fsl/fsl-asoc-card.c6
-rw-r--r--sound/soc/soc-core.c16
3 files changed, 23 insertions, 4 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 0d1ade195628..f66a1ef98a40 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1071,11 +1071,16 @@ struct snd_soc_card {
1071 1071
1072 /* 1072 /*
1073 * Card-specific routes and widgets. 1073 * Card-specific routes and widgets.
1074 * Note: of_dapm_xxx for Device Tree; Otherwise for driver build-in.
1074 */ 1075 */
1075 const struct snd_soc_dapm_widget *dapm_widgets; 1076 const struct snd_soc_dapm_widget *dapm_widgets;
1076 int num_dapm_widgets; 1077 int num_dapm_widgets;
1077 const struct snd_soc_dapm_route *dapm_routes; 1078 const struct snd_soc_dapm_route *dapm_routes;
1078 int num_dapm_routes; 1079 int num_dapm_routes;
1080 const struct snd_soc_dapm_widget *of_dapm_widgets;
1081 int num_of_dapm_widgets;
1082 const struct snd_soc_dapm_route *of_dapm_routes;
1083 int num_of_dapm_routes;
1079 bool fully_routed; 1084 bool fully_routed;
1080 1085
1081 struct work_struct deferred_resume_work; 1086 struct work_struct deferred_resume_work;
diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 3f6959c8e2f7..de438871040b 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -512,6 +512,12 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
512 memcpy(priv->dai_link, fsl_asoc_card_dai, 512 memcpy(priv->dai_link, fsl_asoc_card_dai,
513 sizeof(struct snd_soc_dai_link) * ARRAY_SIZE(priv->dai_link)); 513 sizeof(struct snd_soc_dai_link) * ARRAY_SIZE(priv->dai_link));
514 514
515 ret = snd_soc_of_parse_audio_routing(&priv->card, "audio-routing");
516 if (ret) {
517 dev_err(&pdev->dev, "failed to parse audio-routing: %d\n", ret);
518 goto asrc_fail;
519 }
520
515 /* Normal DAI Link */ 521 /* Normal DAI Link */
516 priv->dai_link[0].cpu_of_node = cpu_np; 522 priv->dai_link[0].cpu_of_node = cpu_np;
517 priv->dai_link[0].codec_of_node = codec_np; 523 priv->dai_link[0].codec_of_node = codec_np;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 492e1976aab7..25fcd80cb108 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1609,6 +1609,10 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
1609 snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets, 1609 snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets,
1610 card->num_dapm_widgets); 1610 card->num_dapm_widgets);
1611 1611
1612 if (card->of_dapm_widgets)
1613 snd_soc_dapm_new_controls(&card->dapm, card->of_dapm_widgets,
1614 card->num_of_dapm_widgets);
1615
1612 /* initialise the sound card only once */ 1616 /* initialise the sound card only once */
1613 if (card->probe) { 1617 if (card->probe) {
1614 ret = card->probe(card); 1618 ret = card->probe(card);
@@ -1664,6 +1668,10 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
1664 snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, 1668 snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes,
1665 card->num_dapm_routes); 1669 card->num_dapm_routes);
1666 1670
1671 if (card->of_dapm_routes)
1672 snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes,
1673 card->num_of_dapm_routes);
1674
1667 for (i = 0; i < card->num_links; i++) { 1675 for (i = 0; i < card->num_links; i++) {
1668 if (card->dai_link[i].dai_fmt) 1676 if (card->dai_link[i].dai_fmt)
1669 snd_soc_runtime_set_dai_fmt(&card->rtd[i], 1677 snd_soc_runtime_set_dai_fmt(&card->rtd[i],
@@ -3272,8 +3280,8 @@ int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card,
3272 widgets[i].name = wname; 3280 widgets[i].name = wname;
3273 } 3281 }
3274 3282
3275 card->dapm_widgets = widgets; 3283 card->of_dapm_widgets = widgets;
3276 card->num_dapm_widgets = num_widgets; 3284 card->num_of_dapm_widgets = num_widgets;
3277 3285
3278 return 0; 3286 return 0;
3279} 3287}
@@ -3357,8 +3365,8 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
3357 } 3365 }
3358 } 3366 }
3359 3367
3360 card->num_dapm_routes = num_routes; 3368 card->num_of_dapm_routes = num_routes;
3361 card->dapm_routes = routes; 3369 card->of_dapm_routes = routes;
3362 3370
3363 return 0; 3371 return 0;
3364} 3372}