sdhci: Adding regulator support when setting mmc ios.
authorAymen Zayet <aymenx.zayet@intel.com>
Mon, 21 Nov 2011 18:22:11 +0000 (19:22 +0100)
committerbuildbot <buildbot@intel.com>
Mon, 28 Nov 2011 19:38:35 +0000 (11:38 -0800)
BZ: 15061

Enable / disable regulator when mmc ios is updated.

Change-Id: Ib9a0fa2b5399a000ef5e86adff49a4ef33e6c2d8
Signed-off-by: Aymen Zayet <aymenx.zayet@intel.com>
Reviewed-on: http://android.intel.com:8080/25379
Reviewed-by: Champciaux, NicolasX <nicolasx.champciaux@intel.com>
Tested-by: Champciaux, NicolasX <nicolasx.champciaux@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/mmc/host/sdhci.c

index 637393c..4c67683 100644 (file)
@@ -1532,6 +1532,14 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
        unsigned long flags;
        u8 ctrl;
 
+       if (host->vmmc) {
+               if (ios->power_mode == MMC_POWER_OFF)
+                       mmc_regulator_set_ocr(host->mmc, host->vmmc, 0);
+               else
+                       mmc_regulator_set_ocr(host->mmc, host->vmmc,
+                       host->mmc->ios.vdd);
+       }
+
        spin_lock_irqsave(&host->lock, flags);
 
        if (host->flags & SDHCI_DEVICE_DEAD)