summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorLaim Girdwood <lg@opensource.wolfsonmicro.com>2008-01-10 14:41:02 +0100
committerJaroslav Kysela <perex@perex.cz>2008-01-31 17:29:51 +0100
commit9af6d9562414568ecadf96aaef5b88e7e8b19821 (patch)
tree710e129e7cc8838cf8ac9c5d79473685e8933dd6 /sound/soc
parent6c59e6c4129cd80834837b58a42216f0432a4f58 (diff)
downloadlinux-3.10-9af6d9562414568ecadf96aaef5b88e7e8b19821.tar.gz
linux-3.10-9af6d9562414568ecadf96aaef5b88e7e8b19821.tar.bz2
linux-3.10-9af6d9562414568ecadf96aaef5b88e7e8b19821.zip
[ALSA] soc - Add support for passing kcontrols with events
Signed-off-by: Laim Girdwood <lg@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/soc-dapm.c40
1 files changed, 27 insertions, 13 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index d033e73103a..8b61db2f639 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -523,11 +523,13 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
continue;
if (event == SND_SOC_DAPM_STREAM_START) {
- ret = w->event(w, SND_SOC_DAPM_PRE_PMU);
+ ret = w->event(w,
+ NULL, SND_SOC_DAPM_PRE_PMU);
if (ret < 0)
return ret;
} else if (event == SND_SOC_DAPM_STREAM_STOP) {
- ret = w->event(w, SND_SOC_DAPM_PRE_PMD);
+ ret = w->event(w,
+ NULL, SND_SOC_DAPM_PRE_PMD);
if (ret < 0)
return ret;
}
@@ -538,11 +540,13 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
continue;
if (event == SND_SOC_DAPM_STREAM_START) {
- ret = w->event(w, SND_SOC_DAPM_POST_PMU);
+ ret = w->event(w,
+ NULL, SND_SOC_DAPM_POST_PMU);
if (ret < 0)
return ret;
} else if (event == SND_SOC_DAPM_STREAM_STOP) {
- ret = w->event(w, SND_SOC_DAPM_POST_PMD);
+ ret = w->event(w,
+ NULL, SND_SOC_DAPM_POST_PMD);
if (ret < 0)
return ret;
}
@@ -566,26 +570,30 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
if (power) {
/* power up event */
if (w->event_flags & SND_SOC_DAPM_PRE_PMU) {
- ret = w->event(w, SND_SOC_DAPM_PRE_PMU);
+ ret = w->event(w,
+ NULL, SND_SOC_DAPM_PRE_PMU);
if (ret < 0)
return ret;
}
dapm_update_bits(w);
if (w->event_flags & SND_SOC_DAPM_POST_PMU){
- ret = w->event(w, SND_SOC_DAPM_POST_PMU);
+ ret = w->event(w,
+ NULL, SND_SOC_DAPM_POST_PMU);
if (ret < 0)
return ret;
}
} else {
/* power down event */
if (w->event_flags & SND_SOC_DAPM_PRE_PMD) {
- ret = w->event(w, SND_SOC_DAPM_PRE_PMD);
+ ret = w->event(w,
+ NULL, SND_SOC_DAPM_PRE_PMD);
if (ret < 0)
return ret;
}
dapm_update_bits(w);
if (w->event_flags & SND_SOC_DAPM_POST_PMD) {
- ret = w->event(w, SND_SOC_DAPM_POST_PMD);
+ ret = w->event(w,
+ NULL, SND_SOC_DAPM_POST_PMD);
if (ret < 0)
return ret;
}
@@ -1095,13 +1103,17 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
dapm_mixer_update_power(widget, kcontrol, reg, val_mask, val, invert);
if (widget->event) {
if (widget->event_flags & SND_SOC_DAPM_PRE_REG) {
- ret = widget->event(widget, SND_SOC_DAPM_PRE_REG);
- if (ret < 0)
+ ret = widget->event(widget, kcontrol,
+ SND_SOC_DAPM_PRE_REG);
+ if (ret < 0) {
+ ret = 1;
goto out;
+ }
}
ret = snd_soc_update_bits(widget->codec, reg, val_mask, val);
if (widget->event_flags & SND_SOC_DAPM_POST_REG)
- ret = widget->event(widget, SND_SOC_DAPM_POST_REG);
+ ret = widget->event(widget, kcontrol,
+ SND_SOC_DAPM_POST_REG);
} else
ret = snd_soc_update_bits(widget->codec, reg, val_mask, val);
@@ -1176,13 +1188,15 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol,
dapm_mux_update_power(widget, kcontrol, mask, mux, e);
if (widget->event) {
if (widget->event_flags & SND_SOC_DAPM_PRE_REG) {
- ret = widget->event(widget, SND_SOC_DAPM_PRE_REG);
+ ret = widget->event(widget,
+ kcontrol, SND_SOC_DAPM_PRE_REG);
if (ret < 0)
goto out;
}
ret = snd_soc_update_bits(widget->codec, e->reg, mask, val);
if (widget->event_flags & SND_SOC_DAPM_POST_REG)
- ret = widget->event(widget, SND_SOC_DAPM_POST_REG);
+ ret = widget->event(widget,
+ kcontrol, SND_SOC_DAPM_POST_REG);
} else
ret = snd_soc_update_bits(widget->codec, e->reg, mask, val);