aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core
diff options
context:
space:
mode:
authorArindam Nath <arindam.nath@amd.com>2011-05-05 02:49:05 -0400
committerChris Ball <cjb@laptop.org>2011-05-24 23:53:47 -0400
commit4d55c5a13a189a80d40383f02c8026f9a87d7c87 (patch)
tree6151dd86bac16adf96e7aefb6bc0ca6604a0ebc8 /drivers/mmc/core
parentb513ea250eb7c36a8afb3df938d632ca6b4df7cd (diff)
mmc: sdhci: enable preset value after uhs initialization
According to the Host Controller spec v3.00, setting Preset Value Enable in the Host Control2 register lets SDCLK Frequency Select, Clock Generator Select and Driver Strength Select to be set automatically by the Host Controller based on the UHS-I mode set. This patch enables this feature. Since Preset Value Enable makes sense only for UHS-I cards, we enable this feature after successfull UHS-I initialization. We also reset Preset Value Enable next time before initialization. Tested by Zhangfei Gao with a Toshiba uhs card and general hs card, on mmp2 in SDMA mode. Signed-off-by: Arindam Nath <arindam.nath@amd.com> Reviewed-by: Philip Rakity <prakity@marvell.com> Tested-by: Philip Rakity <prakity@marvell.com> Acked-by: Zhangfei Gao <zhangfei.gao@marvell.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r--drivers/mmc/core/sd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index fc65475a26e..b461b290ce2 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -925,6 +925,13 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
925 925
926 /* Card is an ultra-high-speed card */ 926 /* Card is an ultra-high-speed card */
927 mmc_sd_card_set_uhs(card); 927 mmc_sd_card_set_uhs(card);
928
929 /*
930 * Since initialization is now complete, enable preset
931 * value registers for UHS-I cards.
932 */
933 if (host->ops->enable_preset_value)
934 host->ops->enable_preset_value(host, true);
928 } else { 935 } else {
929 /* 936 /*
930 * Attempt to change to high-speed (if supported) 937 * Attempt to change to high-speed (if supported)
@@ -1095,6 +1102,10 @@ int mmc_attach_sd(struct mmc_host *host)
1095 if (err) 1102 if (err)
1096 return err; 1103 return err;
1097 1104
1105 /* Disable preset value enable if already set since last time */
1106 if (host->ops->enable_preset_value)
1107 host->ops->enable_preset_value(host, false);
1108
1098 err = mmc_send_app_op_cond(host, 0, &ocr); 1109 err = mmc_send_app_op_cond(host, 0, &ocr);
1099 if (err) 1110 if (err)
1100 return err; 1111 return err;