summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShridhar Rasal <srasal@nvidia.com>2011-07-11 17:35:28 +0530
committerNiket Sirsi <nsirsi@nvidia.com>2011-07-26 15:40:16 -0700
commit453bc4499adaeaa78dcd3f2870c9315e2abc4d15 (patch)
tree966a5f8cc54cd0428207fa301921ac8e42aea8c3
parent2e94a455f79519e924609f7197ed93eafce47552 (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 854830 Reviewed-on: http://git-master/r/40363 (cherry picked from commit f86fe8484b2fc1b9ed8dfc2b27e6c1dfa84a7288) Change-Id: I4dcc1e71cb6ce898281cc0882d3a15d645b74001 Reviewed-on: http://git-master/r/42591 Tested-by: Shridhar Rasal <srasal@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--sound/soc/tegra/tegra_i2s.c1
-rw-r--r--sound/soc/tegra/tegra_soc.h1
-rw-r--r--sound/soc/tegra/tegra_soc_wm8753.c2
-rw-r--r--sound/soc/tegra/tegra_soc_wm8903.c2
-rw-r--r--sound/soc/tegra/tegra_wired_jack.c11
5 files changed, 15 insertions, 2 deletions
diff --git a/sound/soc/tegra/tegra_i2s.c b/sound/soc/tegra/tegra_i2s.c
index ee197165dc9d..070d5dc2b487 100644
--- a/sound/soc/tegra/tegra_i2s.c
+++ b/sound/soc/tegra/tegra_i2s.c
@@ -325,7 +325,6 @@ int tegra_i2s_resume(struct snd_soc_dai *cpu_dai)
tegra_das_set_all_regs(&info->das_regs);
i2s_set_all_regs(cpu_dai->id, &info->i2s_regs);
- tegra_jack_resume();
clk_disable(info->i2s_clk);
diff --git a/sound/soc/tegra/tegra_soc.h b/sound/soc/tegra/tegra_soc.h
index a1dd3076f4ed..68e74183a409 100644
--- a/sound/soc/tegra/tegra_soc.h
+++ b/sound/soc/tegra/tegra_soc.h
@@ -138,6 +138,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 4e9c3881b4e0..c661a62c2169 100644
--- a/sound/soc/tegra/tegra_soc_wm8753.c
+++ b/sound/soc/tegra/tegra_soc_wm8753.c
@@ -410,6 +410,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;
}
@@ -435,6 +436,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 d97f825c51b1..ee5b0af8d3ac 100644
--- a/sound/soc/tegra/tegra_soc_wm8903.c
+++ b/sound/soc/tegra/tegra_soc_wm8903.c
@@ -304,6 +304,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;
}
@@ -329,6 +330,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 9a434fe57715..8c1ff4f354cd 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 = {
@@ -232,6 +240,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)