From: Lee Jones Date: Thu, 31 Jan 2013 11:27:52 +0000 (+0000) Subject: mmc: mmci: Move ios_handler functionality into the driver X-Git-Tag: v3.10-rc1~126^2~14^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=237fb5e675a312a84a602ad0fbdf0b4957c71073;p=profile%2Fivi%2Fkernel-x86-ivi.git mmc: mmci: Move ios_handler functionality into the driver There are currently two instances of the ios_handler being used. Both of which mearly toy with some regulator settings. Now there is a GPIO regulator API, we can use that instead, and lessen the per platform burden. By doing this, we also become more Device Tree compatible. Acked-by: Chris Ball Signed-off-by: Lee Jones Signed-off-by: Ulf Hansson Signed-off-by: Russell King Signed-off-by: Linus Walleij --- diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 372e921..375c109 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1141,6 +1141,11 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) case MMC_POWER_OFF: if (!IS_ERR(mmc->supply.vmmc)) mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); + + if (!IS_ERR(mmc->supply.vqmmc) && + regulator_is_enabled(mmc->supply.vqmmc)) + regulator_disable(mmc->supply.vqmmc); + break; case MMC_POWER_UP: if (!IS_ERR(mmc->supply.vmmc)) @@ -1155,6 +1160,10 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) break; case MMC_POWER_ON: + if (!IS_ERR(mmc->supply.vqmmc) && + !regulator_is_enabled(mmc->supply.vqmmc)) + regulator_enable(mmc->supply.vqmmc); + pwr |= MCI_PWR_ON; break; }