diff options
author | Chris Ball <cjb@laptop.org> | 2012-02-06 00:43:59 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-03-25 19:33:44 -0400 |
commit | a1b13b4e18d62ea60aad9554f35d79c51328b8b6 (patch) | |
tree | 78e00a547bc10c3849cd74b44954a239b0f6890c /drivers/mmc | |
parent | a39e5746e429b1dae1a71b3ddb05fd82916447c9 (diff) |
mmc: sdhci: Add platform suspend/resume hooks.
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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 6 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 8d66706824a6..1f5888b42b2c 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -2379,6 +2379,9 @@ int sdhci_suspend_host(struct sdhci_host *host) | |||
2379 | int ret; | 2379 | int ret; |
2380 | bool has_tuning_timer; | 2380 | bool has_tuning_timer; |
2381 | 2381 | ||
2382 | if (host->ops->platform_suspend) | ||
2383 | host->ops->platform_suspend(host); | ||
2384 | |||
2382 | sdhci_disable_card_detection(host); | 2385 | sdhci_disable_card_detection(host); |
2383 | 2386 | ||
2384 | /* Disable tuning since we are suspending */ | 2387 | /* Disable tuning since we are suspending */ |
@@ -2429,6 +2432,9 @@ int sdhci_resume_host(struct sdhci_host *host) | |||
2429 | ret = mmc_resume_host(host->mmc); | 2432 | ret = mmc_resume_host(host->mmc); |
2430 | sdhci_enable_card_detection(host); | 2433 | sdhci_enable_card_detection(host); |
2431 | 2434 | ||
2435 | if (host->ops->platform_resume) | ||
2436 | host->ops->platform_resume(host); | ||
2437 | |||
2432 | /* Set the re-tuning expiration flag */ | 2438 | /* Set the re-tuning expiration flag */ |
2433 | if ((host->version >= SDHCI_SPEC_300) && host->tuning_count && | 2439 | if ((host->version >= SDHCI_SPEC_300) && host->tuning_count && |
2434 | (host->tuning_mode == SDHCI_TUNING_MODE_1)) | 2440 | (host->tuning_mode == SDHCI_TUNING_MODE_1)) |
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index ad265b96b75b..f761f23d2a28 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h | |||
@@ -275,6 +275,8 @@ struct sdhci_ops { | |||
275 | void (*platform_reset_exit)(struct sdhci_host *host, u8 mask); | 275 | void (*platform_reset_exit)(struct sdhci_host *host, u8 mask); |
276 | int (*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs); | 276 | int (*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs); |
277 | void (*hw_reset)(struct sdhci_host *host); | 277 | void (*hw_reset)(struct sdhci_host *host); |
278 | void (*platform_suspend)(struct sdhci_host *host); | ||
279 | void (*platform_resume)(struct sdhci_host *host); | ||
278 | }; | 280 | }; |
279 | 281 | ||
280 | #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS | 282 | #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS |