Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257489
b: refs/heads/master
c: 51b3b5c
h: refs/heads/master
i:
  257487: 3c5e15f
v: v3
  • Loading branch information
Mark Brown committed Jun 6, 2011
1 parent 6cf983d commit e5c2bc6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ea7b4378364093678ff1724fa91c43913f97774b
refs/heads/master: 51b3b5cabb1d7d6ca12416652e2df2e01eb61fb9
16 changes: 14 additions & 2 deletions trunk/sound/soc/codecs/wm8915.c
Original file line number Diff line number Diff line change
Expand Up @@ -2009,6 +2009,7 @@ static int wm8915_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
unsigned int Fref, unsigned int Fout)
{
struct wm8915_priv *wm8915 = snd_soc_codec_get_drvdata(codec);
struct i2c_client *i2c = to_i2c_client(codec->dev);
struct _fll_div fll_div;
unsigned long timeout;
int ret, reg;
Expand Down Expand Up @@ -2095,15 +2096,26 @@ static int wm8915_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
else
timeout = msecs_to_jiffies(2);

wait_for_completion_timeout(&wm8915->fll_lock, timeout);
/* Allow substantially longer if we've actually got the IRQ */
if (i2c->irq)
timeout *= 1000;

ret = wait_for_completion_timeout(&wm8915->fll_lock, timeout);

if (ret == 0 && i2c->irq) {
dev_err(codec->dev, "Timed out waiting for FLL\n");
ret = -ETIMEDOUT;
} else {
ret = 0;
}

dev_dbg(codec->dev, "FLL configured for %dHz->%dHz\n", Fref, Fout);

wm8915->fll_fref = Fref;
wm8915->fll_fout = Fout;
wm8915->fll_src = source;

return 0;
return ret;
}

#ifdef CONFIG_GPIOLIB
Expand Down

0 comments on commit e5c2bc6

Please sign in to comment.