mmc: add hs400 enhanced strobe support for mmc subsystem
[firefly-linux-kernel-4.4.55.git] / drivers / mmc / host / sdhci.c
index 8814eb6b83bfd5d28cb73cbc6e215c1e1f997916..6e13fa8471bf253980ccdfa6c529f858058cb6f4 100644 (file)
@@ -2078,6 +2078,16 @@ out_unlock:
        return err;
 }
 
+static int sdhci_prepare_enhanced_strobe(struct mmc_host *mmc, bool enable)
+{
+       /*
+       * Currently we can't find a register to enable enhanced strobe
+       * function for standard sdhci, so we expect variant drivers to
+       * overwrite it.
+       */
+       return -EINVAL;
+}
+
 static int sdhci_select_drive_strength(struct mmc_card *card,
                                       unsigned int max_dtr, int host_drv,
                                       int card_drv, int *drv_type)
@@ -2214,6 +2224,7 @@ static const struct mmc_host_ops sdhci_ops = {
        .enable_sdio_irq = sdhci_enable_sdio_irq,
        .start_signal_voltage_switch    = sdhci_start_signal_voltage_switch,
        .prepare_hs400_tuning           = sdhci_prepare_hs400_tuning,
+       .prepare_enhanced_strobe        = sdhci_prepare_enhanced_strobe,
        .execute_tuning                 = sdhci_execute_tuning,
        .select_drive_strength          = sdhci_select_drive_strength,
        .card_event                     = sdhci_card_event,
@@ -3095,14 +3106,14 @@ int sdhci_add_host(struct sdhci_host *host)
                if (caps[0] & SDHCI_TIMEOUT_CLK_UNIT)
                        host->timeout_clk *= 1000;
 
+               if (override_timeout_clk)
+                       host->timeout_clk = override_timeout_clk;
+
                mmc->max_busy_timeout = host->ops->get_max_timeout_count ?
                        host->ops->get_max_timeout_count(host) : 1 << 27;
                mmc->max_busy_timeout /= host->timeout_clk;
        }
 
-       if (override_timeout_clk)
-               host->timeout_clk = override_timeout_clk;
-
        mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23;
        mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD;