diff options
author | Shridhar Rasal <srasal@nvidia.com> | 2011-07-11 17:35:28 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-07-26 17:01:13 -0700 |
commit | f1b215c9776fcf0de739ffdf8a46a3fbff71844d (patch) | |
tree | d183654d89bc3fc692f23f7a4a98cda48e46e987 | |
parent | 3914252de0d18508363d7d9a00199fbc050f6237 (diff) |
ASOC: tegra: Disable wired jack IRQ
Added suspend for tegra_wired_jack.
Disable tegra_wired_jack GPIO interrupts while going into suspend
and enable in resume.
Bug 827709
Change-Id: I1f5fd0e0adb437de883a5f897acd22c514e172cb
Reviewed-on: http://git-master/r/40363
Reviewed-on: http://git-master/r/42534
Tested-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r-- | sound/soc/tegra/tegra_i2s.c | 2 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_soc.h | 1 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_soc_wm8753.c | 2 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_soc_wm8903.c | 2 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_wired_jack.c | 11 |
5 files changed, 15 insertions, 3 deletions
diff --git a/sound/soc/tegra/tegra_i2s.c b/sound/soc/tegra/tegra_i2s.c index 5828eb9e305c..b62f7b6a692e 100644 --- a/sound/soc/tegra/tegra_i2s.c +++ b/sound/soc/tegra/tegra_i2s.c @@ -335,8 +335,6 @@ int tegra_i2s_resume(struct snd_soc_dai *cpu_dai) tegra_das_set_all_regs(&info->das_regs); am_resume(&info->i2sdev_info); - tegra_jack_resume(); - /* disabled clock as it is being enabled back on startup */ am_clock_disable(&info->i2sdev_info); diff --git a/sound/soc/tegra/tegra_soc.h b/sound/soc/tegra/tegra_soc.h index 7e262bd2c34d..d48ea1e69d01 100644 --- a/sound/soc/tegra/tegra_soc.h +++ b/sound/soc/tegra/tegra_soc.h @@ -139,6 +139,7 @@ int tegra_controls_init(struct snd_soc_codec *codec); int tegra_jack_init(struct snd_soc_codec *codec); void tegra_jack_exit(void); +void tegra_jack_suspend(void); void tegra_jack_resume(void); void tegra_switch_set_state(int state); diff --git a/sound/soc/tegra/tegra_soc_wm8753.c b/sound/soc/tegra/tegra_soc_wm8753.c index 0fc9b16cf810..d8afe93246cd 100644 --- a/sound/soc/tegra/tegra_soc_wm8753.c +++ b/sound/soc/tegra/tegra_soc_wm8753.c @@ -396,6 +396,7 @@ void tegra_codec_shutdown(struct snd_pcm_substream *substream) int tegra_soc_suspend_pre(struct platform_device *pdev, pm_message_t state) { + tegra_jack_suspend(); return 0; } @@ -415,6 +416,7 @@ int tegra_soc_resume_pre(struct platform_device *pdev) int tegra_soc_resume_post(struct platform_device *pdev) { + tegra_jack_resume(); return 0; } diff --git a/sound/soc/tegra/tegra_soc_wm8903.c b/sound/soc/tegra/tegra_soc_wm8903.c index 00efb97a9710..203b1ecadb05 100644 --- a/sound/soc/tegra/tegra_soc_wm8903.c +++ b/sound/soc/tegra/tegra_soc_wm8903.c @@ -281,6 +281,7 @@ void tegra_codec_shutdown(struct snd_pcm_substream *substream) int tegra_soc_suspend_pre(struct platform_device *pdev, pm_message_t state) { + tegra_jack_suspend(); return 0; } @@ -300,6 +301,7 @@ int tegra_soc_resume_pre(struct platform_device *pdev) int tegra_soc_resume_post(struct platform_device *pdev) { + tegra_jack_resume(); return 0; } diff --git a/sound/soc/tegra/tegra_wired_jack.c b/sound/soc/tegra/tegra_wired_jack.c index e51cb35c3158..889d1920659c 100644 --- a/sound/soc/tegra/tegra_wired_jack.c +++ b/sound/soc/tegra/tegra_wired_jack.c @@ -128,10 +128,18 @@ static int wired_switch_notify(struct notifier_block *self, return NOTIFY_OK; } +void tegra_jack_suspend(void) +{ + snd_soc_jack_free_gpios(tegra_wired_jack, + ARRAY_SIZE(wired_jack_gpios), + wired_jack_gpios); +} void tegra_jack_resume(void) { - tegra_switch_set_state(get_headset_state()); + snd_soc_jack_add_gpios(tegra_wired_jack, + ARRAY_SIZE(wired_jack_gpios), + wired_jack_gpios); } static struct notifier_block wired_switch_nb = { @@ -252,6 +260,7 @@ static int tegra_wired_jack_remove(struct platform_device *pdev) gpio_free(tegra_wired_jack_conf.en_mic_int); gpio_free(tegra_wired_jack_conf.en_mic_ext); gpio_free(tegra_wired_jack_conf.en_spkr); + gpio_free(tegra_wired_jack_conf.cdc_irq); if (tegra_wired_jack_conf.amp_reg) { if (tegra_wired_jack_conf.amp_reg_enabled) |