diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-09-15 10:52:11 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-09-16 00:54:08 +0100 |
commit | f998f257c92216df314610dd5aebc5f5d23e6ec0 (patch) | |
tree | cc0060527f938ba810765b2fe79d53d5f215f5b2 /sound | |
parent | 7803e329bb8357afe94e8e5c3f78478d6a98d1b5 (diff) | |
download | op-kernel-dev-f998f257c92216df314610dd5aebc5f5d23e6ec0.zip op-kernel-dev-f998f257c92216df314610dd5aebc5f5d23e6ec0.tar.gz |
ASoC: Fix WM8996 DC servo operation without IRQ
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/wm8996.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c index 7280a10..5174874a 100644 --- a/sound/soc/codecs/wm8996.c +++ b/sound/soc/codecs/wm8996.c @@ -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); @@ -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); |