diff options
author | Mark Brown <broonie@kernel.org> | 2015-03-04 20:07:20 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-03-04 20:07:20 -0500 |
commit | 0af1327ba0393a98263b8d4244f21d1500a52271 (patch) | |
tree | 689aba0d436890fbfe1b688c1ff1636ffc19cec1 | |
parent | 1dfcab55e90500468f1a0646a8549e8eaa90cd7a (diff) | |
parent | 3185878a70e721644b0e32ebbc0a039616551949 (diff) |
Merge remote-tracking branch 'asoc/topic/dapm-dt' into asoc-next
-rw-r--r-- | include/sound/soc.h | 5 | ||||
-rw-r--r-- | sound/soc/fsl/fsl-asoc-card.c | 6 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 16 |
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 30579ca5bacb..5c0658d49609 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1561,6 +1561,10 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) | |||
1561 | snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets, | 1561 | snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets, |
1562 | card->num_dapm_widgets); | 1562 | card->num_dapm_widgets); |
1563 | 1563 | ||
1564 | if (card->of_dapm_widgets) | ||
1565 | snd_soc_dapm_new_controls(&card->dapm, card->of_dapm_widgets, | ||
1566 | card->num_of_dapm_widgets); | ||
1567 | |||
1564 | /* initialise the sound card only once */ | 1568 | /* initialise the sound card only once */ |
1565 | if (card->probe) { | 1569 | if (card->probe) { |
1566 | ret = card->probe(card); | 1570 | ret = card->probe(card); |
@@ -1616,6 +1620,10 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) | |||
1616 | snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, | 1620 | snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, |
1617 | card->num_dapm_routes); | 1621 | card->num_dapm_routes); |
1618 | 1622 | ||
1623 | if (card->of_dapm_routes) | ||
1624 | snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes, | ||
1625 | card->num_of_dapm_routes); | ||
1626 | |||
1619 | for (i = 0; i < card->num_links; i++) { | 1627 | for (i = 0; i < card->num_links; i++) { |
1620 | if (card->dai_link[i].dai_fmt) | 1628 | if (card->dai_link[i].dai_fmt) |
1621 | snd_soc_runtime_set_dai_fmt(&card->rtd[i], | 1629 | snd_soc_runtime_set_dai_fmt(&card->rtd[i], |
@@ -3223,8 +3231,8 @@ int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card, | |||
3223 | widgets[i].name = wname; | 3231 | widgets[i].name = wname; |
3224 | } | 3232 | } |
3225 | 3233 | ||
3226 | card->dapm_widgets = widgets; | 3234 | card->of_dapm_widgets = widgets; |
3227 | card->num_dapm_widgets = num_widgets; | 3235 | card->num_of_dapm_widgets = num_widgets; |
3228 | 3236 | ||
3229 | return 0; | 3237 | return 0; |
3230 | } | 3238 | } |
@@ -3308,8 +3316,8 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, | |||
3308 | } | 3316 | } |
3309 | } | 3317 | } |
3310 | 3318 | ||
3311 | card->num_dapm_routes = num_routes; | 3319 | card->num_of_dapm_routes = num_routes; |
3312 | card->dapm_routes = routes; | 3320 | card->of_dapm_routes = routes; |
3313 | 3321 | ||
3314 | return 0; | 3322 | return 0; |
3315 | } | 3323 | } |