aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-06-03 12:49:46 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-06-06 07:47:57 -0400
commit51b3b5cabb1d7d6ca12416652e2df2e01eb61fb9 (patch)
tree47843b5d9eefec9dff8926757888093451639a6e /sound
parentea7b4378364093678ff1724fa91c43913f97774b (diff)
ASoC: Error out when FLL lock interrupt is not delivered on WM8915
When the FLL locks on the WM8915 an interrupt is generated. For safety error out if we don't get that interrupt when the IRQ output of the WM8915 is hooked up. Since we *really* expect an interrupt but the threaded IRQ handler may take a bit longer than expected to get scheduled also dramatically increase the delay in this case. 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/wm8915.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sound/soc/codecs/wm8915.c b/sound/soc/codecs/wm8915.c
index eecd2c116122..a1d8618f7e2e 100644
--- a/sound/soc/codecs/wm8915.c
+++ b/sound/soc/codecs/wm8915.c
@@ -2009,6 +2009,7 @@ static int wm8915_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
2009 unsigned int Fref, unsigned int Fout) 2009 unsigned int Fref, unsigned int Fout)
2010{ 2010{
2011 struct wm8915_priv *wm8915 = snd_soc_codec_get_drvdata(codec); 2011 struct wm8915_priv *wm8915 = snd_soc_codec_get_drvdata(codec);
2012 struct i2c_client *i2c = to_i2c_client(codec->dev);
2012 struct _fll_div fll_div; 2013 struct _fll_div fll_div;
2013 unsigned long timeout; 2014 unsigned long timeout;
2014 int ret, reg; 2015 int ret, reg;
@@ -2095,7 +2096,18 @@ static int wm8915_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
2095 else 2096 else
2096 timeout = msecs_to_jiffies(2); 2097 timeout = msecs_to_jiffies(2);
2097 2098
2098 wait_for_completion_timeout(&wm8915->fll_lock, timeout); 2099 /* Allow substantially longer if we've actually got the IRQ */
2100 if (i2c->irq)
2101 timeout *= 1000;
2102
2103 ret = wait_for_completion_timeout(&wm8915->fll_lock, timeout);
2104
2105 if (ret == 0 && i2c->irq) {
2106 dev_err(codec->dev, "Timed out waiting for FLL\n");
2107 ret = -ETIMEDOUT;
2108 } else {
2109 ret = 0;
2110 }
2099 2111
2100 dev_dbg(codec->dev, "FLL configured for %dHz->%dHz\n", Fref, Fout); 2112 dev_dbg(codec->dev, "FLL configured for %dHz->%dHz\n", Fref, Fout);
2101 2113
@@ -2103,7 +2115,7 @@ static int wm8915_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
2103 wm8915->fll_fout = Fout; 2115 wm8915->fll_fout = Fout;
2104 wm8915->fll_src = source; 2116 wm8915->fll_src = source;
2105 2117
2106 return 0; 2118 return ret;
2107} 2119}
2108 2120
2109#ifdef CONFIG_GPIOLIB 2121#ifdef CONFIG_GPIOLIB