diff options
author | Stephen Warren <swarren@nvidia.com> | 2011-04-28 19:37:59 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-05-03 14:28:57 -0400 |
commit | fad598887dc0d89ffee3e51281a8143beb2ae58c (patch) | |
tree | 49cbb65d198f13b534f606409335c31703043a34 /sound/soc/soc-dapm.c | |
parent | 82cfecdc03499be63262d60daf859b4cc1ea3fba (diff) |
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.c | 12 |
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, | |||
400 | path->long_name = NULL; | 400 | path->long_name = NULL; |
401 | return ret; | 401 | return ret; |
402 | } | 402 | } |
403 | w->kcontrols[i] = path->kcontrol; | ||
403 | } | 404 | } |
404 | } | 405 | } |
405 | return ret; | 406 | return ret; |
@@ -442,6 +443,8 @@ static int dapm_new_mux(struct snd_soc_dapm_context *dapm, | |||
442 | if (ret < 0) | 443 | if (ret < 0) |
443 | goto err; | 444 | goto err; |
444 | 445 | ||
446 | w->kcontrols[0] = kcontrol; | ||
447 | |||
445 | list_for_each_entry(path, &w->sources, list_sink) | 448 | list_for_each_entry(path, &w->sources, list_sink) |
446 | path->kcontrol = kcontrol; | 449 | path->kcontrol = kcontrol; |
447 | 450 | ||
@@ -1480,6 +1483,7 @@ static void dapm_free_widgets(struct snd_soc_dapm_context *dapm) | |||
1480 | kfree(p->long_name); | 1483 | kfree(p->long_name); |
1481 | kfree(p); | 1484 | kfree(p); |
1482 | } | 1485 | } |
1486 | kfree(w->kcontrols); | ||
1483 | kfree(w->name); | 1487 | kfree(w->name); |
1484 | kfree(w); | 1488 | kfree(w); |
1485 | } | 1489 | } |
@@ -1730,6 +1734,14 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm) | |||
1730 | if (w->new) | 1734 | if (w->new) |
1731 | continue; | 1735 | continue; |
1732 | 1736 | ||
1737 | if (w->num_kcontrols) { | ||
1738 | w->kcontrols = kzalloc(w->num_kcontrols * | ||
1739 | sizeof(struct snd_kcontrol *), | ||
1740 | GFP_KERNEL); | ||
1741 | if (!w->kcontrols) | ||
1742 | return -ENOMEM; | ||
1743 | } | ||
1744 | |||
1733 | switch(w->id) { | 1745 | switch(w->id) { |
1734 | case snd_soc_dapm_switch: | 1746 | case snd_soc_dapm_switch: |
1735 | case snd_soc_dapm_mixer: | 1747 | case snd_soc_dapm_mixer: |