diff options
author | Sharad Gupta <sharadg@nvidia.com> | 2014-04-23 21:39:48 +0530 |
---|---|---|
committer | Riham Haidar <rhaidar@nvidia.com> | 2014-04-30 13:12:06 -0700 |
commit | 2c936d6cb3e940a8dfe857fac445d0d5d717c8b9 (patch) | |
tree | 43030d464560b2d1f24bfca755a3b7dbc7489d66 /sound | |
parent | f63dd89bb4068f8a10b127bdb715c4a9b181c1fe (diff) |
Asoc:tegra:rt5639: Fix false headset intr issue
When the device enters to LP0, resetting of the audio codec makes the
HP detection GPIO pin high and causes a false interrupt. If the codec
gets reset before the interrupt is disabled by the machine driver,
device never goes to LP0 or wakes up from LP0. Added fix to avoid
this condition.
Bug 1499603
Reviewed-on: http://git-master/r/400786
(cherry picked from commit cb430a1dcc1eab8dc993c5042a4683d81edb1b8d)
Change-Id: I5fd498c13a384b501243b13a7faef6aa069aa7ab
Signed-off-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-on: http://git-master/r/402750
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/tegra/tegra_rt5639.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/sound/soc/tegra/tegra_rt5639.c b/sound/soc/tegra/tegra_rt5639.c index cfef2d10ccc3..0493b2987862 100644 --- a/sound/soc/tegra/tegra_rt5639.c +++ b/sound/soc/tegra/tegra_rt5639.c @@ -1080,9 +1080,27 @@ static struct snd_soc_dai_link tegra_rt5639_dai[NUM_DAI_LINKS] = { }, }; -static int tegra_rt5639_suspend_post(struct snd_soc_card *card) +static int tegra_rt5639_suspend_pre(struct snd_soc_card *card) { + struct tegra_rt5639 *machine = snd_soc_card_get_drvdata(card); struct snd_soc_jack_gpio *gpio = &tegra_rt5639_hp_jack_gpio; + int i, suspend_allowed = 1; + + for (i = 0; i < machine->pcard->num_links; i++) { + if (machine->pcard->dai_link[i].ignore_suspend) { + suspend_allowed = 0; + break; + } + } + + /* If allowed, disable the irq so that device goes to suspend*/ + if ((suspend_allowed) && (gpio_is_valid(gpio->gpio))) + disable_irq(gpio_to_irq(gpio->gpio)); + return 0; +} + +static int tegra_rt5639_suspend_post(struct snd_soc_card *card) +{ struct tegra_rt5639 *machine = snd_soc_card_get_drvdata(card); int i, suspend_allowed = 1; @@ -1095,9 +1113,6 @@ static int tegra_rt5639_suspend_post(struct snd_soc_card *card) } if (suspend_allowed) { - /*Disable the irq so that device goes to suspend*/ - if (gpio_is_valid(gpio->gpio)) - disable_irq(gpio_to_irq(gpio->gpio)); /*This may be required if dapm setbias level is not called in some cases, may be due to a wrong dapm map*/ if (machine->clock_enabled) { @@ -1184,6 +1199,7 @@ static struct snd_soc_card snd_soc_tegra_rt5639 = { .dai_link = tegra_rt5639_dai, .num_links = ARRAY_SIZE(tegra_rt5639_dai), .suspend_post = tegra_rt5639_suspend_post, + .suspend_pre = tegra_rt5639_suspend_pre, .resume_pre = tegra_rt5639_resume_pre, .set_bias_level = tegra_rt5639_set_bias_level, .set_bias_level_post = tegra_rt5639_set_bias_level_post, |