mmc: sdhci-msm: Add checks to know if card supports strobe

This patch adds checks in msm host driver to check if card
also supports enhanced strobe before changing strobe specific
host configuration.

Change-Id: Iab4833e80600c4ad89b16c76b52e917f885eea0e
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
This commit is contained in:
Ritesh Harjani 2015-08-25 11:34:16 +05:30 committed by Subhash Jadavani
parent d409a3b3d9
commit cd14781b29

View file

@ -789,7 +789,7 @@ static int sdhci_msm_cm_dll_sdc4_calibration(struct sdhci_host *host)
writel_relaxed(ddr_config, host->ioaddr + CORE_DDR_CONFIG);
}
if (msm_host->enhanced_strobe)
if (msm_host->enhanced_strobe && mmc_card_strobe(msm_host->mmc->card))
writel_relaxed((readl_relaxed(host->ioaddr + CORE_DDR_200_CFG)
| CORE_CMDIN_RCLK_EN),
host->ioaddr + CORE_DDR_200_CFG);
@ -837,8 +837,8 @@ static int sdhci_msm_enhanced_strobe(struct sdhci_host *host)
pr_debug("%s: Enter %s\n", mmc_hostname(host->mmc), __func__);
if (!msm_host->enhanced_strobe) {
pr_debug("%s: host does not support hs400 enhanced strobe\n",
if (!msm_host->enhanced_strobe || !mmc_card_strobe(mmc->card)) {
pr_debug("%s: host/card does not support hs400 enhanced strobe\n",
mmc_hostname(mmc));
return -EINVAL;
}
@ -2672,8 +2672,10 @@ static void sdhci_msm_set_clock(struct sdhci_host *host, unsigned int clock)
* Select HS400 mode using the HC_SELECT_IN from VENDOR SPEC
* register
*/
if ((msm_host->tuning_done || msm_host->enhanced_strobe) &&
!msm_host->calibration_done) {
if ((msm_host->tuning_done ||
(mmc_card_strobe(msm_host->mmc->card) &&
msm_host->enhanced_strobe)) &&
!msm_host->calibration_done) {
/*
* Write 0x6 to HC_SELECT_IN and 1 to HC_SELECT_IN_EN
* field in VENDOR_SPEC_FUNC
@ -2894,8 +2896,9 @@ static void sdhci_msm_enhanced_strobe_mask(struct sdhci_host *host, bool set)
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct sdhci_msm_host *msm_host = pltfm_host->priv;
if (!msm_host->enhanced_strobe) {
pr_debug("%s: host does not support hs400 enhanced strobe\n",
if (!msm_host->enhanced_strobe ||
!mmc_card_strobe(msm_host->mmc->card)) {
pr_debug("%s: host/card does not support hs400 enhanced strobe\n",
mmc_hostname(host->mmc));
return;
}