Skip to contentSkip to conversation

ASoC: Clear any outstanding WM8962 FLL lock completions before waiting

PATCH In review Mark Brown 2 participants 2 messages Aug 21, 2011 – Aug 22, 2011

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: Clear any outstanding WM8962 FLL lock completions before waiting

Ensure that we don't spuriously trigger early.

---
 sound/soc/codecs/wm8962.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
sound/soc/codecs/wm8962.c +4 -0
index c9e07aa..d2db512 100644
@@ -2356,6 +2356,8 @@ static int sysclk_event(struct snd_soc_dapm_widget *w,
 	switch (event) {
 	case SND_SOC_DAPM_PRE_PMU:
 		if (fll) {
+			try_wait_for_completion(&wm8962->fll_lock);
+
 			snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1,
 					    WM8962_FLL_ENA, WM8962_FLL_ENA);
 			if (wm8962->irq) {
@@ -3456,6 +3458,8 @@ static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
 	snd_soc_write(codec, WM8962_FLL_CONTROL_7, fll_div.lambda);
 	snd_soc_write(codec, WM8962_FLL_CONTROL_8, fll_div.n);
 
+	try_wait_for_completion(&wm8962->fll_lock);
+
 	snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1,
 			    WM8962_FLL_FRAC | WM8962_FLL_REFCLK_SRC_MASK |
 			    WM8962_FLL_ENA, fll1);
Signature · 1 line
1.7.5.4
Acked-by on v1 1/1
#1 lore raw
Quoted 21 lines · Mark Brown

Ensure that we don't spuriously trigger early.

---
 sound/soc/codecs/wm8962.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
sound/soc/codecs/wm8962.c +2 -0
index c9e07aa..d2db512 100644
@@ -2356,6 +2356,8 @@ static int sysclk_event(struct snd_soc_dapm_widget *w,
 	switch (event) {
 	case SND_SOC_DAPM_PRE_PMU:
 		if (fll) {
+			try_wait_for_completion(&wm8962->fll_lock);
+
 			snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1,
 					    WM8962_FLL_ENA, WM8962_FLL_ENA);
 			if (wm8962->irq) {

sound/soc/codecs/wm8962.c static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source, · line 3465

Quoted 8 lines
sound/soc/codecs/wm8962.c +2 -0
@@ -3456,6 +3458,8 @@ static int wm8962_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
 	snd_soc_write(codec, WM8962_FLL_CONTROL_7, fll_div.lambda);
 	snd_soc_write(codec, WM8962_FLL_CONTROL_8, fll_div.n);
 
+	try_wait_for_completion(&wm8962->fll_lock);
+
 	snd_soc_update_bits(codec, WM8962_FLL_CONTROL_1,
 			    WM8962_FLL_FRAC | WM8962_FLL_REFCLK_SRC_MASK |
 			    WM8962_FLL_ENA, fll1);