From 5a57afca0b976f28743dd858abf65313f0b0af3f Mon Sep 17 00:00:00 2001 From: Wen Yi Date: Wed, 3 Aug 2011 17:10:08 -0700 Subject: sound: max98088: disable irq line when suspended The jack detection irq line was kept alive after suspend command has been issued to the max98088 and caused device to fail to enter suspend mode. BUG 859822 Change-Id: I9407508788aa5aafa82774d4930653caa9a5b5b1 Reviewed-on: http://git-master/r/44884 Reviewed-by: Varun Colbert Tested-by: Varun Colbert --- sound/soc/codecs/max98088.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index 9d3f8b9c0c37..4497ebb79869 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c @@ -2030,7 +2030,9 @@ static int max98088_suspend(struct platform_device *pdev, pm_message_t state) { struct snd_soc_device *socdev = platform_get_drvdata(pdev); struct snd_soc_codec *codec = socdev->card->codec; - + struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); + if (max98088) + disable_irq(max98088->irq); max98088_set_bias_level(codec, SND_SOC_BIAS_OFF); return 0; @@ -2040,10 +2042,12 @@ static int max98088_resume(struct platform_device *pdev) { struct snd_soc_device *socdev = platform_get_drvdata(pdev); struct snd_soc_codec *codec = socdev->card->codec; + struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); int i; u8 *cache = codec->reg_cache; - max98088_set_bias_level(codec, SND_SOC_BIAS_STANDBY); + if (max98088) + max98088_set_bias_level(codec, SND_SOC_BIAS_STANDBY); /* Sync reg_cache with the hardware */ for (i = 0; i < M98088_REG_CNT; i++) { @@ -2058,6 +2062,7 @@ static int max98088_resume(struct platform_device *pdev) max98088_set_bias_level(codec, SND_SOC_BIAS_STANDBY); + enable_irq(max98088->irq); return 0; } #else @@ -2226,7 +2231,6 @@ static irqreturn_t max98088_jack_handler(int irq, void *data) snd_soc_jack_report(max98088->headset_jack, SND_JACK_HEADSET, SND_JACK_HEADSET); } - return IRQ_HANDLED; } -- cgit v1.2.3