summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/max98088.c
diff options
context:
space:
mode:
authorNikesh Oswal <noswal@nvidia.com>2011-09-30 17:53:00 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:49:19 -0800
commit131de4c086cc68e311504c2d9ce705658828b067 (patch)
tree4b0bed7f5cb8daa5ae9ba686fd6cbb11655c604a /sound/soc/codecs/max98088.c
parent2f1a05ec331e3c9854d7d8c6979f212874b3f95a (diff)
asoc: max98088: disable the irq when entering suspend
Bug: 862023 Change-Id: Ibaa3ffbb9e81736e45c2bccb0d6e1828cde4025b Signed-off-by: Nikesh Oswal <noswal@nvidia.com> Reviewed-on: http://git-master/r/55474 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: Rf4af409992ad20aa854736727df5060ce82435ed
Diffstat (limited to 'sound/soc/codecs/max98088.c')
-rw-r--r--sound/soc/codecs/max98088.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c
index e7e5bfe10fa0..7b2cdf4f36ed 100644
--- a/sound/soc/codecs/max98088.c
+++ b/sound/soc/codecs/max98088.c
@@ -1959,25 +1959,6 @@ static void max98088_handle_pdata(struct snd_soc_codec *codec)
}
}
-#ifdef CONFIG_PM
-static int max98088_suspend(struct snd_soc_codec *codec, pm_message_t state)
-{
- max98088_set_bias_level(codec, SND_SOC_BIAS_OFF);
-
- return 0;
-}
-
-static int max98088_resume(struct snd_soc_codec *codec)
-{
- max98088_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
- return 0;
-}
-#else
-#define max98088_suspend NULL
-#define max98088_resume NULL
-#endif
-
int max98088_report_jack(struct snd_soc_codec *codec)
{
struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
@@ -2135,6 +2116,32 @@ static int max98088_remove(struct snd_soc_codec *codec)
return 0;
}
+#ifdef CONFIG_PM
+static int max98088_suspend(struct snd_soc_codec *codec, pm_message_t state)
+{
+ struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
+
+ disable_irq(max98088->irq);
+ max98088_set_bias_level(codec, SND_SOC_BIAS_OFF);
+
+ return 0;
+}
+
+static int max98088_resume(struct snd_soc_codec *codec)
+{
+ struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
+
+ max98088_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+ max98088_report_jack(codec);
+ enable_irq(max98088->irq);
+
+ return 0;
+}
+#else
+#define max98088_suspend NULL
+#define max98088_resume NULL
+#endif
+
static struct snd_soc_codec_driver soc_codec_dev_max98088 = {
.probe = max98088_probe,
.remove = max98088_remove,