From: Andrei Warkentin Date: Wed, 25 May 2011 14:42:50 +0000 (-0400) Subject: mmc: sdhci: Auto-CMD23 fixes. X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=4f3d3e9b50931a3ec70f324d53fb7437e2a39388;p=openwrt%2Fstaging%2Fblogic.git mmc: sdhci: Auto-CMD23 fixes. Fixes bugs in Auto-CMD23 feature enable decision. Auto-CMD23 should be enabled if host is >= v3, and SDMA is not in use. USE_ADMA | USE_SDMA | Auto-CMD23 ---------+----------+----------- 0 | 0 | 1 ---------+----------+----------- 0 | 1 | 0 ---------+----------+----------- 1 | 0 | 1 ---------+----------+----------- 1 | 1 | 1 Signed-off-by: Andrei Warkentin Signed-off-by: Chris Ball --- diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index f845fd6a64ae..58d5436ff649 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2494,9 +2494,9 @@ int sdhci_add_host(struct sdhci_host *host) host->flags |= SDHCI_AUTO_CMD12; /* Auto-CMD23 stuff only works in ADMA or PIO. */ - if ((host->version == SDHCI_SPEC_300) && + if ((host->version >= SDHCI_SPEC_300) && ((host->flags & SDHCI_USE_ADMA) || - !(host->flags & SDHCI_REQ_USE_DMA))) { + !(host->flags & SDHCI_USE_SDMA))) { host->flags |= SDHCI_AUTO_CMD23; DBG("%s: Auto-CMD23 available\n", mmc_hostname(mmc)); } else {