summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2011-05-05 18:59:09 +0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-08 17:38:08 +0400
commit77530150fba769d7b7e260b3f16ed2294c1737b6 (patch)
tree2997c6071da7e6dbf5381fe69a0d9dab746e420c /sound
parent20ed0938bfb132638f68618ba2e694aafe24d3e2 (diff)
downloadlinux-77530150fba769d7b7e260b3f16ed2294c1737b6.tar.xz
ASoC: Create codec DAPM widgets before calling the codecs probe function
This allows to create DAPM routes depending on those widgets in the codecs probe function. This is helpful when supporting similar codecs with minor differences in the DAPM routing with the same driver. Something similar has already been done for cards in commit a841ebb9 (ASoC: Create card DAPM widgets early so they can be used in callbacks). 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')
-rw-r--r--sound/soc/soc-core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 133edeb9728a..a477e218aa28 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1495,6 +1495,10 @@ static int soc_probe_codec(struct snd_soc_card *card,
soc_init_codec_debugfs(codec);
+ if (driver->dapm_widgets)
+ snd_soc_dapm_new_controls(&codec->dapm, driver->dapm_widgets,
+ driver->num_dapm_widgets);
+
if (driver->probe) {
ret = driver->probe(codec);
if (ret < 0) {
@@ -1508,9 +1512,6 @@ static int soc_probe_codec(struct snd_soc_card *card,
if (driver->controls)
snd_soc_add_controls(codec, driver->controls,
driver->num_controls);
- if (driver->dapm_widgets)
- snd_soc_dapm_new_controls(&codec->dapm, driver->dapm_widgets,
- driver->num_dapm_widgets);
if (driver->dapm_routes)
snd_soc_dapm_add_routes(&codec->dapm, driver->dapm_routes,
driver->num_dapm_routes);