@@ -298,20 +298,11 @@ static void mmci_init_sg(struct mmci_host *host, struct mmc_data *data)
* no custom DMA interfaces are supported.
*/
#ifdef CONFIG_DMA_ENGINE
-static void mmci_dma_setup(struct mmci_host *host)
+static int mmci_dma_plat_setup(struct mmci_host *host)
{
struct mmci_platform_data *plat = host->plat;
- const char *rxname, *txname;
dma_cap_mask_t mask;
- if (!plat || !plat->dma_filter) {
- dev_info(mmc_dev(host->mmc), "no DMA platform data\n");
- return;
- }
-
- /* initialize pre request cookie */
- host->next_data.cookie = 1;
-
/* Try to acquire a generic DMA engine slave channel */
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
@@ -339,6 +330,25 @@ static void mmci_dma_setup(struct mmci_host *host)
} else {
host->dma_tx_channel = host->dma_rx_channel;
}
+}
+
+static void mmci_dma_setup(struct device *dev, struct mmci_host *host)
+{
+ const char *rxname, *txname;
+
+ host->dma_rx_channel = dma_request_slave_channel(dev, "rx");
+ host->dma_tx_channel = dma_request_slave_channel(dev, "tx");
+
+ if (!host->dma_rx_channel && !host->dma_tx_channel) {
+ if (host->plat && host->plat->dma_filter)
+ mmci_dma_plat_setup(host);
+ else
+ dev_info(mmc_dev(host->mmc), "no DMA platform data\n");
+ return;
+ }
+
+ /* initialize pre request cookie */
+ host->next_data.cookie = 1;
if (host->dma_rx_channel)
rxname = dma_chan_name(host->dma_rx_channel);