Commit 28e9ad92 authored by Mark Brown's avatar Mark Brown

ASoC: Add a late_probe() callback to cards

This is run after the DAPM widgets and routes are added, allowing setup
of things like jacks using the routes. The main card probe() is run before
anything else so can't be used for this purpose.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent b8ad29de
...@@ -682,6 +682,7 @@ struct snd_soc_card { ...@@ -682,6 +682,7 @@ struct snd_soc_card {
bool instantiated; bool instantiated;
int (*probe)(struct snd_soc_card *card); int (*probe)(struct snd_soc_card *card);
int (*late_probe)(struct snd_soc_card *card);
int (*remove)(struct snd_soc_card *card); int (*remove)(struct snd_soc_card *card);
/* the pre and post PM functions are used to do any PM work before and /* the pre and post PM functions are used to do any PM work before and
......
...@@ -1892,6 +1892,15 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) ...@@ -1892,6 +1892,15 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
snprintf(card->snd_card->longname, sizeof(card->snd_card->longname), snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
"%s", card->name); "%s", card->name);
if (card->late_probe) {
ret = card->late_probe(card);
if (ret < 0) {
dev_err(card->dev, "%s late_probe() failed: %d\n",
card->name, ret);
goto probe_aux_dev_err;
}
}
ret = snd_card_register(card->snd_card); ret = snd_card_register(card->snd_card);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "asoc: failed to register soundcard for %s\n", card->name); printk(KERN_ERR "asoc: failed to register soundcard for %s\n", card->name);
......
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