summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorSumit Bhattacharya <sumitb@nvidia.com>2011-12-07 17:15:53 +0530
committerVarun Wadekar <vwadekar@nvidia.com>2011-12-15 11:47:25 +0530
commitc37dac584d6f0af1dc2b3c941b103bd81d11bd91 (patch)
treea08a338eb0a0a62df30d33225da0787c57e90e91 /sound
parent2ba736d71d0903d86290fe00505aacc18065d3cf (diff)
ASoC: WM8903: Disable irq before suspend
When codec enters suspend mic bias gets turned off. As a result if a mic is already plugged in a mic removal event gets triggered. Once codec driver gets mic removal interrupt it sleeps for the duration of debounce time which causes kernel power manager to abort suspend. To avoid this scenario disable mic detect IRQ before powering off codec and enable the same during resume. Change-Id: Ic3c90d73c9f2742b6771f7e3fe0e3fb1f59e1cd9 Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-on: http://git-master/r/68662 Reviewed-by: Nikesh Oswal <noswal@nvidia.com> Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com> Reviewed-by: Scott Peterson <speterson@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wm8903.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index 4ad8ebd290e3..4f418fc2c324 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -1761,6 +1761,11 @@ static struct snd_soc_dai_driver wm8903_dai = {
static int wm8903_suspend(struct snd_soc_codec *codec, pm_message_t state)
{
+ struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
+
+ if (wm8903->irq)
+ disable_irq(wm8903->irq);
+
wm8903_set_bias_level(codec, SND_SOC_BIAS_OFF);
return 0;
@@ -1768,11 +1773,15 @@ static int wm8903_suspend(struct snd_soc_codec *codec, pm_message_t state)
static int wm8903_resume(struct snd_soc_codec *codec)
{
+ struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
int i;
u16 *reg_cache = codec->reg_cache;
u16 *tmp_cache = kmemdup(reg_cache, sizeof(wm8903_reg_defaults),
GFP_KERNEL);
+ if (wm8903->irq)
+ enable_irq(wm8903->irq);
+
/* Bring the codec back up to standby first to minimise pop/clicks */
wm8903_set_bias_level(codec, SND_SOC_BIAS_STANDBY);