diff options
author | Qin Wie <me@vonger.cn> | 2017-08-01 14:26:49 +0800 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2017-08-04 23:13:18 +0200 |
commit | de350550ef648d9728351b986b0516fa29465c45 (patch) | |
tree | b4e56e27277a4bce47436e92cbd35ed77b19007e /target/linux | |
parent | c31f0421ceb47f347ade7317f263fcd09cfe325f (diff) | |
download | upstream-de350550ef648d9728351b986b0516fa29465c45.tar.gz upstream-de350550ef648d9728351b986b0516fa29465c45.tar.bz2 upstream-de350550ef648d9728351b986b0516fa29465c45.zip |
ramips: fix cd-poll sd card remove randomly
Fix when add 'mediatek,cd-poll' to dts cause the sd card be removed randomly.
Special for the device without card-detect pin.
Signed-off-by: Qin Wie <me@vonger.cn>
Diffstat (limited to 'target/linux')
-rw-r--r-- | target/linux/ramips/patches-4.9/0046-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/target/linux/ramips/patches-4.9/0046-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch b/target/linux/ramips/patches-4.9/0046-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch index 29ec3b7e1e..dc55967b64 100644 --- a/target/linux/ramips/patches-4.9/0046-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch +++ b/target/linux/ramips/patches-4.9/0046-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch @@ -2345,6 +2345,8 @@ Signed-off-by: John Crispin <blogic@openwrt.org> + 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; @@ -4092,6 +4094,8 @@ Signed-off-by: John Crispin <blogic@openwrt.org> + 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); |