]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
Asoc:tegra:rt5639: Fix repeated HS notifications
authorDiwakar Paliwal <dpaliwal@nvidia.com>
Tue, 18 Aug 2015 04:50:02 +0000 (10:20 +0530)
committerRavindra Lokhande <rlokhande@nvidia.com>
Tue, 1 Sep 2015 05:55:10 +0000 (22:55 -0700)
In suspend state, enabling interrupt before cache syncing were giving
false interrupts. Upon activating screen, these were seen as multiple
HS connected and disconnected notifications. Changed the order to
enable interrupt after rt5639 resume to fix the issue.

Bug 200066074

Change-Id: Ifca0b42a7fdf7d99dc33e124214ad161b76cafe2
Signed-off-by: Diwakar Paliwal <dpaliwal@nvidia.com>
Reviewed-on: http://git-master/r/785320
(cherry picked from commit 889617fbc83b3bb29fd3d82cffc53ab73f6b7169)
Reviewed-on: http://git-master/r/791581
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com>
sound/soc/tegra/tegra_rt5639.c

index 2e02ba19c57121a9c09729f999175f2fa5b344ce..61ea1612e538342889d9c012458f2640cacf1197 100644 (file)
@@ -1139,6 +1139,33 @@ static int tegra_rt5639_suspend_post(struct snd_soc_card *card)
 }
 
 static int tegra_rt5639_resume_pre(struct snd_soc_card *card)
+{
+       struct tegra_rt5639 *machine = snd_soc_card_get_drvdata(card);
+       int i, suspend_allowed = 1;
+
+       /*In Voice Call we ignore suspend..so check for that*/
+       for (i = 0; i < machine->pcard->num_links; i++) {
+               if (machine->pcard->dai_link[i].ignore_suspend) {
+                       suspend_allowed = 0;
+                       break;
+               }
+       }
+
+       if (suspend_allowed) {
+               /*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 &&
+                               machine->bias_level != SND_SOC_BIAS_OFF) {
+                       machine->clock_enabled = 1;
+                       tegra_asoc_utils_clk_enable(&machine->util_data);
+               }
+               /*TODO: Enable Audio Regulators*/
+       }
+
+       return 0;
+}
+
+static int tegra_rt5639_resume_post(struct snd_soc_card *card)
 {
        int val;
        struct snd_soc_jack_gpio *gpio = &tegra_rt5639_hp_jack_gpio;
@@ -1162,14 +1189,6 @@ static int tegra_rt5639_resume_pre(struct snd_soc_card *card)
                        snd_soc_jack_report(gpio->jack, val, gpio->report);
                        enable_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 &&
-                               machine->bias_level != SND_SOC_BIAS_OFF) {
-                       machine->clock_enabled = 1;
-                       tegra_asoc_utils_clk_enable(&machine->util_data);
-               }
-               /*TODO: Enable Audio Regulators*/
        }
 
        return 0;
@@ -1214,6 +1233,7 @@ static struct snd_soc_card snd_soc_tegra_rt5639 = {
        .suspend_post = tegra_rt5639_suspend_post,
        .suspend_pre = tegra_rt5639_suspend_pre,
        .resume_pre = tegra_rt5639_resume_pre,
+       .resume_post = tegra_rt5639_resume_post,
        .set_bias_level = tegra_rt5639_set_bias_level,
        .set_bias_level_post = tegra_rt5639_set_bias_level_post,
        .controls = ardbeg_controls,