summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVenkat Gopalakrishnan <venkatg@codeaurora.org>2015-07-28 13:44:53 -0700
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:27:09 -0700
commitbdd297db78b28e8e9bb145934cb9dc00a56e0071 (patch)
tree7b20ebe48d9fef0588acb8ff3b97f7fb31f57853
parente0ee5ff565543bcc9f91635e27090c229c7e4750 (diff)
mmc: sdhci-msm: Reenable cd gpio on system resume
In 3.18 kernel mmc_gpiod_request_cd_irq() is not called as part of call to mmc_gpio_request_cd(). During probe this is taken care of by calling mmc_gpiod_request_cd_irq() from mmc_start_host(), but if mmc_gpio_request_cd() followed by a mmc_gpio_free_cd() is invoked after mmc_start_host() (such as in system suspend/resume path) then mmc_gpiod_request_cd_irq() needs to be called explicitly. Instead of free/request the card detect irq, just disable/enable the irq in system suspend/resume path. CRs-fixed: 876453 Change-Id: I976cd5061c2a7d8321e48ee23a44acfd552a37fc Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
-rw-r--r--drivers/mmc/host/sdhci-msm.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 1e23ec2d043c..635bcd755e09 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -3583,8 +3583,9 @@ static int sdhci_msm_suspend(struct device *dev)
int ret = 0;
ktime_t start = ktime_get();
- if (gpio_is_valid(msm_host->pdata->status_gpio))
- mmc_gpio_free_cd(msm_host->mmc);
+ if (gpio_is_valid(msm_host->pdata->status_gpio) &&
+ (msm_host->mmc->slot.cd_irq >= 0))
+ disable_irq(msm_host->mmc->slot.cd_irq);
if (pm_runtime_suspended(dev)) {
pr_debug("%s: %s: already runtime suspended\n",
@@ -3606,13 +3607,10 @@ static int sdhci_msm_resume(struct device *dev)
int ret = 0;
ktime_t start = ktime_get();
- if (gpio_is_valid(msm_host->pdata->status_gpio)) {
- ret = mmc_gpio_request_cd(msm_host->mmc,
- msm_host->pdata->status_gpio, 0);
- if (ret)
- pr_err("%s: %s: Failed to request card detection IRQ %d\n",
- mmc_hostname(host->mmc), __func__, ret);
- }
+ if (gpio_is_valid(msm_host->pdata->status_gpio) &&
+ (msm_host->mmc->slot.cd_irq >= 0))
+ enable_irq(msm_host->mmc->slot.cd_irq);
+
if (pm_runtime_suspended(dev)) {
pr_debug("%s: %s: runtime suspended, defer system resume\n",
mmc_hostname(host->mmc), __func__);