All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] mmd: sdhci: fix non GPIO card detect
@ 2019-07-22 17:08 Baruch Siach
  2019-07-23  8:00 ` Peng Fan
  0 siblings, 1 reply; 10+ messages in thread
From: Baruch Siach @ 2019-07-22 17:08 UTC (permalink / raw)
  To: u-boot

Some SD cards do not assert the SDHCI_CARD_PRESENT bit. Only the
SDHCI_CARD_DETECT_PIN_LEVEL is enabled. Consider that enough for card
detect indication.

This fixes SD card access from SPL, since DM_GPIO is not available in
SPL code.

Fixes: da18c62b6e6a ("mmc: sdhci: Implement SDHCI card detect")
Cc: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 drivers/mmc/sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 2779bca93f08..17a28181fcca 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -683,7 +683,7 @@ int sdhci_get_cd(struct udevice *dev)
 	}
 #endif
 	value = !!(sdhci_readl(host, SDHCI_PRESENT_STATE) &
-		   SDHCI_CARD_PRESENT);
+		   (SDHCI_CARD_PRESENT | SDHCI_CARD_DETECT_PIN_LEVEL));
 	if (mmc->cfg->host_caps & MMC_CAP_CD_ACTIVE_HIGH)
 		return !value;
 	else
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-07-24  4:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22 17:08 [U-Boot] [PATCH] mmd: sdhci: fix non GPIO card detect Baruch Siach
2019-07-23  8:00 ` Peng Fan
2019-07-23  8:57   ` Faiz Abbas
2019-07-23  9:09     ` Baruch Siach
2019-07-23 10:05       ` Faiz Abbas
2019-07-23 10:46         ` Baruch Siach
2019-07-23 11:17           ` Faiz Abbas
2019-07-23 13:45             ` Baruch Siach
2019-07-24  1:17               ` Peng Fan
2019-07-24  4:11                 ` Baruch Siach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.