aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/mmc.c
diff options
context:
space:
mode:
authorStefan Nilsson XK <stefan.xk.nilsson@stericsson.com>2011-09-15 11:50:38 -0400
committerChris Ball <cjb@laptop.org>2011-10-26 16:32:03 -0400
commit44669034815a7ad263542ac605c581a10b22d146 (patch)
treee11820c9044f92a85d0efbb752f35673d92b20fc /drivers/mmc/core/mmc.c
parent9a0da648ff3a5020406ac7784eb3b519014f66f6 (diff)
mmc: core: Set correct bus mode before card init
Earlier all cards where initiated with bus mode set as OPENDRAIN, and then later switched to PUSHPULL. According to the MMC/SD/SDIO specifications only MMC cards use OPENDRAIN during init. For both SD and SDIO the bus mode shall be PUSHPULL before attempting to init the card. The consequence of having incorrect bus mode can lead to not being able to detect the card. Therefore the default behavior have now been changed to PUSHPULL in mmc_power_up, and will only be temporarily switched when trying to attach or init a MMC card. Signed-off-by: Stefan Nilsson XK <stefan.xk.nilsson@stericsson.com> Signed-off-by: Ulf HANSSON <ulf.hansson@stericsson.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core/mmc.c')
-rw-r--r--drivers/mmc/core/mmc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 3b7c069a4ea6..b74e6f14b3ac 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -548,6 +548,10 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
548 BUG_ON(!host); 548 BUG_ON(!host);
549 WARN_ON(!host->claimed); 549 WARN_ON(!host->claimed);
550 550
551 /* Set correct bus mode for MMC before attempting init */
552 if (!mmc_host_is_spi(host))
553 mmc_set_bus_mode(host, MMC_BUSMODE_OPENDRAIN);
554
551 /* 555 /*
552 * Since we're changing the OCR value, we seem to 556 * Since we're changing the OCR value, we seem to
553 * need to tell some cards to go back to the idle 557 * need to tell some cards to go back to the idle
@@ -1022,6 +1026,10 @@ int mmc_attach_mmc(struct mmc_host *host)
1022 BUG_ON(!host); 1026 BUG_ON(!host);
1023 WARN_ON(!host->claimed); 1027 WARN_ON(!host->claimed);
1024 1028
1029 /* Set correct bus mode for MMC before attempting attach */
1030 if (!mmc_host_is_spi(host))
1031 mmc_set_bus_mode(host, MMC_BUSMODE_OPENDRAIN);
1032
1025 err = mmc_send_op_cond(host, 0, &ocr); 1033 err = mmc_send_op_cond(host, 0, &ocr);
1026 if (err) 1034 if (err)
1027 return err; 1035 return err;