Skip to content

Commit

Permalink
ASoC: DAPM: Allow multiple mixer sources to be routed via the same sw…
Browse files Browse the repository at this point in the history
…itch

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>
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Aug 15, 2011
1 parent d09f3ec commit 82cd876
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,11 @@ static int dapm_new_mixer(struct snd_soc_dapm_widget *w)
if (path->name != (char *)w->kcontrol_news[i].name)
continue;

if (w->kcontrols[i]) {
path->kcontrol = w->kcontrols[i];
continue;
}

wlistsize = sizeof(struct snd_soc_dapm_widget_list) +
sizeof(struct snd_soc_dapm_widget *),
wlist = kzalloc(wlistsize, GFP_KERNEL);
Expand Down Expand Up @@ -1556,7 +1561,6 @@ static int dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
/* found, now check type */
found = 1;
path->connect = connect;
break;
}

if (found)
Expand Down

0 comments on commit 82cd876

Please sign in to comment.