@@ -2680,7 +2680,7 @@ int mmc_resume_host(struct mmc_host *host)
if (host->bus_ops && !host->bus_dead) {
if (!mmc_card_keep_power(host)) {
mmc_power_up(host);
- mmc_select_voltage(host, host->ocr);
+ mmc_select_voltage(host, host->card->ocr);
/*
* Tell runtime PM core we just powered up the card,
* since it still believes the card is powered off.
@@ -1566,6 +1566,9 @@ int mmc_attach_mmc(struct mmc_host *host)
ocr &= ~0x7F;
}
+ /* Save the card OCR */
+ host->card->ocr = ocr;
+
host->ocr = mmc_select_voltage(host, ocr);
/*
@@ -1185,6 +1185,9 @@ int mmc_attach_sd(struct mmc_host *host)
ocr &= ~MMC_VDD_165_195;
}
+ /* Save the card OCR */
+ host->card->ocr = ocr;
+
host->ocr = mmc_select_voltage(host, ocr);
/*
@@ -1090,6 +1090,9 @@ int mmc_attach_sdio(struct mmc_host *host)
ocr &= ~0x7F;
}
+ /* Save the card OCR */
+ host->card->ocr = ocr;
+
host->ocr = mmc_select_voltage(host, ocr);
/*
@@ -273,6 +273,7 @@ struct mmc_card {
u32 raw_cid[4]; /* raw card CID */
u32 raw_csd[4]; /* raw card CSD */
u32 raw_scr[2]; /* raw card SCR */
+ u32 ocr; /* card OCR */
struct mmc_cid cid; /* card identification */
struct mmc_csd csd; /* card specific */
struct mmc_ext_csd ext_csd; /* mmc v4 extended card