aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorQin Wei <support@vocore.io>2020-05-16 15:51:36 +0800
committerHauke Mehrtens <hauke@hauke-m.de>2020-06-27 00:19:13 +0200
commitcd6515c2e87b85bb3796ba365db34b3c52a251d5 (patch)
treeb20e71ddb72d5f9e67ab95cae1ea130a91dec051 /target
parentdd13add3ceed9056b0b3cce182241ba553ed07cb (diff)
downloadupstream-cd6515c2e87b85bb3796ba365db34b3c52a251d5.tar.gz
upstream-cd6515c2e87b85bb3796ba365db34b3c52a251d5.tar.bz2
upstream-cd6515c2e87b85bb3796ba365db34b3c52a251d5.zip
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 <support@vocore.io>
Diffstat (limited to 'target')
-rw-r--r--target/linux/ramips/files/drivers/mmc/host/mtk-mmc/sd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/target/linux/ramips/files/drivers/mmc/host/mtk-mmc/sd.c b/target/linux/ramips/files/drivers/mmc/host/mtk-mmc/sd.c
index 8cbc87da3a..188e015572 100644
--- a/target/linux/ramips/files/drivers/mmc/host/mtk-mmc/sd.c
+++ b/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);