summaryrefslogtreecommitdiff
path: root/drivers/mmc/sdhci.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-08-25 16:07:34 +0900
committerJaehoon Chung <jh80.chung@samsung.com>2016-09-20 06:46:01 +0900
commit8d549b61dc1b3a99a47738bd258813d336f6475b (patch)
treed9bb9b16bdce22ba3232a32dc9102dec06c2037a /drivers/mmc/sdhci.c
parent9b1b6d42256a4c2e59c803afdbf90d39371e61ba (diff)
mmc: sdhci: move sdhci_reset() call to sdhci_init()
If CONFIG_BLK is enabled, add_sdhci() is never called. So, sdhci_reset() is not called, either. This is a problem for my board as it needs the reset to start from a sane state. Move the add_sdhci() call to sdhci_init(), which is visited by both of the with/without CONFIG_BLK cases. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'drivers/mmc/sdhci.c')
-rw-r--r--drivers/mmc/sdhci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 7ddb549e03..91cc8b22da 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -451,6 +451,8 @@ static int sdhci_init(struct mmc *mmc)
{
struct sdhci_host *host = mmc->priv;
+ sdhci_reset(host, SDHCI_RESET_ALL);
+
if ((host->quirks & SDHCI_QUIRK_32BIT_DMA_ADDR) && !aligned_buffer) {
aligned_buffer = memalign(8, 512*1024);
if (!aligned_buffer) {
@@ -595,8 +597,6 @@ int add_sdhci(struct sdhci_host *host, u32 max_clk, u32 min_clk)
if (host->quirks & SDHCI_QUIRK_BROKEN_VOLTAGE)
host->cfg.voltages |= host->voltages;
- sdhci_reset(host, SDHCI_RESET_ALL);
-
host->mmc = mmc_create(&host->cfg, host);
if (host->mmc == NULL) {
printf("%s: mmc create fail!\n", __func__);