diff options
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 3d338b4b416a..0636e9a587b1 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -2349,19 +2349,30 @@ out: | |||
2349 | int sdhci_suspend_host(struct sdhci_host *host) | 2349 | int sdhci_suspend_host(struct sdhci_host *host) |
2350 | { | 2350 | { |
2351 | int ret; | 2351 | int ret; |
2352 | bool has_tuning_timer; | ||
2352 | 2353 | ||
2353 | sdhci_disable_card_detection(host); | 2354 | sdhci_disable_card_detection(host); |
2354 | 2355 | ||
2355 | /* Disable tuning since we are suspending */ | 2356 | /* Disable tuning since we are suspending */ |
2356 | if (host->version >= SDHCI_SPEC_300 && host->tuning_count && | 2357 | has_tuning_timer = host->version >= SDHCI_SPEC_300 && |
2357 | host->tuning_mode == SDHCI_TUNING_MODE_1) { | 2358 | host->tuning_count && host->tuning_mode == SDHCI_TUNING_MODE_1; |
2359 | if (has_tuning_timer) { | ||
2358 | del_timer_sync(&host->tuning_timer); | 2360 | del_timer_sync(&host->tuning_timer); |
2359 | host->flags &= ~SDHCI_NEEDS_RETUNING; | 2361 | host->flags &= ~SDHCI_NEEDS_RETUNING; |
2360 | } | 2362 | } |
2361 | 2363 | ||
2362 | ret = mmc_suspend_host(host->mmc); | 2364 | ret = mmc_suspend_host(host->mmc); |
2363 | if (ret) | 2365 | if (ret) { |
2366 | if (has_tuning_timer) { | ||
2367 | host->flags |= SDHCI_NEEDS_RETUNING; | ||
2368 | mod_timer(&host->tuning_timer, jiffies + | ||
2369 | host->tuning_count * HZ); | ||
2370 | } | ||
2371 | |||
2372 | sdhci_enable_card_detection(host); | ||
2373 | |||
2364 | return ret; | 2374 | return ret; |
2375 | } | ||
2365 | 2376 | ||
2366 | free_irq(host->irq, host); | 2377 | free_irq(host->irq, host); |
2367 | 2378 | ||