History

mmc: sdhci-pci-o2micro: Fix card detect by dealing with debouncing

The result from ->get_cd() may be incorrect as the card detect debouncing isn't managed correctly. Let's fix it.

Chevron Li committed 4 years ago

Commit e591fcf1 parent b13bacc1 file · +2 −0Browse files

Unified · Split

drivers/mmc/host/sdhci-pci-o2micro.c+2−0
@@ -152,6 +152,8 @@ static int sdhci_o2_get_cd(struct mmc_host *mmc) · 151 unmodified lines
152 152
153 if (!(sdhci_readw(host, O2_PLL_DLL_WDT_CONTROL1) & O2_PLL_LOCK_STATUS))153 if (!(sdhci_readw(host, O2_PLL_DLL_WDT_CONTROL1) & O2_PLL_LOCK_STATUS))
154 sdhci_o2_enable_internal_clock(host);154 sdhci_o2_enable_internal_clock(host);
155 else
156 sdhci_o2_wait_card_detect_stable(host);
155 157
156 return !!(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT);158 return !!(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT);
157}159}