mmc: sdhci: Add platform suspend/resume hooks.
authorChris Ball <cjb@laptop.org>
Mon, 6 Feb 2012 05:43:59 +0000 (00:43 -0500)
committerChris Ball <cjb@laptop.org>
Sun, 25 Mar 2012 23:33:44 +0000 (19:33 -0400)
Some platforms require saving/restoring registers across suspend/resume;
this hook allows them to do that inside their driver.

Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.h

index 8d66706824a6105ceeac2f63526372a4f0c521fd..1f5888b42b2c9fadbaa20c792e4a18dde994ce91 100644 (file)
@@ -2379,6 +2379,9 @@ int sdhci_suspend_host(struct sdhci_host *host)
        int ret;
        bool has_tuning_timer;
 
+       if (host->ops->platform_suspend)
+               host->ops->platform_suspend(host);
+
        sdhci_disable_card_detection(host);
 
        /* Disable tuning since we are suspending */
@@ -2429,6 +2432,9 @@ int sdhci_resume_host(struct sdhci_host *host)
        ret = mmc_resume_host(host->mmc);
        sdhci_enable_card_detection(host);
 
+       if (host->ops->platform_resume)
+               host->ops->platform_resume(host);
+
        /* Set the re-tuning expiration flag */
        if ((host->version >= SDHCI_SPEC_300) && host->tuning_count &&
            (host->tuning_mode == SDHCI_TUNING_MODE_1))
index ad265b96b75b4f25262186ff68a171202c4474ee..f761f23d2a28ccb287e1da22b2433478833b82f1 100644 (file)
@@ -275,6 +275,8 @@ struct sdhci_ops {
        void    (*platform_reset_exit)(struct sdhci_host *host, u8 mask);
        int     (*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs);
        void    (*hw_reset)(struct sdhci_host *host);
+       void    (*platform_suspend)(struct sdhci_host *host);
+       void    (*platform_resume)(struct sdhci_host *host);
 };
 
 #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS