mmc: sdhci-msm: Avoid enable SD card power if card is removed

In some multi card tray designs, removing the SD card may cause
the SD card power supply pin to come in contact with the SIM card.
Ensure the SD card power is not turned on when the SD card is removed
to avoid the SD card power supply to cause damage to the SIM card.

Change-Id: Ic2a2e21e592d46dbd011a4e3f2ac108e9275f92c
Signed-off-by: Bao D. Nguyen <nguyenb@codeaurora.org>
This commit is contained in:
Bao D. Nguyen 2020-03-13 16:33:52 -07:00 • committed by Gerrit - the friendly Code Review server
commit 82fc401559

View file

@ -2058,6 +2058,7 @@ static void sdhci_msm_handle_pwr_irq(struct sdhci_host *host, int irq)
u32 config;
const struct sdhci_msm_offset *msm_offset = msm_host->offset;
int ret = 0;
struct mmc_host *mmc = host->mmc;
irq_status = msm_host_readl(msm_host, host,
msm_offset->core_pwrctl_status);
@ -2088,6 +2089,12 @@ static void sdhci_msm_handle_pwr_irq(struct sdhci_host *host, int irq)
udelay(10);
}
if (mmc->ops->get_cd && !mmc->ops->get_cd(mmc) &&
irq_status & (CORE_PWRCTL_BUS_ON | CORE_PWRCTL_IO_HIGH |
CORE_PWRCTL_IO_LOW)) {
return;
}
/* Handle BUS ON/OFF*/
if (irq_status & CORE_PWRCTL_BUS_ON) {
ret = sdhci_msm_setup_vreg(msm_host->pdata, true, false);