diff options
author | Andrei Warkentin <andreiw@motorola.com> | 2011-05-23 16:06:39 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-05-25 16:51:40 -0400 |
commit | 8edf63710bd43e62d59bfe017df542fa0713bbb3 (patch) | |
tree | 98641f28d6d3ce2ca5c021de20f8dec35fb8affe /drivers/mmc/host/sdhci.c | |
parent | f0d89972b01798cf9d245dfa1cacfa0ee78a3593 (diff) |
mmc: sdhci: Auto-CMD23 support.
Enables Auto-CMD23 support where available (SDHCI 3.0 controllers)
Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
Tested-by: Arindam Nath <arindam.nath@amd.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index b9ed66307ac3..f845fd6a64ae 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -857,7 +857,12 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host, | |||
857 | */ | 857 | */ |
858 | if (!host->mrq->sbc && (host->flags & SDHCI_AUTO_CMD12)) | 858 | if (!host->mrq->sbc && (host->flags & SDHCI_AUTO_CMD12)) |
859 | mode |= SDHCI_TRNS_AUTO_CMD12; | 859 | mode |= SDHCI_TRNS_AUTO_CMD12; |
860 | else if (host->mrq->sbc && (host->flags & SDHCI_AUTO_CMD23)) { | ||
861 | mode |= SDHCI_TRNS_AUTO_CMD23; | ||
862 | sdhci_writel(host, host->mrq->sbc->arg, SDHCI_ARGUMENT2); | ||
863 | } | ||
860 | } | 864 | } |
865 | |||
861 | if (data->flags & MMC_DATA_READ) | 866 | if (data->flags & MMC_DATA_READ) |
862 | mode |= SDHCI_TRNS_READ; | 867 | mode |= SDHCI_TRNS_READ; |
863 | if (host->flags & SDHCI_REQ_USE_DMA) | 868 | if (host->flags & SDHCI_REQ_USE_DMA) |
@@ -1252,7 +1257,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) | |||
1252 | host->mrq = mrq; | 1257 | host->mrq = mrq; |
1253 | } | 1258 | } |
1254 | 1259 | ||
1255 | if (mrq->sbc) | 1260 | if (mrq->sbc && !(host->flags & SDHCI_AUTO_CMD23)) |
1256 | sdhci_send_command(host, mrq->sbc); | 1261 | sdhci_send_command(host, mrq->sbc); |
1257 | else | 1262 | else |
1258 | sdhci_send_command(host, mrq->cmd); | 1263 | sdhci_send_command(host, mrq->cmd); |
@@ -2488,6 +2493,16 @@ int sdhci_add_host(struct sdhci_host *host) | |||
2488 | if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12) | 2493 | if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12) |
2489 | host->flags |= SDHCI_AUTO_CMD12; | 2494 | host->flags |= SDHCI_AUTO_CMD12; |
2490 | 2495 | ||
2496 | /* Auto-CMD23 stuff only works in ADMA or PIO. */ | ||
2497 | if ((host->version == SDHCI_SPEC_300) && | ||
2498 | ((host->flags & SDHCI_USE_ADMA) || | ||
2499 | !(host->flags & SDHCI_REQ_USE_DMA))) { | ||
2500 | host->flags |= SDHCI_AUTO_CMD23; | ||
2501 | DBG("%s: Auto-CMD23 available\n", mmc_hostname(mmc)); | ||
2502 | } else { | ||
2503 | DBG("%s: Auto-CMD23 unavailable\n", mmc_hostname(mmc)); | ||
2504 | } | ||
2505 | |||
2491 | /* | 2506 | /* |
2492 | * A controller may support 8-bit width, but the board itself | 2507 | * A controller may support 8-bit width, but the board itself |
2493 | * might not have the pins brought out. Boards that support | 2508 | * might not have the pins brought out. Boards that support |