mmc: sdio: Check if card supports 1.8V signalling
Pavan Kunapuli [Fri, 31 Aug 2012 13:58:13 +0000 (18:58 +0530)]
When inquiring about the voltage range needed by
the card, check for 1.8V signalling voltage support
if the host supports any of the UHS modes.

Bug 1042131

Change-Id: Ic843bd6710a5b2f1d4d30764978fef2f808271d9
Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com>
Reviewed-on: http://git-master/r/131022
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Rakesh Kumar <krakesh@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>

drivers/mmc/core/sdio.c

index cd5930e..4b56ff3 100644 (file)
@@ -592,8 +592,17 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
        if (!powered_resume) {
                /* The initialization should be done at 3.3 V I/O voltage. */
                mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, 0);
-
-               err = mmc_send_io_op_cond(host, host->ocr, &ocr);
+               /*
+                * If the host supports any of the UHS modes, check whether
+                * the card supports 1.8V signalling voltage.
+                */
+               if (host->caps &
+                       (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
+                       MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 |
+                       MMC_CAP_UHS_DDR50)) {
+                       ocr |= R4_18V_PRESENT;
+               }
+               err = mmc_send_io_op_cond(host, ocr, &ocr);
                if (err)
                        goto err;
        }