diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2019-03-06 09:04:53 -0500 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2019-04-15 05:55:54 -0400 |
commit | ea27c95a7a47ae7303b28d2bf2c5db461bb002c6 (patch) | |
tree | 40165416119b36d3d5e19f646973a3770701859b | |
parent | c21aa7a804160f58e391c9fcb2aff16e7d30c80f (diff) |
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>
-rw-r--r-- | drivers/mmc/host/mmci.c | 4 | ||||
-rw-r--r-- | drivers/mmc/host/mmci_qcom_dml.c | 10 | ||||
-rw-r--r-- | drivers/mmc/host/mmci_qcom_dml.h | 4 |
3 files changed, 8 insertions, 10 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 387ff14587b8..3e5baafb0ce2 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -886,15 +886,11 @@ int mmci_dmae_prep_data(struct mmci_host *host, | |||
886 | int mmci_dmae_start(struct mmci_host *host, unsigned int *datactrl) | 886 | int mmci_dmae_start(struct mmci_host *host, unsigned int *datactrl) |
887 | { | 887 | { |
888 | struct mmci_dmae_priv *dmae = host->dma_priv; | 888 | struct mmci_dmae_priv *dmae = host->dma_priv; |
889 | struct mmc_data *data = host->data; | ||
890 | 889 | ||
891 | host->dma_in_progress = true; | 890 | host->dma_in_progress = true; |
892 | dmaengine_submit(dmae->desc_current); | 891 | dmaengine_submit(dmae->desc_current); |
893 | dma_async_issue_pending(dmae->cur); | 892 | dma_async_issue_pending(dmae->cur); |
894 | 893 | ||
895 | if (host->variant->qcom_dml) | ||
896 | dml_start_xfer(host, data); | ||
897 | |||
898 | *datactrl |= MCI_DPSM_DMAENABLE; | 894 | *datactrl |= MCI_DPSM_DMAENABLE; |
899 | 895 | ||
900 | return 0; | 896 | return 0; |
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 @@ | |||
54 | 54 | ||
55 | #define DML_OFFSET 0x800 | 55 | #define DML_OFFSET 0x800 |
56 | 56 | ||
57 | void dml_start_xfer(struct mmci_host *host, struct mmc_data *data) | 57 | static int qcom_dma_start(struct mmci_host *host, unsigned int *datactrl) |
58 | { | 58 | { |
59 | u32 config; | 59 | u32 config; |
60 | void __iomem *base = host->base + DML_OFFSET; | 60 | void __iomem *base = host->base + DML_OFFSET; |
61 | struct mmc_data *data = host->data; | ||
62 | int ret = mmci_dmae_start(host, datactrl); | ||
63 | |||
64 | if (ret) | ||
65 | return ret; | ||
61 | 66 | ||
62 | if (data->flags & MMC_DATA_READ) { | 67 | if (data->flags & MMC_DATA_READ) { |
63 | /* Read operation: configure DML for producer operation */ | 68 | /* Read operation: configure DML for producer operation */ |
@@ -96,6 +101,7 @@ void dml_start_xfer(struct mmci_host *host, struct mmc_data *data) | |||
96 | 101 | ||
97 | /* make sure the dml is configured before dma is triggered */ | 102 | /* make sure the dml is configured before dma is triggered */ |
98 | wmb(); | 103 | wmb(); |
104 | return 0; | ||
99 | } | 105 | } |
100 | 106 | ||
101 | static int of_get_dml_pipe_index(struct device_node *np, const char *name) | 107 | 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 = { | |||
188 | .get_next_data = mmci_dmae_get_next_data, | 194 | .get_next_data = mmci_dmae_get_next_data, |
189 | .dma_setup = qcom_dma_setup, | 195 | .dma_setup = qcom_dma_setup, |
190 | .dma_release = mmci_dmae_release, | 196 | .dma_release = mmci_dmae_release, |
191 | .dma_start = mmci_dmae_start, | 197 | .dma_start = qcom_dma_start, |
192 | .dma_finalize = mmci_dmae_finalize, | 198 | .dma_finalize = mmci_dmae_finalize, |
193 | .dma_error = mmci_dmae_error, | 199 | .dma_error = mmci_dmae_error, |
194 | }; | 200 | }; |
diff --git a/drivers/mmc/host/mmci_qcom_dml.h b/drivers/mmc/host/mmci_qcom_dml.h index fa16f6f4d4ad..7e87eb9c4238 100644 --- a/drivers/mmc/host/mmci_qcom_dml.h +++ b/drivers/mmc/host/mmci_qcom_dml.h | |||
@@ -17,14 +17,10 @@ | |||
17 | 17 | ||
18 | #ifdef CONFIG_MMC_QCOM_DML | 18 | #ifdef CONFIG_MMC_QCOM_DML |
19 | void qcom_variant_init(struct mmci_host *host); | 19 | void qcom_variant_init(struct mmci_host *host); |
20 | void dml_start_xfer(struct mmci_host *host, struct mmc_data *data); | ||
21 | #else | 20 | #else |
22 | static inline void qcom_variant_init(struct mmci_host *host) | 21 | static inline void qcom_variant_init(struct mmci_host *host) |
23 | { | 22 | { |
24 | } | 23 | } |
25 | static inline void dml_start_xfer(struct mmci_host *host, struct mmc_data *data) | ||
26 | { | ||
27 | } | ||
28 | #endif /* CONFIG_MMC_QCOM_DML */ | 24 | #endif /* CONFIG_MMC_QCOM_DML */ |
29 | 25 | ||
30 | #endif /* __MMC_QCOM_DML_H__ */ | 26 | #endif /* __MMC_QCOM_DML_H__ */ |