ASoC: Handle failed WM8994 FLL lock waits
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 15 Jul 2011 18:12:18 +0000 (03:12 +0900)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 17 Jul 2011 04:15:00 +0000 (13:15 +0900)
Try the completion before we start the FLL so that if an interrupt was
delayed long enough for us to miss it we don't wait for the completion
it signalled.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/codecs/wm8994.c

index ee64be2d9942b61aea4c8872132d1582aba052b8..c749ef339665e886d66c9b0c70467b1b1b107134 100644 (file)
@@ -1713,6 +1713,9 @@ static int _wm8994_set_fll(struct snd_soc_codec *codec, int id, int src,
                            (fll.clk_ref_div << WM8994_FLL1_REFCLK_DIV_SHIFT) |
                            (src - 1));
 
+       /* Clear any pending completion from a previous failure */
+       try_wait_for_completion(&wm8994->fll_locked[id]);
+
        /* Enable (with fractional mode if required) */
        if (freq_out) {
                if (fll.k)