All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: dw_mmc: dw_mci_get_cd check MMC_CAP_NONREMOVABLE
@ 2015-05-05  8:54 Zhangfei Gao
  2015-05-06  0:36 ` Jaehoon Chung
  0 siblings, 1 reply; 13+ messages in thread
From: Zhangfei Gao @ 2015-05-05  8:54 UTC (permalink / raw)
  To: Jaehoon Chung; +Cc: linux-mmc, Zhangfei Gao

When non-removable is used for emmc,  MMC_CAP_NONREMOVABLE should
also be checked, otherwise detection fail since present=0

Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
---
 drivers/mmc/host/dw_mmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 488a8af..5d327e4 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1308,7 +1308,8 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
 	int gpio_cd = mmc_gpio_get_cd(mmc);
 
 	/* Use platform get_cd function, else try onboard card detect */
-	if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
+	if ((brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) ||
+	    (mmc->caps & MMC_CAP_NONREMOVABLE))
 		present = 1;
 	else if (!IS_ERR_VALUE(gpio_cd))
 		present = gpio_cd;
-- 
1.9.1


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

end of thread, other threads:[~2015-05-06  7:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-05  8:54 [PATCH] mmc: dw_mmc: dw_mci_get_cd check MMC_CAP_NONREMOVABLE Zhangfei Gao
2015-05-06  0:36 ` Jaehoon Chung
2015-05-06  1:14   ` Zhangfei Gao
2015-05-06  1:26     ` Jaehoon Chung
2015-05-06  1:33       ` zhangfei
2015-05-06  1:39         ` Jaehoon Chung
2015-05-06  1:53           ` zhangfei
2015-05-06  2:16           ` zhangfei
2015-05-06  4:21             ` Jaehoon Chung
2015-05-06  5:30               ` zhangfei
2015-05-06  6:13                 ` Jaehoon Chung
2015-05-06  6:30                   ` zhangfei
2015-05-06  7:23                     ` Arnd Bergmann

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.