فهرست منبع

ramips: fix sd polling

This is fixed in 18.06, it appears again in 19.07.
Currently mt7628 sdcard driver do not support polling mode which is for
the device do not have card-detect pin to detect sd card insert. Without
this patch, device will not detect sdcard is inserted. This patch is a
fix of that.

Signed-off-by: Qin Wei <[email protected]>
Qin Wei 5 سال پیش
والد
کامیت
cd6515c2e8
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      target/linux/ramips/files/drivers/mmc/host/mtk-mmc/sd.c

+ 4 - 0
target/linux/ramips/files/drivers/mmc/host/mtk-mmc/sd.c

@@ -439,6 +439,8 @@ static void msdc_tasklet_card(struct work_struct *work)
 		inserted = (status & MSDC_PS_CDSTS) ? 0 : 1;
 	else
 		inserted = (status & MSDC_PS_CDSTS) ? 1 : 0;
+	if (host->mmc->caps & MMC_CAP_NEEDS_POLL)
+		inserted = 1;
 
 #if 0
 	change = host->card_inserted ^ inserted;
@@ -1857,6 +1859,8 @@ static int msdc_ops_get_cd(struct mmc_host *mmc)
 			present = (sdr_read32(MSDC_PS) & MSDC_PS_CDSTS) ? 0 : 1;
 		else
 			present = (sdr_read32(MSDC_PS) & MSDC_PS_CDSTS) ? 1 : 0;
+		if (host->mmc->caps & MMC_CAP_NEEDS_POLL)
+			present = 1;
 		host->card_inserted = present;
 #endif
 		spin_unlock_irqrestore(&host->lock, flags);