summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorLiam Girdwood <lrg@ti.com>2012-03-07 12:47:41 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-01 12:28:21 +0200
commitbe09ad90e17b79fdb0d513a31e814ff4d42e3dff (patch)
treee26440a88935b4d34fd9dd3d8e9680259e0a6c5a /sound/soc
parentASoC: dapm: lock mixer & mux update power with DAPM mutex (diff)
downloadlinux-be09ad90e17b79fdb0d513a31e814ff4d42e3dff.tar.xz
linux-be09ad90e17b79fdb0d513a31e814ff4d42e3dff.zip
ASoC: core: Add platform DAI widget mapping
Add platform driver support for CPU DAI DAPM widgets. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/soc-core.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 4a145cb43018..42ce14485b92 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1074,6 +1074,7 @@ static int soc_probe_platform(struct snd_soc_card *card,
{
int ret = 0;
const struct snd_soc_platform_driver *driver = platform->driver;
+ struct snd_soc_dai *dai;
platform->card = card;
platform->dapm.card = card;
@@ -1087,6 +1088,14 @@ static int soc_probe_platform(struct snd_soc_card *card,
snd_soc_dapm_new_controls(&platform->dapm,
driver->dapm_widgets, driver->num_dapm_widgets);
+ /* Create DAPM widgets for each DAI stream */
+ list_for_each_entry(dai, &dai_list, list) {
+ if (dai->dev != platform->dev)
+ continue;
+
+ snd_soc_dapm_new_dai_widgets(&platform->dapm, dai);
+ }
+
if (driver->probe) {
ret = driver->probe(platform);
if (ret < 0) {
@@ -1222,9 +1231,12 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num, int order)
/* probe the cpu_dai */
if (!cpu_dai->probed &&
cpu_dai->driver->probe_order == order) {
+ cpu_dai->dapm.card = card;
if (!try_module_get(cpu_dai->dev->driver->owner))
return -ENODEV;
+ snd_soc_dapm_new_dai_widgets(&cpu_dai->dapm, cpu_dai);
+
if (cpu_dai->driver->probe) {
ret = cpu_dai->driver->probe(cpu_dai);
if (ret < 0) {
@@ -3242,6 +3254,7 @@ int snd_soc_register_dai(struct device *dev,
dai->dev = dev;
dai->driver = dai_drv;
+ dai->dapm.dev = dev;
if (!dai->driver->ops)
dai->driver->ops = &null_dai_ops;
@@ -3318,6 +3331,7 @@ int snd_soc_register_dais(struct device *dev,
dai->id = dai->driver->id;
else
dai->id = i;
+ dai->dapm.dev = dev;
if (!dai->driver->ops)
dai->driver->ops = &null_dai_ops;