mmc: sdhci: allow clock enable in suspend sequence
Bitan Biswas [Wed, 17 Feb 2016 12:24:10 +0000 (17:24 +0530)]
Some host with SDHCI_QUIRK2_NON_STD_RTPM deviation
need to enable clock in the suspend sequence.
This change enables such platforms to
suspend properly.

bug 200155814

Change-Id: I37969748660965c4b4097837e9b9c6bb7a593b4e
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: http://git-master/r/1012839
(cherry picked from commit e27946db4cc054ab016459e3e16f3e68a51f0872)
Reviewed-on: http://git-master/r/1177603
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>

drivers/mmc/host/sdhci.c

index 0343536..382bc12 100644 (file)
@@ -3662,7 +3662,11 @@ int sdhci_suspend_host(struct sdhci_host *host)
        int ret;
        struct mmc_host *mmc = host->mmc;
 
-       host->suspend_task = current;
+       /* we need to enable clocks during
+        * mmc_suspend_host for SDHCI_QUIRK2_NON_STD_RTPM
+        */
+       if (!(host->quirks2 & SDHCI_QUIRK2_NON_STD_RTPM))
+               host->suspend_task = current;
 
        if (host->ops->platform_suspend)
                host->ops->platform_suspend(host);
@@ -3693,7 +3697,8 @@ int sdhci_suspend_host(struct sdhci_host *host)
 
                sdhci_enable_card_detection(host);
 
-               host->suspend_task = NULL;
+               if (!(host->quirks2 & SDHCI_QUIRK2_NON_STD_RTPM))
+                       host->suspend_task = NULL;
                return ret;
        }
        /* cancel delayed clk gate work */
@@ -3734,7 +3739,8 @@ int sdhci_suspend_host(struct sdhci_host *host)
                                host->ops->set_clock(host, 0);
        }
 
-       host->suspend_task = NULL;
+       if (!(host->quirks2 & SDHCI_QUIRK2_NON_STD_RTPM))
+               host->suspend_task = NULL;
 
        return ret;
 }