aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-10-07 09:29:19 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-10-08 06:47:32 -0400
commit4f4c0072228785179d35b2bd9e48081ce9fa51f6 (patch)
treee54a5b71fa886f1f4bf5bd768a50e951f481e753 /sound/soc/soc-dapm.c
parenta1ff89ef3cd6515d378f946db5f3760089bb644e (diff)
ASoC: Suppress early calls to snd_soc_dapm_sync()
Ensure we only have one sync during the initial startup of the card by making snd_soc_dapm_sync() a noop on non-instantiated cards. This avoids any bounces due to things like jacks reporting their initial state on partially initialised cards. The callers that don't also get called at runtime should just be removed. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 8711aab01445..e49c56d4951e 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1845,6 +1845,13 @@ static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm,
1845 */ 1845 */
1846int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm) 1846int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm)
1847{ 1847{
1848 /*
1849 * Suppress early reports (eg, jacks syncing their state) to avoid
1850 * silly DAPM runs during card startup.
1851 */
1852 if (!dapm->card || !dapm->card->instantiated)
1853 return 0;
1854
1848 return dapm_power_widgets(dapm, SND_SOC_DAPM_STREAM_NOP); 1855 return dapm_power_widgets(dapm, SND_SOC_DAPM_STREAM_NOP);
1849} 1856}
1850EXPORT_SYMBOL_GPL(snd_soc_dapm_sync); 1857EXPORT_SYMBOL_GPL(snd_soc_dapm_sync);