diff options
author | Dov Levenglick <dovl@codeaurora.org> | 2015-07-20 09:30:52 +0300 |
---|---|---|
committer | Subhash Jadavani <subhashj@codeaurora.org> | 2016-05-31 15:27:04 -0700 |
commit | d83bd544785109918936084ea90aee4f8e4420c2 (patch) | |
tree | 01765e08c4afa377bf46e5f7fb5a23eb9f468b08 | |
parent | 348a140b51c072d00ca66d56e8d20e5fcab758ad (diff) |
mmc: sdhci-msm: configure MMC_PM_KEEP_POWER for SDIO
Add MMC_PM_KEEP_POWER specifically when connected to
SDIO cards, rather than in general for the host.
Change-Id: Idb666680f99277ae509c642595821448c21b6c90
Signed-off-by: Dov Levenglick <dovl@codeaurora.org>
-rw-r--r-- | drivers/mmc/host/sdhci-msm.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index 3be6ade7b672..b2ad35a91685 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -2841,6 +2841,19 @@ static void sdhci_msm_clear_set_dumpregs(struct sdhci_host *host, bool set) } } +static void sdhci_msm_detect(struct sdhci_host *host, bool detected) +{ + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct sdhci_msm_host *msm_host = pltfm_host->priv; + struct mmc_host *mmc = msm_host->mmc; + struct mmc_card *card = mmc->card; + + if (detected && mmc_card_sdio(card)) + mmc->pm_caps |= MMC_PM_KEEP_POWER; + else + mmc->pm_caps &= ~MMC_PM_KEEP_POWER; +} + static struct sdhci_ops sdhci_msm_ops = { .crypto_engine_cfg = sdhci_msm_ice_cfg, .crypto_engine_reset = sdhci_msm_ice_reset, @@ -2860,6 +2873,7 @@ static struct sdhci_ops sdhci_msm_ops = { .reset = sdhci_msm_reset, .clear_set_dumpregs = sdhci_msm_clear_set_dumpregs, .enhanced_strobe_mask = sdhci_msm_enhanced_strobe_mask, + .detect = sdhci_msm_detect, }; static void sdhci_set_default_hw_caps(struct sdhci_msm_host *msm_host, @@ -3295,7 +3309,6 @@ static int sdhci_msm_probe(struct platform_device *pdev) msm_host->mmc->caps2 |= MMC_CAP2_ASYNC_SDIO_IRQ_4BIT_MODE; msm_host->mmc->caps2 |= MMC_CAP2_HS400_POST_TUNING; msm_host->mmc->caps2 |= MMC_CAP2_CLK_SCALE; - msm_host->mmc->pm_caps |= MMC_PM_KEEP_POWER; if (msm_host->pdata->nonremovable) msm_host->mmc->caps |= MMC_CAP_NONREMOVABLE; |