aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8996.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm8996.c')
-rw-r--r--sound/soc/codecs/wm8996.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c
index dc92d5e4e942..308748a022c5 100644
--- a/sound/soc/codecs/wm8996.c
+++ b/sound/soc/codecs/wm8996.c
@@ -2009,7 +2009,7 @@ static int wm8996_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
2009 struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec); 2009 struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec);
2010 struct i2c_client *i2c = to_i2c_client(codec->dev); 2010 struct i2c_client *i2c = to_i2c_client(codec->dev);
2011 struct _fll_div fll_div; 2011 struct _fll_div fll_div;
2012 unsigned long timeout; 2012 unsigned long timeout, time_left;
2013 int ret, reg, retry; 2013 int ret, reg, retry;
2014 2014
2015 /* Any change? */ 2015 /* Any change? */
@@ -2110,13 +2110,15 @@ static int wm8996_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
2110 if (i2c->irq) 2110 if (i2c->irq)
2111 timeout *= 10; 2111 timeout *= 10;
2112 else 2112 else
2113 timeout /= 2; 2113 /* ensure timeout of atleast 1 jiffies */
2114 timeout = timeout/2 ? : 1;
2114 2115
2115 for (retry = 0; retry < 10; retry++) { 2116 for (retry = 0; retry < 10; retry++) {
2116 ret = wait_for_completion_timeout(&wm8996->fll_lock, 2117 time_left = wait_for_completion_timeout(&wm8996->fll_lock,
2117 timeout); 2118 timeout);
2118 if (ret != 0) { 2119 if (time_left != 0) {
2119 WARN_ON(!i2c->irq); 2120 WARN_ON(!i2c->irq);
2121 ret = 1;
2120 break; 2122 break;
2121 } 2123 }
2122 2124