summaryrefslogtreecommitdiff
path: root/sound/soc/tegra/tegra_wired_jack.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/tegra/tegra_wired_jack.c')
-rw-r--r--sound/soc/tegra/tegra_wired_jack.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/sound/soc/tegra/tegra_wired_jack.c b/sound/soc/tegra/tegra_wired_jack.c
index 8c1ff4f354cd..081ec965b1e9 100644
--- a/sound/soc/tegra/tegra_wired_jack.c
+++ b/sound/soc/tegra/tegra_wired_jack.c
@@ -130,16 +130,26 @@ static int wired_switch_notify(struct notifier_block *self,
void tegra_jack_suspend(void)
{
- snd_soc_jack_free_gpios(tegra_wired_jack,
- ARRAY_SIZE(wired_jack_gpios),
- wired_jack_gpios);
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(wired_jack_gpios); i++)
+ disable_irq(gpio_to_irq(wired_jack_gpios[i].gpio));
}
void tegra_jack_resume(void)
{
- snd_soc_jack_add_gpios(tegra_wired_jack,
- ARRAY_SIZE(wired_jack_gpios),
- wired_jack_gpios);
+ int i, val;
+
+ for (i = 0; i < ARRAY_SIZE(wired_jack_gpios); i++) {
+ val = gpio_get_value(wired_jack_gpios[i].gpio);
+ val = wired_jack_gpios[i].invert ? !val : val;
+ val = val ? wired_jack_gpios[i].report : 0;
+
+ snd_soc_jack_report(tegra_wired_jack, val,
+ wired_jack_gpios[i].report);
+
+ enable_irq(gpio_to_irq(wired_jack_gpios[i].gpio));
+ }
}
static struct notifier_block wired_switch_nb = {