diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2011-04-30 19:45:49 +0200 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-05-03 18:43:44 +0100 |
commit | d5d1e0bef4385a0cd726613c0fc1909cd23efd39 (patch) | |
tree | 13942d02a969bfe93a8c32f2449282a475c7ceef /sound/soc/soc-core.c | |
parent | 8eecaf62445e175572ffabaab090b471001c5a2c (diff) | |
download | linux-3.10-d5d1e0bef4385a0cd726613c0fc1909cd23efd39.tar.gz linux-3.10-d5d1e0bef4385a0cd726613c0fc1909cd23efd39.tar.bz2 linux-3.10-d5d1e0bef4385a0cd726613c0fc1909cd23efd39.zip |
ASoC: Move DAPM widget debugfs entry creation to snd_soc_dapm_new_widgets
Currently debugfs entries for a DAPM widgets are only added in
snd_soc_dapm_debugfs_init. If a widget is added later (for example in the
dai_link's probe callback) it will not show up in debugfs.
This patch moves the creation of the widget debugfs entry to
snd_soc_dapm_new_widgets where it will be added after the widget has been
properly instantiated.
As a side-effect this will also reduce the number of times the DAPM widget list
is iterated during a card's instantiation.
Since it is possible that snd_soc_dapm_new_widgets is invoked form the codecs or
cards probe callbacks, the creation of the debugfs dapm directory has to be
moved before these are called.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 983ec640d4d..fbd011ebe19 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1493,6 +1493,8 @@ static int soc_probe_codec(struct snd_soc_card *card, if (!try_module_get(codec->dev->driver->owner)) return -ENODEV; + soc_init_codec_debugfs(codec); + if (driver->probe) { ret = driver->probe(codec); if (ret < 0) { @@ -1513,8 +1515,6 @@ static int soc_probe_codec(struct snd_soc_card *card, snd_soc_dapm_add_routes(&codec->dapm, driver->dapm_routes, driver->num_dapm_routes); - soc_init_codec_debugfs(codec); - /* mark codec as probed and add to card codec list */ codec->probed = 1; list_add(&codec->card_list, &card->codec_dev_list); @@ -1523,6 +1523,7 @@ static int soc_probe_codec(struct snd_soc_card *card, return 0; err_probe: + soc_cleanup_codec_debugfs(codec); module_put(codec->dev->driver->owner); return ret; @@ -1873,6 +1874,10 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) card->dapm.card = card; list_add(&card->dapm.list, &card->dapm_list); +#ifdef CONFIG_DEBUG_FS + snd_soc_dapm_debugfs_init(&card->dapm, card->debugfs_card_root); +#endif + #ifdef CONFIG_PM_SLEEP /* deferred resume work */ INIT_WORK(&card->deferred_resume_work, soc_resume_deferred); @@ -1919,10 +1924,6 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, card->num_dapm_routes); -#ifdef CONFIG_DEBUG_FS - snd_soc_dapm_debugfs_init(&card->dapm, card->debugfs_card_root); -#endif - snprintf(card->snd_card->shortname, sizeof(card->snd_card->shortname), "%s", card->name); snprintf(card->snd_card->longname, sizeof(card->snd_card->longname), |