summaryrefslogtreecommitdiff
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2011-04-28 17:37:59 -0600
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-05-03 19:28:57 +0100
commitfad598887dc0d89ffee3e51281a8143beb2ae58c (patch)
tree49cbb65d198f13b534f606409335c31703043a34 /sound/soc/soc-dapm.c
parent82cfecdc03499be63262d60daf859b4cc1ea3fba (diff)
downloadlwn-fad598887dc0d89ffee3e51281a8143beb2ae58c.tar.gz
lwn-fad598887dc0d89ffee3e51281a8143beb2ae58c.zip
ASoC: Add w->kcontrols, and populate it
Future changes will need reference to the kcontrol created for a given kcontrol_new. Store the created kcontrol values now. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 35cc1ed00a44..85b2c94535f4 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -400,6 +400,7 @@ static int dapm_new_mixer(struct snd_soc_dapm_context *dapm,
path->long_name = NULL;
return ret;
}
+ w->kcontrols[i] = path->kcontrol;
}
}
return ret;
@@ -442,6 +443,8 @@ static int dapm_new_mux(struct snd_soc_dapm_context *dapm,
if (ret < 0)
goto err;
+ w->kcontrols[0] = kcontrol;
+
list_for_each_entry(path, &w->sources, list_sink)
path->kcontrol = kcontrol;
@@ -1480,6 +1483,7 @@ static void dapm_free_widgets(struct snd_soc_dapm_context *dapm)
kfree(p->long_name);
kfree(p);
}
+ kfree(w->kcontrols);
kfree(w->name);
kfree(w);
}
@@ -1730,6 +1734,14 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm)
if (w->new)
continue;
+ if (w->num_kcontrols) {
+ w->kcontrols = kzalloc(w->num_kcontrols *
+ sizeof(struct snd_kcontrol *),
+ GFP_KERNEL);
+ if (!w->kcontrols)
+ return -ENOMEM;
+ }
+
switch(w->id) {
case snd_soc_dapm_switch:
case snd_soc_dapm_mixer: