summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVeerabhadrarao Badiganti <vbadigan@codeaurora.org>2017-06-21 19:27:32 +0530
committerVeerabhadrarao Badiganti <vbadigan@codeaurora.org>2017-06-22 10:55:19 +0530
commit7ffd15f63da51cbad600a637745fd3ea308fd7bb (patch)
tree9ac9d2e38f1f050f13c28aa365bcee171b7e06d6
parent560a996da5c0bf398d2fba51e9909cd7323afea8 (diff)
mmc: sdhci-msm: Don't turnoff Vcc during initialization
As per emmc specification, device should be notified either with power-off or sleep notification before turning off the Vcc. Failing to do so might affect the device longevity. In mmc driver initialization phase even before device probing gets completed, Vcc is getting turned off without these notifications. Since it can't send commands at this stage, So just ensure that Vcc is not turned off till initialization gets completed. Change-Id: I0bbf0077357d66c888147be40a0c5d312b9ce063 Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
-rw-r--r--drivers/mmc/host/sdhci-msm.c23
-rw-r--r--drivers/mmc/host/sdhci-msm.h1
2 files changed, 7 insertions, 17 deletions
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index feb9cbe1f068..d908c3fed7c9 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -2366,21 +2366,6 @@ out:
return ret;
}
-/*
- * Reset vreg by ensuring it is off during probe. A call
- * to enable vreg is needed to balance disable vreg
- */
-static int sdhci_msm_vreg_reset(struct sdhci_msm_pltfm_data *pdata)
-{
- int ret;
-
- ret = sdhci_msm_setup_vreg(pdata, 1, true);
- if (ret)
- return ret;
- ret = sdhci_msm_setup_vreg(pdata, 0, true);
- return ret;
-}
-
/* This init function should be called only once for each SDHC slot */
static int sdhci_msm_vreg_init(struct device *dev,
struct sdhci_msm_pltfm_data *pdata,
@@ -2415,7 +2400,7 @@ static int sdhci_msm_vreg_init(struct device *dev,
if (ret)
goto vdd_reg_deinit;
}
- ret = sdhci_msm_vreg_reset(pdata);
+
if (ret)
dev_err(dev, "vreg reset failed (%d)\n", ret);
goto out;
@@ -2592,7 +2577,9 @@ static irqreturn_t sdhci_msm_pwr_irq(int irq, void *data)
io_level = REQ_IO_HIGH;
}
if (irq_status & CORE_PWRCTL_BUS_OFF) {
- ret = sdhci_msm_setup_vreg(msm_host->pdata, false, false);
+ if (msm_host->pltfm_init_done)
+ ret = sdhci_msm_setup_vreg(msm_host->pdata,
+ false, false);
if (!ret) {
ret = sdhci_msm_setup_pins(msm_host->pdata, false);
ret |= sdhci_msm_set_vdd_io_vol(msm_host->pdata,
@@ -4668,6 +4655,8 @@ static int sdhci_msm_probe(struct platform_device *pdev)
goto vreg_deinit;
}
+ msm_host->pltfm_init_done = true;
+
pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);
pm_runtime_set_autosuspend_delay(&pdev->dev, MSM_AUTOSUSPEND_DELAY_MS);
diff --git a/drivers/mmc/host/sdhci-msm.h b/drivers/mmc/host/sdhci-msm.h
index b63b4df3ded3..79949c2c537f 100644
--- a/drivers/mmc/host/sdhci-msm.h
+++ b/drivers/mmc/host/sdhci-msm.h
@@ -226,6 +226,7 @@ struct sdhci_msm_host {
bool mci_removed;
const struct sdhci_msm_offset *offset;
bool core_3_0v_support;
+ bool pltfm_init_done;
};
extern char *saved_command_line;