[U-Boot] [PATCH] tegra2: mmc: Enable card-detect for all interfaces.

Thierry Reding thierry.reding at avionic-design.de
Mon Nov 21 09:35:35 CET 2011


This commit drops the interface check for card-detection and leaves it
up to the board whether or not a card-detect GPIO is connected. Also,
the version field of struct mmc is only valid after the slot has been
probed successfully, so depending on that information sort of defeats
the purpose of card-detection.

Signed-off-by: Thierry Reding <thierry.reding at avionic-design.de>
---
 drivers/mmc/tegra2_mmc.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/tegra2_mmc.c b/drivers/mmc/tegra2_mmc.c
index 035a868..fe562ed 100644
--- a/drivers/mmc/tegra2_mmc.c
+++ b/drivers/mmc/tegra2_mmc.c
@@ -543,14 +543,10 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc)
 
 	debug("board_mmc_getcd called\n");
 
-	*cd = 1; /* Assume card is inserted, or eMMC */
-
-	if (IS_SD(mmc)) {
-		if (host->cd_gpio >= 0) {
-			if (gpio_get_value(host->cd_gpio))
-				*cd = 0;
-		}
-	}
+	if (host->cd_gpio >= 0)
+		*cd = !gpio_get_value(host->cd_gpio);
+	else
+		*cd = 1;
 
 	return 0;
 }
-- 
1.7.7.3



More information about the U-Boot mailing list