summaryrefslogtreecommitdiff
path: root/ANDROID_3.4.5/drivers/mmc/core/sd.c
diff options
context:
space:
mode:
Diffstat (limited to 'ANDROID_3.4.5/drivers/mmc/core/sd.c')
-rw-r--r--ANDROID_3.4.5/drivers/mmc/core/sd.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ANDROID_3.4.5/drivers/mmc/core/sd.c b/ANDROID_3.4.5/drivers/mmc/core/sd.c
index 7c76a455..5dbafd8e 100644
--- a/ANDROID_3.4.5/drivers/mmc/core/sd.c
+++ b/ANDROID_3.4.5/drivers/mmc/core/sd.c
@@ -1100,6 +1100,16 @@ static void mmc_sd_detect(struct mmc_host *host)
#endif
mmc_release_host(host);
+#ifdef CONFIG_MMC_UNSAFE_RESUME
+ if (err || (host->card_attath_status == card_attach_status_change)) {
+ host->card_attath_status = card_attach_status_unchange;
+ mmc_sd_remove(host);
+ mmc_claim_host(host);
+ mmc_detach_bus(host);
+ mmc_power_off(host);
+ mmc_release_host(host);
+ }
+#else
if (err) {
mmc_sd_remove(host);
@@ -1108,6 +1118,7 @@ static void mmc_sd_detect(struct mmc_host *host)
mmc_power_off(host);
mmc_release_host(host);
}
+#endif
}
/*
@@ -1163,6 +1174,11 @@ static int mmc_sd_resume(struct mmc_host *host)
#endif
mmc_release_host(host);
+#ifdef CONFIG_MMC_UNSAFE_RESUME
+ if (err)
+ host->card_attath_status = card_attach_status_change;
+#endif
+
return err;
}