diff options
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 4e2031449a23..8072e16d6d46 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -1245,6 +1245,25 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
1245 | 1245 | ||
1246 | sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); | 1246 | sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); |
1247 | 1247 | ||
1248 | if (host->version >= SDHCI_SPEC_300) { | ||
1249 | u16 ctrl_2; | ||
1250 | |||
1251 | ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2); | ||
1252 | if (!(ctrl_2 & SDHCI_CTRL_PRESET_VAL_ENABLE)) { | ||
1253 | /* | ||
1254 | * We only need to set Driver Strength if the | ||
1255 | * preset value enable is not set. | ||
1256 | */ | ||
1257 | ctrl_2 &= ~SDHCI_CTRL_DRV_TYPE_MASK; | ||
1258 | if (ios->drv_type == MMC_SET_DRIVER_TYPE_A) | ||
1259 | ctrl_2 |= SDHCI_CTRL_DRV_TYPE_A; | ||
1260 | else if (ios->drv_type == MMC_SET_DRIVER_TYPE_C) | ||
1261 | ctrl_2 |= SDHCI_CTRL_DRV_TYPE_C; | ||
1262 | |||
1263 | sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2); | ||
1264 | } | ||
1265 | } | ||
1266 | |||
1248 | /* | 1267 | /* |
1249 | * Some (ENE) controllers go apeshit on some ios operation, | 1268 | * Some (ENE) controllers go apeshit on some ios operation, |
1250 | * signalling timeout and CRC errors even on CMD0. Resetting | 1269 | * signalling timeout and CRC errors even on CMD0. Resetting |
@@ -2086,6 +2105,14 @@ int sdhci_add_host(struct sdhci_host *host) | |||
2086 | if (caps[1] & SDHCI_SUPPORT_DDR50) | 2105 | if (caps[1] & SDHCI_SUPPORT_DDR50) |
2087 | mmc->caps |= MMC_CAP_UHS_DDR50; | 2106 | mmc->caps |= MMC_CAP_UHS_DDR50; |
2088 | 2107 | ||
2108 | /* Driver Type(s) (A, C, D) supported by the host */ | ||
2109 | if (caps[1] & SDHCI_DRIVER_TYPE_A) | ||
2110 | mmc->caps |= MMC_CAP_DRIVER_TYPE_A; | ||
2111 | if (caps[1] & SDHCI_DRIVER_TYPE_C) | ||
2112 | mmc->caps |= MMC_CAP_DRIVER_TYPE_C; | ||
2113 | if (caps[1] & SDHCI_DRIVER_TYPE_D) | ||
2114 | mmc->caps |= MMC_CAP_DRIVER_TYPE_D; | ||
2115 | |||
2089 | ocr_avail = 0; | 2116 | ocr_avail = 0; |
2090 | /* | 2117 | /* |
2091 | * According to SD Host Controller spec v3.00, if the Host System | 2118 | * According to SD Host Controller spec v3.00, if the Host System |