From cc7f5174770787871c252f9446eb26ea42d7eb2b Mon Sep 17 00:00:00 2001 From: dukhyun kwon Date: Thu, 27 Dec 2018 14:59:20 +0900 Subject: [PATCH] [RAMEN9610-11636][COMMON] mmc: dw_mmc: sdcard power off when to card detect Change-Id: I9a53d9e51347d947d66d8648bc7f21d672d3e83c Signed-off-by: dukhyun kwon --- drivers/mmc/host/dw_mmc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index a8c5640efce4..a5b097368de8 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -3479,6 +3479,14 @@ static void dw_mci_slot_of_parse(struct dw_mci_slot *slot) static irqreturn_t dw_mci_detect_interrupt(int irq, void *dev_id) { struct dw_mci *host = dev_id; + struct mmc_host *mmc = host->slot->mmc; + struct dw_mci_slot *slot = host->slot; + + if (!IS_ERR(mmc->supply.vmmc)) + mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); + if (!IS_ERR(mmc->supply.vqmmc) && slot->host->vqmmc_enabled) + regulator_disable(mmc->supply.vqmmc); + slot->host->vqmmc_enabled = false; queue_work(host->card_workqueue, &host->card_work); -- 2.20.1