Commit 1ddca24c authored by Mark Brown's avatar Mark Brown

Merge branch 'topic/dapm-dt' of...

Merge branch 'topic/dapm-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-core
parents 5f97a4bd 3185878a
...@@ -1071,11 +1071,16 @@ struct snd_soc_card { ...@@ -1071,11 +1071,16 @@ struct snd_soc_card {
/* /*
* Card-specific routes and widgets. * Card-specific routes and widgets.
* Note: of_dapm_xxx for Device Tree; Otherwise for driver build-in.
*/ */
const struct snd_soc_dapm_widget *dapm_widgets; const struct snd_soc_dapm_widget *dapm_widgets;
int num_dapm_widgets; int num_dapm_widgets;
const struct snd_soc_dapm_route *dapm_routes; const struct snd_soc_dapm_route *dapm_routes;
int num_dapm_routes; int num_dapm_routes;
const struct snd_soc_dapm_widget *of_dapm_widgets;
int num_of_dapm_widgets;
const struct snd_soc_dapm_route *of_dapm_routes;
int num_of_dapm_routes;
bool fully_routed; bool fully_routed;
struct work_struct deferred_resume_work; struct work_struct deferred_resume_work;
......
...@@ -512,6 +512,12 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) ...@@ -512,6 +512,12 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
memcpy(priv->dai_link, fsl_asoc_card_dai, memcpy(priv->dai_link, fsl_asoc_card_dai,
sizeof(struct snd_soc_dai_link) * ARRAY_SIZE(priv->dai_link)); sizeof(struct snd_soc_dai_link) * ARRAY_SIZE(priv->dai_link));
ret = snd_soc_of_parse_audio_routing(&priv->card, "audio-routing");
if (ret) {
dev_err(&pdev->dev, "failed to parse audio-routing: %d\n", ret);
goto asrc_fail;
}
/* Normal DAI Link */ /* Normal DAI Link */
priv->dai_link[0].cpu_of_node = cpu_np; priv->dai_link[0].cpu_of_node = cpu_np;
priv->dai_link[0].codec_of_node = codec_np; priv->dai_link[0].codec_of_node = codec_np;
......
...@@ -1609,6 +1609,10 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) ...@@ -1609,6 +1609,10 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets, snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets,
card->num_dapm_widgets); card->num_dapm_widgets);
if (card->of_dapm_widgets)
snd_soc_dapm_new_controls(&card->dapm, card->of_dapm_widgets,
card->num_of_dapm_widgets);
/* initialise the sound card only once */ /* initialise the sound card only once */
if (card->probe) { if (card->probe) {
ret = card->probe(card); ret = card->probe(card);
...@@ -1664,6 +1668,10 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) ...@@ -1664,6 +1668,10 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes,
card->num_dapm_routes); card->num_dapm_routes);
if (card->of_dapm_routes)
snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes,
card->num_of_dapm_routes);
for (i = 0; i < card->num_links; i++) { for (i = 0; i < card->num_links; i++) {
if (card->dai_link[i].dai_fmt) if (card->dai_link[i].dai_fmt)
snd_soc_runtime_set_dai_fmt(&card->rtd[i], 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,8 +3280,8 @@ int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card,
widgets[i].name = wname; widgets[i].name = wname;
} }
card->dapm_widgets = widgets; card->of_dapm_widgets = widgets;
card->num_dapm_widgets = num_widgets; card->num_of_dapm_widgets = num_widgets;
return 0; return 0;
} }
...@@ -3357,8 +3365,8 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, ...@@ -3357,8 +3365,8 @@ int snd_soc_of_parse_audio_routing(struct snd_soc_card *card,
} }
} }
card->num_dapm_routes = num_routes; card->num_of_dapm_routes = num_routes;
card->dapm_routes = routes; card->of_dapm_routes = routes;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment