Skip to content

Commit

Permalink
ASoC: Fix WM8996 DC servo operation without IRQ
Browse files Browse the repository at this point in the history
We need to count the timeout down.

Reported-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
  • Loading branch information
Mark Brown committed Sep 15, 2011
1 parent 7803e32 commit f998f25
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions sound/soc/codecs/wm8996.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec, u16 mask)
{
struct i2c_client *i2c = to_i2c_client(codec->dev);
struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec);
int i, ret;
int ret;
unsigned long timeout = 200;

snd_soc_write(codec, WM8996_DC_SERVO_2, mask);
Expand All @@ -734,15 +734,12 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec, u16 mask)

} else {
msleep(1);
if (--i) {
timeout = 0;
break;
}
timeout--;
}

ret = snd_soc_read(codec, WM8996_DC_SERVO_2);
dev_dbg(codec->dev, "DC servo state: %x\n", ret);
} while (ret & mask);
} while (timeout && ret & mask);

if (timeout == 0)
dev_err(codec->dev, "DC servo timed out for %x\n", mask);
Expand Down

0 comments on commit f998f25

Please sign in to comment.