Skip to content

Commit f998f25

Browse files
committed
ASoC: Fix WM8996 DC servo operation without IRQ
We need to count the timeout down. Reported-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]> Acked-by: Liam Girdwood <[email protected]>
1 parent 7803e32 commit f998f25

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

sound/soc/codecs/wm8996.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec, u16 mask)
719719
{
720720
struct i2c_client *i2c = to_i2c_client(codec->dev);
721721
struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec);
722-
int i, ret;
722+
int ret;
723723
unsigned long timeout = 200;
724724

725725
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)
734734

735735
} else {
736736
msleep(1);
737-
if (--i) {
738-
timeout = 0;
739-
break;
740-
}
737+
timeout--;
741738
}
742739

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

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

0 commit comments

Comments
 (0)