提交 9e7861f5 编写于 作者: A Alexandre Belloni 提交者: Chris Ball

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: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
Acked-by: NLudovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: NChris Ball <chris@printf.net>
上级 390145f9
...@@ -1402,8 +1402,14 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ...@@ -1402,8 +1402,14 @@ static void atmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
clk_unprepare(host->mck); clk_unprepare(host->mck);
switch (ios->power_mode) { 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: case MMC_POWER_UP:
set_bit(ATMCI_CARD_NEED_INIT, &slot->flags); 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; break;
default: default:
/* /*
...@@ -2215,6 +2221,7 @@ static int __init atmci_init_slot(struct atmel_mci *host, ...@@ -2215,6 +2221,7 @@ static int __init atmci_init_slot(struct atmel_mci *host,
} }
host->slot[id] = slot; host->slot[id] = slot;
mmc_regulator_get_supply(mmc);
mmc_add_host(mmc); mmc_add_host(mmc);
if (gpio_is_valid(slot->detect_pin)) { if (gpio_is_valid(slot->detect_pin)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册