diff options
author | Stefan Wahren <stefan.wahren@i2se.com> | 2017-01-14 17:29:18 +0000 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2017-02-13 13:20:27 +0100 |
commit | 73a85069f91d35f6921fd9d9b2603f482b9c9bd1 (patch) | |
tree | 534ed96ef549538aa5d28f73cf1cda1e92141897 /drivers/mmc/host/mxs-mmc.c | |
parent | e81c022a00cd91b0d555d9d9194d421e3b8d642c (diff) | |
download | linux-73a85069f91d35f6921fd9d9b2603f482b9c9bd1.tar.gz linux-73a85069f91d35f6921fd9d9b2603f482b9c9bd1.tar.bz2 linux-73a85069f91d35f6921fd9d9b2603f482b9c9bd1.zip |
mmc: mxs-mmc: Implement CMD23 support
This patch implements support for multiblock transfers bounded
by SET_BLOCK_COUNT (CMD23) on the MXS MMC host driver.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/mxs-mmc.c')
-rw-r--r-- | drivers/mmc/host/mxs-mmc.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index c8b8ac66ff7e..add1e70195ea 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c @@ -153,7 +153,11 @@ static void mxs_mmc_request_done(struct mxs_mmc_host *host) } } - if (data) { + if (cmd == mrq->sbc) { + /* Finished CMD23, now send actual command. */ + mxs_mmc_start_cmd(host, mrq->cmd); + return; + } else if (data) { dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, ssp->dma_dir); /* @@ -166,7 +170,7 @@ static void mxs_mmc_request_done(struct mxs_mmc_host *host) data->bytes_xfered = 0; host->data = NULL; - if (mrq->stop) { + if (data->stop && (data->error || !mrq->sbc)) { mxs_mmc_start_cmd(host, mrq->stop); return; } @@ -495,7 +499,11 @@ static void mxs_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) WARN_ON(host->mrq != NULL); host->mrq = mrq; - mxs_mmc_start_cmd(host, mrq->cmd); + + if (mrq->sbc) + mxs_mmc_start_cmd(host, mrq->sbc); + else + mxs_mmc_start_cmd(host, mrq->cmd); } static void mxs_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) @@ -642,7 +650,7 @@ static int mxs_mmc_probe(struct platform_device *pdev) /* set mmc core parameters */ mmc->ops = &mxs_mmc_ops; mmc->caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED | - MMC_CAP_SDIO_IRQ | MMC_CAP_NEEDS_POLL; + MMC_CAP_SDIO_IRQ | MMC_CAP_NEEDS_POLL | MMC_CAP_CMD23; host->broken_cd = of_property_read_bool(np, "broken-cd"); |