summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/mmci_qcom_dml.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2019-03-06 17:04:53 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2019-04-15 12:55:54 +0300
commitea27c95a7a47ae7303b28d2bf2c5db461bb002c6 (patch)
tree40165416119b36d3d5e19f646973a3770701859b /drivers/mmc/host/mmci_qcom_dml.c
parentc21aa7a804160f58e391c9fcb2aff16e7d30c80f (diff)
downloadlinux-ea27c95a7a47ae7303b28d2bf2c5db461bb002c6.tar.xz
mmc: mmci: Re-work code starting DMA for the qcom variant
Having mmci_dmae_start() to invoke the shared function, dml_start_xfer(), explicitly for the qcom variant isn't very nice. Let's clean up this code by moving the qcom specific parts into the qcom ->dma_start() callback and then drop dml_start_xfer() altogether. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/mmc/host/mmci_qcom_dml.c')
-rw-r--r--drivers/mmc/host/mmci_qcom_dml.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mmc/host/mmci_qcom_dml.c b/drivers/mmc/host/mmci_qcom_dml.c
index b942d4aeeb77..ccc1b1809e73 100644
--- a/drivers/mmc/host/mmci_qcom_dml.c
+++ b/drivers/mmc/host/mmci_qcom_dml.c
@@ -54,10 +54,15 @@
#define DML_OFFSET 0x800
-void dml_start_xfer(struct mmci_host *host, struct mmc_data *data)
+static int qcom_dma_start(struct mmci_host *host, unsigned int *datactrl)
{
u32 config;
void __iomem *base = host->base + DML_OFFSET;
+ struct mmc_data *data = host->data;
+ int ret = mmci_dmae_start(host, datactrl);
+
+ if (ret)
+ return ret;
if (data->flags & MMC_DATA_READ) {
/* Read operation: configure DML for producer operation */
@@ -96,6 +101,7 @@ void dml_start_xfer(struct mmci_host *host, struct mmc_data *data)
/* make sure the dml is configured before dma is triggered */
wmb();
+ return 0;
}
static int of_get_dml_pipe_index(struct device_node *np, const char *name)
@@ -188,7 +194,7 @@ static struct mmci_host_ops qcom_variant_ops = {
.get_next_data = mmci_dmae_get_next_data,
.dma_setup = qcom_dma_setup,
.dma_release = mmci_dmae_release,
- .dma_start = mmci_dmae_start,
+ .dma_start = qcom_dma_start,
.dma_finalize = mmci_dmae_finalize,
.dma_error = mmci_dmae_error,
};