summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanjay Singh Rawat <srawat@nvidia.com>2011-09-09 16:36:37 +0530
committerAnnamaria Pyreddy <apyreddy@nvidia.com>2011-09-13 15:01:00 -0700
commit9d265212b17cbede0f05bc8137f6f7bf96640934 (patch)
tree3d6a278e660ddd1f3087ff88d557b99d8994c9f4
parentf21385a807eeb331f5f65ffac7d5713d72254c26 (diff)
ASoC: tegra: Cross check the connection state on receiving interrupt
Filter out any spurious interrupt by checking with the previous state. Bug 865473 Change-Id: Ic7ac0c04dea01110b1e5a28a50af8e0962608da7 Signed-off-by: Sanjay Singh Rawat <srawat@nvidia.com> Reviewed-on: http://git-master/r/49208 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--include/sound/soc.h1
-rw-r--r--sound/soc/soc-jack.c12
2 files changed, 11 insertions, 2 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index d99a75ec0db6..1773b19ee125 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -394,6 +394,7 @@ struct snd_soc_jack {
struct list_head pins;
int status;
struct blocking_notifier_head notifier;
+ bool connected;
};
/* SoC PCM stream information */
diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index 29159e1781d0..cd5bd63f6ea6 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -195,10 +195,18 @@ static void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio)
if (gpio->invert)
enable = !enable;
- if (enable)
+ if (enable) {
+ jack->connected = true;
report = gpio->report;
- else
+ } else {
+ /* FIXME: Spurious interrupt, hack to double check with the
+ * previous state to verify the interrupt.
+ */
+ if (!jack->connected)
+ return;
+ jack->connected = false;
report = 0;
+ }
if (gpio->jack_status_check)
report = gpio->jack_status_check();