summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorLiam Girdwood <lrg@ti.com>2012-04-25 13:12:51 +0200
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-26 18:48:19 +0200
commit618dae11f809aaccd05710aa8cee8c46a9cef1a7 (patch)
tree99c882f9657b492bc2b721e36e82831efb1b66ca /sound/soc/soc-dapm.c
parentASoC: dpcm: Add debugFS support for DPCM (diff)
downloadlinux-618dae11f809aaccd05710aa8cee8c46a9cef1a7.tar.xz
linux-618dae11f809aaccd05710aa8cee8c46a9cef1a7.zip
ASoC: dpcm: Add runtime dynamic route update
This patch allows DPCM to dynamically alter the FE to BE PCM links at runtime based on mixer setting updates. DAPM is looked up after every mixer update and we perform a DPCM runtime update if the mixer has a change of value. This patchs adds/changes the following :- o Adds DPCM runtime update core. o Changes soc_dapm_mixer_update_power() and soc_dapm_mux_update_power() to return if a change has occured rather than 0. No other users check atm. Signed-off-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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 214323f53956..02db2c09076b 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1846,7 +1846,7 @@ static int soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
dapm_power_widgets(widget->dapm, SND_SOC_DAPM_STREAM_NOP);
}
- return 0;
+ return found;
}
int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
@@ -1858,6 +1858,8 @@ int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget,
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
ret = soc_dapm_mux_update_power(widget, kcontrol, mux, e);
mutex_unlock(&card->dapm_mutex);
+ if (ret > 0)
+ soc_dpcm_runtime_update(widget);
return ret;
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_mux_update_power);
@@ -1890,7 +1892,7 @@ static int soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
dapm_power_widgets(widget->dapm, SND_SOC_DAPM_STREAM_NOP);
}
- return 0;
+ return found;
}
int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
@@ -1902,6 +1904,8 @@ int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget,
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
ret = soc_dapm_mixer_update_power(widget, kcontrol, connect);
mutex_unlock(&card->dapm_mutex);
+ if (ret > 0)
+ soc_dpcm_runtime_update(widget);
return ret;
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_mixer_update_power);