diff options
author | Alexandre Belloni <[email protected]> | 2013-10-17 12:46:48 +0200 |
---|---|---|
committer | Chris Ball <[email protected]> | 2014-01-13 13:03:40 -0500 |
commit | 9e7861f500ea2777c82e69b77b965fb8220cd1c5 (patch) | |
tree | 1b8994a516651776d1b42043a9ce465342c47b5f | |
parent | 390145f9adcf2730fcee81c8a51fd7c6c08f705f (diff) |
mmc: atmel-mci: add vmmc-supply support
Other MMC hosts handle a regulator named vmmc-supply that allows to power
the MMC card or SDIO device before communicating on the bus.
Signed-off-by: Alexandre Belloni <[email protected]>
Acked-by: Ulf Hansson <[email protected]>
Acked-by: Ludovic Desroches <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
-rw-r--r-- | drivers/mmc/host/atmel-mci.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 945a31d77364..42706ea0ba85 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -1402,8 +1402,14 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) clk_unprepare(host->mck); switch (ios->power_mode) { + case MMC_POWER_OFF: + if (!IS_ERR(mmc->supply.vmmc)) + mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); + break; case MMC_POWER_UP: set_bit(ATMCI_CARD_NEED_INIT, &slot->flags); + if (!IS_ERR(mmc->supply.vmmc)) + mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); break; default: /* @@ -2215,6 +2221,7 @@ static int __init atmci_init_slot(struct atmel_mci *host, } host->slot[id] = slot; + mmc_regulator_get_supply(mmc); mmc_add_host(mmc); if (gpio_is_valid(slot->detect_pin)) { |