Skip to content

Commit

Permalink
ASoC: wm_adsp: Add small delay while polling DSP RAM start
Browse files Browse the repository at this point in the history
Some devices are getting very close to the limit whilst polling the RAM
start, this patch adds a small delay to this loop to give a longer
startup timeout.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
  • Loading branch information
Charles Keepax authored and Mark Brown committed Dec 18, 2013
1 parent 6ce4eac commit 939fd1e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sound/soc/codecs/wm_adsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1474,13 +1474,17 @@ static int wm_adsp2_ena(struct wm_adsp *dsp)
return ret;

/* Wait for the RAM to start, should be near instantaneous */
count = 0;
do {
for (count = 0; count < 10; ++count) {
ret = regmap_read(dsp->regmap, dsp->base + ADSP2_STATUS1,
&val);
if (ret != 0)
return ret;
} while (!(val & ADSP2_RAM_RDY) && ++count < 10);

if (val & ADSP2_RAM_RDY)
break;

msleep(1);
}

if (!(val & ADSP2_RAM_RDY)) {
adsp_err(dsp, "Failed to start DSP RAM\n");
Expand Down

0 comments on commit 939fd1e

Please sign in to comment.