Commit 1fd83f0e authored by Lee Jones's avatar Lee Jones Committed by Russell King

ARM: 7713/1: mmc: mmci: Allow MMCI to request channels with information acquired from DT

Currently, if DMA information isn't passed from platform data, then DMA
will not be used. This patch allows DMA information obtained though Device
Tree to be used as well.

Cc: Chris Ball <cjb@laptop.org>
Cc: linux-mmc@vger.kernel.org
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 024629c6
...@@ -310,10 +310,8 @@ static void mmci_dma_setup(struct mmci_host *host) ...@@ -310,10 +310,8 @@ static void mmci_dma_setup(struct mmci_host *host)
const char *rxname, *txname; const char *rxname, *txname;
dma_cap_mask_t mask; dma_cap_mask_t mask;
if (!plat || !plat->dma_filter) { host->dma_rx_channel = dma_request_slave_channel(mmc_dev(host->mmc), "rx");
dev_info(mmc_dev(host->mmc), "no DMA platform data\n"); host->dma_tx_channel = dma_request_slave_channel(mmc_dev(host->mmc), "tx");
return;
}
/* initialize pre request cookie */ /* initialize pre request cookie */
host->next_data.cookie = 1; host->next_data.cookie = 1;
...@@ -322,30 +320,33 @@ static void mmci_dma_setup(struct mmci_host *host) ...@@ -322,30 +320,33 @@ static void mmci_dma_setup(struct mmci_host *host)
dma_cap_zero(mask); dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask); dma_cap_set(DMA_SLAVE, mask);
/* if (plat && plat->dma_filter) {
* If only an RX channel is specified, the driver will if (!host->dma_rx_channel && plat->dma_rx_param) {
* attempt to use it bidirectionally, however if it is host->dma_rx_channel = dma_request_channel(mask,
* is specified but cannot be located, DMA will be disabled.
*/
if (plat->dma_rx_param) {
host->dma_rx_channel = dma_request_channel(mask,
plat->dma_filter, plat->dma_filter,
plat->dma_rx_param); plat->dma_rx_param);
/* E.g if no DMA hardware is present */ /* E.g if no DMA hardware is present */
if (!host->dma_rx_channel) if (!host->dma_rx_channel)
dev_err(mmc_dev(host->mmc), "no RX DMA channel\n"); dev_err(mmc_dev(host->mmc), "no RX DMA channel\n");
} }
if (plat->dma_tx_param) { if (!host->dma_tx_channel && plat->dma_tx_param) {
host->dma_tx_channel = dma_request_channel(mask, host->dma_tx_channel = dma_request_channel(mask,
plat->dma_filter, plat->dma_filter,
plat->dma_tx_param); plat->dma_tx_param);
if (!host->dma_tx_channel) if (!host->dma_tx_channel)
dev_warn(mmc_dev(host->mmc), "no TX DMA channel\n"); dev_warn(mmc_dev(host->mmc), "no TX DMA channel\n");
} else { }
host->dma_tx_channel = host->dma_rx_channel;
} }
/*
* If only an RX channel is specified, the driver will
* attempt to use it bidirectionally, however if it is
* is specified but cannot be located, DMA will be disabled.
*/
if (host->dma_rx_channel && !host->dma_tx_channel)
host->dma_tx_channel = host->dma_rx_channel;
if (host->dma_rx_channel) if (host->dma_rx_channel)
rxname = dma_chan_name(host->dma_rx_channel); rxname = dma_chan_name(host->dma_rx_channel);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment