aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-03-02 13:36:34 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-03-03 06:15:35 -0500
commit28e9ad921d3b7defd8940a3e30e8241c8ed734db (patch)
treef37a1eaf18ed48fcf51c1f30410f7d3d82a9dbff
parentb8ad29debd7401d257da923480d32838172c431a (diff)
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: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r--include/sound/soc.h1
-rw-r--r--sound/soc/soc-core.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 11d59bd13886..9c2a6dd170f1 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -682,6 +682,7 @@ struct snd_soc_card {
682 bool instantiated; 682 bool instantiated;
683 683
684 int (*probe)(struct snd_soc_card *card); 684 int (*probe)(struct snd_soc_card *card);
685 int (*late_probe)(struct snd_soc_card *card);
685 int (*remove)(struct snd_soc_card *card); 686 int (*remove)(struct snd_soc_card *card);
686 687
687 /* the pre and post PM functions are used to do any PM work before and 688 /* the pre and post PM functions are used to do any PM work before and
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 6a2839c18447..8926d38fc5a3 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1892,6 +1892,15 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
1892 snprintf(card->snd_card->longname, sizeof(card->snd_card->longname), 1892 snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
1893 "%s", card->name); 1893 "%s", card->name);
1894 1894
1895 if (card->late_probe) {
1896 ret = card->late_probe(card);
1897 if (ret < 0) {
1898 dev_err(card->dev, "%s late_probe() failed: %d\n",
1899 card->name, ret);
1900 goto probe_aux_dev_err;
1901 }
1902 }
1903
1895 ret = snd_card_register(card->snd_card); 1904 ret = snd_card_register(card->snd_card);
1896 if (ret < 0) { 1905 if (ret < 0) {
1897 printk(KERN_ERR "asoc: failed to register soundcard for %s\n", card->name); 1906 printk(KERN_ERR "asoc: failed to register soundcard for %s\n", card->name);