summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorWen Yi <wyi@nvidia.com>2011-08-03 17:10:08 -0700
committerVarun Colbert <vcolbert@nvidia.com>2011-08-05 13:14:12 -0700
commit5a57afca0b976f28743dd858abf65313f0b0af3f (patch)
tree694959a96f4cc664b66ca1dd4ede0fc56a33a52b /sound
parent2911ffb97e1074603969d7491f812a5db6b6f3a7 (diff)
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 <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/max98088.c10
1 files 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;
}