diff options
author | Liam Girdwood <lrg@ti.com> | 2011-07-04 22:10:53 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-07-05 11:07:41 -0700 |
commit | cb2cf612fbdf457291b6e47064fed24f0dfdd9a5 (patch) | |
tree | 7d503087917ada2f27af4776aa6fcb3fa67963ab /sound/soc/soc-core.c | |
parent | b7950641374ddb41e9a03ff61b43f9ab3fcf763d (diff) | |
download | lwn-cb2cf612fbdf457291b6e47064fed24f0dfdd9a5.tar.gz lwn-cb2cf612fbdf457291b6e47064fed24f0dfdd9a5.zip |
ASoC: core - Add convenience register for platform kcontrol and DAPM
Allow platform probe to register platform kcontrols and DAPM just like
the CODEC probe().
Signed-off-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 | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 38f954af7bb5..3049c37b14e0 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -998,6 +998,10 @@ static int soc_probe_platform(struct snd_soc_card *card, if (!try_module_get(platform->dev->driver->owner)) return -ENODEV; + if (driver->dapm_widgets) + snd_soc_dapm_new_controls(&platform->dapm, + driver->dapm_widgets, driver->num_dapm_widgets); + if (driver->probe) { ret = driver->probe(platform); if (ret < 0) { @@ -1008,6 +1012,13 @@ static int soc_probe_platform(struct snd_soc_card *card, } } + if (driver->controls) + snd_soc_add_platform_controls(platform, driver->controls, + driver->num_controls); + if (driver->dapm_routes) + snd_soc_dapm_add_routes(&platform->dapm, driver->dapm_routes, + driver->num_dapm_routes); + /* mark platform as probed and add to card platform list */ platform->probed = 1; list_add(&platform->card_list, &card->platform_dev_list); |