|
@@ -1404,6 +1404,29 @@ void sdhci_set_bus_width(struct sdhci_host *host, int width)
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(sdhci_set_bus_width);
|
|
|
|
|
|
+void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing)
|
|
|
+{
|
|
|
+ u16 ctrl_2;
|
|
|
+
|
|
|
+ ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2);
|
|
|
+ /* Select Bus Speed Mode for host */
|
|
|
+ ctrl_2 &= ~SDHCI_CTRL_UHS_MASK;
|
|
|
+ if ((timing == MMC_TIMING_MMC_HS200) ||
|
|
|
+ (timing == MMC_TIMING_UHS_SDR104))
|
|
|
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR104;
|
|
|
+ else if (timing == MMC_TIMING_UHS_SDR12)
|
|
|
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR12;
|
|
|
+ else if (timing == MMC_TIMING_UHS_SDR25)
|
|
|
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR25;
|
|
|
+ else if (timing == MMC_TIMING_UHS_SDR50)
|
|
|
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR50;
|
|
|
+ else if ((timing == MMC_TIMING_UHS_DDR50) ||
|
|
|
+ (timing == MMC_TIMING_MMC_DDR52))
|
|
|
+ ctrl_2 |= SDHCI_CTRL_UHS_DDR50;
|
|
|
+ sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(sdhci_set_uhs_signaling);
|
|
|
+
|
|
|
static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
|
|
|
{
|
|
|
unsigned long flags;
|
|
@@ -1514,26 +1537,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios)
|
|
|
clk &= ~SDHCI_CLOCK_CARD_EN;
|
|
|
sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
|
|
|
|
|
|
- if (host->ops->set_uhs_signaling)
|
|
|
- host->ops->set_uhs_signaling(host, ios->timing);
|
|
|
- else {
|
|
|
- ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2);
|
|
|
- /* Select Bus Speed Mode for host */
|
|
|
- ctrl_2 &= ~SDHCI_CTRL_UHS_MASK;
|
|
|
- if ((ios->timing == MMC_TIMING_MMC_HS200) ||
|
|
|
- (ios->timing == MMC_TIMING_UHS_SDR104))
|
|
|
- ctrl_2 |= SDHCI_CTRL_UHS_SDR104;
|
|
|
- else if (ios->timing == MMC_TIMING_UHS_SDR12)
|
|
|
- ctrl_2 |= SDHCI_CTRL_UHS_SDR12;
|
|
|
- else if (ios->timing == MMC_TIMING_UHS_SDR25)
|
|
|
- ctrl_2 |= SDHCI_CTRL_UHS_SDR25;
|
|
|
- else if (ios->timing == MMC_TIMING_UHS_SDR50)
|
|
|
- ctrl_2 |= SDHCI_CTRL_UHS_SDR50;
|
|
|
- else if ((ios->timing == MMC_TIMING_UHS_DDR50) ||
|
|
|
- (ios->timing == MMC_TIMING_MMC_DDR52))
|
|
|
- ctrl_2 |= SDHCI_CTRL_UHS_DDR50;
|
|
|
- sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2);
|
|
|
- }
|
|
|
+ host->ops->set_uhs_signaling(host, ios->timing);
|
|
|
|
|
|
if (!(host->quirks2 & SDHCI_QUIRK2_PRESET_VALUE_BROKEN) &&
|
|
|
((ios->timing == MMC_TIMING_UHS_SDR12) ||
|