* [PATCH 1/4] ASoC: Suppress noop SYSCLK updates in WM8915
@ 2011-06-03 17:47 Mark Brown
2011-06-03 17:47 ` [PATCH 2/4] ASoC: Only update SYSCLK_ENA when pausing WM8915 SYSCLK Mark Brown
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Mark Brown @ 2011-06-03 17:47 UTC (permalink / raw)
To: Liam Girdwood; +Cc: alsa-devel, patches, Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
sound/soc/codecs/wm8915.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/sound/soc/codecs/wm8915.c b/sound/soc/codecs/wm8915.c
index 5a59ef7..c61bc32 100644
--- a/sound/soc/codecs/wm8915.c
+++ b/sound/soc/codecs/wm8915.c
@@ -55,6 +55,7 @@ struct wm8915_priv {
int ldo1ena;
int sysclk;
+ int sysclk_src;
int fll_src;
int fll_fref;
@@ -1834,6 +1835,9 @@ static int wm8915_set_sysclk(struct snd_soc_dai *dai,
int src;
int old;
+ if (freq == wm8915->sysclk && clk_id == wm8915->sysclk_src)
+ return 0;
+
/* Disable SYSCLK while we reconfigure */
old = snd_soc_read(codec, WM8915_AIF_CLOCKING_1);
snd_soc_update_bits(codec, WM8915_AIF_CLOCKING_1,
@@ -1885,6 +1889,8 @@ static int wm8915_set_sysclk(struct snd_soc_dai *dai,
snd_soc_update_bits(codec, WM8915_AIF_CLOCKING_1,
WM8915_SYSCLK_ENA, old);
+ wm8915->sysclk_src = clk_id;
+
return 0;
}
--
1.7.5.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/4] ASoC: Only update SYSCLK_ENA when pausing WM8915 SYSCLK
2011-06-03 17:47 [PATCH 1/4] ASoC: Suppress noop SYSCLK updates in WM8915 Mark Brown
@ 2011-06-03 17:47 ` Mark Brown
2011-06-03 17:47 ` [PATCH 3/4] ASoC: Error out when FLL lock interrupt is not delivered on WM8915 Mark Brown
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2011-06-03 17:47 UTC (permalink / raw)
To: Liam Girdwood; +Cc: alsa-devel, patches, Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
sound/soc/codecs/wm8915.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/soc/codecs/wm8915.c b/sound/soc/codecs/wm8915.c
index c61bc32..6324d4e 100644
--- a/sound/soc/codecs/wm8915.c
+++ b/sound/soc/codecs/wm8915.c
@@ -1839,7 +1839,7 @@ static int wm8915_set_sysclk(struct snd_soc_dai *dai,
return 0;
/* Disable SYSCLK while we reconfigure */
- old = snd_soc_read(codec, WM8915_AIF_CLOCKING_1);
+ old = snd_soc_read(codec, WM8915_AIF_CLOCKING_1) & WM8915_SYSCLK_ENA;
snd_soc_update_bits(codec, WM8915_AIF_CLOCKING_1,
WM8915_SYSCLK_ENA, 0);
--
1.7.5.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/4] ASoC: Error out when FLL lock interrupt is not delivered on WM8915
2011-06-03 17:47 [PATCH 1/4] ASoC: Suppress noop SYSCLK updates in WM8915 Mark Brown
2011-06-03 17:47 ` [PATCH 2/4] ASoC: Only update SYSCLK_ENA when pausing WM8915 SYSCLK Mark Brown
@ 2011-06-03 17:47 ` Mark Brown
2011-06-03 17:47 ` [PATCH 4/4] ASoC: Add missing break in WM8915 FLL source selection Mark Brown
2011-06-06 9:49 ` [PATCH 1/4] ASoC: Suppress noop SYSCLK updates in WM8915 Liam Girdwood
3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2011-06-03 17:47 UTC (permalink / raw)
To: Liam Girdwood; +Cc: alsa-devel, patches, Mark Brown
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>
---
sound/soc/codecs/wm8915.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/wm8915.c b/sound/soc/codecs/wm8915.c
index 6324d4e..62e72fc 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,
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;
@@ -2094,7 +2095,18 @@ 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);
@@ -2102,7 +2114,7 @@ static int wm8915_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
wm8915->fll_fout = Fout;
wm8915->fll_src = source;
- return 0;
+ return ret;
}
#ifdef CONFIG_GPIOLIB
--
1.7.5.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 4/4] ASoC: Add missing break in WM8915 FLL source selection
2011-06-03 17:47 [PATCH 1/4] ASoC: Suppress noop SYSCLK updates in WM8915 Mark Brown
2011-06-03 17:47 ` [PATCH 2/4] ASoC: Only update SYSCLK_ENA when pausing WM8915 SYSCLK Mark Brown
2011-06-03 17:47 ` [PATCH 3/4] ASoC: Error out when FLL lock interrupt is not delivered on WM8915 Mark Brown
@ 2011-06-03 17:47 ` Mark Brown
2011-06-06 9:49 ` [PATCH 1/4] ASoC: Suppress noop SYSCLK updates in WM8915 Liam Girdwood
3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2011-06-03 17:47 UTC (permalink / raw)
To: Liam Girdwood; +Cc: alsa-devel, patches, Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
sound/soc/codecs/wm8915.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/sound/soc/codecs/wm8915.c b/sound/soc/codecs/wm8915.c
index 62e72fc..a1d8618 100644
--- a/sound/soc/codecs/wm8915.c
+++ b/sound/soc/codecs/wm8915.c
@@ -2041,6 +2041,7 @@ static int wm8915_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
break;
case WM8915_FLL_MCLK2:
reg = 1;
+ break;
case WM8915_FLL_DACLRCLK1:
reg = 2;
break;
--
1.7.5.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/4] ASoC: Suppress noop SYSCLK updates in WM8915
2011-06-03 17:47 [PATCH 1/4] ASoC: Suppress noop SYSCLK updates in WM8915 Mark Brown
` (2 preceding siblings ...)
2011-06-03 17:47 ` [PATCH 4/4] ASoC: Add missing break in WM8915 FLL source selection Mark Brown
@ 2011-06-06 9:49 ` Liam Girdwood
3 siblings, 0 replies; 5+ messages in thread
From: Liam Girdwood @ 2011-06-06 9:49 UTC (permalink / raw)
To: Mark Brown
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com
On 03/06/11 18:47, Mark Brown wrote:
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>
All
Acked-by: Liam Girdwood <lrg@ti.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-06-06 9:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-03 17:47 [PATCH 1/4] ASoC: Suppress noop SYSCLK updates in WM8915 Mark Brown
2011-06-03 17:47 ` [PATCH 2/4] ASoC: Only update SYSCLK_ENA when pausing WM8915 SYSCLK Mark Brown
2011-06-03 17:47 ` [PATCH 3/4] ASoC: Error out when FLL lock interrupt is not delivered on WM8915 Mark Brown
2011-06-03 17:47 ` [PATCH 4/4] ASoC: Add missing break in WM8915 FLL source selection Mark Brown
2011-06-06 9:49 ` [PATCH 1/4] ASoC: Suppress noop SYSCLK updates in WM8915 Liam Girdwood
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.