diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2011-08-15 14:15:21 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-08-15 19:25:08 -0400 |
commit | 82cd87643be7f133ad9a85865f67a0dcadcb76c7 (patch) | |
tree | 67e037c9c7ac4c8e20a229f96fe532ce4faaab72 /sound/soc/soc-dapm.c | |
parent | d09f3ecf1a7ba658934fa3c45f67ed2620a50950 (diff) |
ASoC: DAPM: Allow multiple mixer sources to be routed via the same switch
Currently it is only possible to route one source per switch into a mixer.
This patch modifies the code, so that it is possible to route multiple sources
into a mixer via the same switch. One use-case for this is routing a stereo
channel pair into a mono-mixer via the same switch.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
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 | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index c26531132c66..170c4ffa609f 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -443,6 +443,11 @@ static int dapm_new_mixer(struct snd_soc_dapm_widget *w) | |||
443 | if (path->name != (char *)w->kcontrol_news[i].name) | 443 | if (path->name != (char *)w->kcontrol_news[i].name) |
444 | continue; | 444 | continue; |
445 | 445 | ||
446 | if (w->kcontrols[i]) { | ||
447 | path->kcontrol = w->kcontrols[i]; | ||
448 | continue; | ||
449 | } | ||
450 | |||
446 | wlistsize = sizeof(struct snd_soc_dapm_widget_list) + | 451 | wlistsize = sizeof(struct snd_soc_dapm_widget_list) + |
447 | sizeof(struct snd_soc_dapm_widget *), | 452 | sizeof(struct snd_soc_dapm_widget *), |
448 | wlist = kzalloc(wlistsize, GFP_KERNEL); | 453 | wlist = kzalloc(wlistsize, GFP_KERNEL); |
@@ -1556,7 +1561,6 @@ static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, | |||
1556 | /* found, now check type */ | 1561 | /* found, now check type */ |
1557 | found = 1; | 1562 | found = 1; |
1558 | path->connect = connect; | 1563 | path->connect = connect; |
1559 | break; | ||
1560 | } | 1564 | } |
1561 | 1565 | ||
1562 | if (found) | 1566 | if (found) |