aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/core/mmc.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 6defddd795f6..d7d8a93c3503 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1047,22 +1047,6 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
1047 } 1047 }
1048 1048
1049 /* 1049 /*
1050 * Enable HPI feature (if supported)
1051 */
1052 if (card->ext_csd.hpi) {
1053 err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
1054 EXT_CSD_HPI_MGMT, 1, 0);
1055 if (err && err != -EBADMSG)
1056 goto free_card;
1057 if (err) {
1058 pr_warning("%s: Enabling HPI failed\n",
1059 mmc_hostname(card->host));
1060 err = 0;
1061 } else
1062 card->ext_csd.hpi_en = 1;
1063 }
1064
1065 /*
1066 * Compute bus speed. 1050 * Compute bus speed.
1067 */ 1051 */
1068 max_dtr = (unsigned int)-1; 1052 max_dtr = (unsigned int)-1;
@@ -1111,9 +1095,12 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
1111 * 4. execute tuning for HS200 1095 * 4. execute tuning for HS200
1112 */ 1096 */
1113 if ((host->caps2 & MMC_CAP2_HS200) && 1097 if ((host->caps2 & MMC_CAP2_HS200) &&
1114 card->host->ops->execute_tuning) 1098 card->host->ops->execute_tuning) {
1099 mmc_host_clk_hold(card->host);
1115 err = card->host->ops->execute_tuning(card->host, 1100 err = card->host->ops->execute_tuning(card->host,
1116 MMC_SEND_TUNING_BLOCK_HS200); 1101 MMC_SEND_TUNING_BLOCK_HS200);
1102 mmc_host_clk_release(card->host);
1103 }
1117 if (err) { 1104 if (err) {
1118 pr_warning("%s: tuning execution failed\n", 1105 pr_warning("%s: tuning execution failed\n",
1119 mmc_hostname(card->host)); 1106 mmc_hostname(card->host));
@@ -1233,6 +1220,23 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
1233 } 1220 }
1234 1221
1235 /* 1222 /*
1223 * Enable HPI feature (if supported)
1224 */
1225 if (card->ext_csd.hpi) {
1226 err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
1227 EXT_CSD_HPI_MGMT, 1,
1228 card->ext_csd.generic_cmd6_time);
1229 if (err && err != -EBADMSG)
1230 goto free_card;
1231 if (err) {
1232 pr_warning("%s: Enabling HPI failed\n",
1233 mmc_hostname(card->host));
1234 err = 0;
1235 } else
1236 card->ext_csd.hpi_en = 1;
1237 }
1238
1239 /*
1236 * If cache size is higher than 0, this indicates 1240 * If cache size is higher than 0, this indicates
1237 * the existence of cache and it can be turned on. 1241 * the existence of cache and it can be turned on.
1238 */ 1242 */