aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/mmci.c
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2013-05-03 07:51:17 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-05-22 19:07:04 -0400
commit1fd83f0ecf87e33ab560e8229842cf10f91552ee (patch)
tree4845ec516329e4d376cc9ef85803614b0a319810 /drivers/mmc/host/mmci.c
parent024629c62ffc25f267d57bf588cc10c96ccc0ce5 (diff)
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: Lee Jones <lee.jones@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mmc/host/mmci.c')
-rw-r--r--drivers/mmc/host/mmci.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 9df8b84145b1..c6d8b6216069 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -310,10 +310,8 @@ static void mmci_dma_setup(struct mmci_host *host)
310 const char *rxname, *txname; 310 const char *rxname, *txname;
311 dma_cap_mask_t mask; 311 dma_cap_mask_t mask;
312 312
313 if (!plat || !plat->dma_filter) { 313 host->dma_rx_channel = dma_request_slave_channel(mmc_dev(host->mmc), "rx");
314 dev_info(mmc_dev(host->mmc), "no DMA platform data\n"); 314 host->dma_tx_channel = dma_request_slave_channel(mmc_dev(host->mmc), "tx");
315 return;
316 }
317 315
318 /* initialize pre request cookie */ 316 /* initialize pre request cookie */
319 host->next_data.cookie = 1; 317 host->next_data.cookie = 1;
@@ -322,30 +320,33 @@ static void mmci_dma_setup(struct mmci_host *host)
322 dma_cap_zero(mask); 320 dma_cap_zero(mask);
323 dma_cap_set(DMA_SLAVE, mask); 321 dma_cap_set(DMA_SLAVE, mask);
324 322
325 /* 323 if (plat && plat->dma_filter) {
326 * If only an RX channel is specified, the driver will 324 if (!host->dma_rx_channel && plat->dma_rx_param) {
327 * attempt to use it bidirectionally, however if it is 325 host->dma_rx_channel = dma_request_channel(mask,
328 * is specified but cannot be located, DMA will be disabled.
329 */
330 if (plat->dma_rx_param) {
331 host->dma_rx_channel = dma_request_channel(mask,
332 plat->dma_filter, 326 plat->dma_filter,
333 plat->dma_rx_param); 327 plat->dma_rx_param);
334 /* E.g if no DMA hardware is present */ 328 /* E.g if no DMA hardware is present */
335 if (!host->dma_rx_channel) 329 if (!host->dma_rx_channel)
336 dev_err(mmc_dev(host->mmc), "no RX DMA channel\n"); 330 dev_err(mmc_dev(host->mmc), "no RX DMA channel\n");
337 } 331 }
338 332
339 if (plat->dma_tx_param) { 333 if (!host->dma_tx_channel && plat->dma_tx_param) {
340 host->dma_tx_channel = dma_request_channel(mask, 334 host->dma_tx_channel = dma_request_channel(mask,
341 plat->dma_filter, 335 plat->dma_filter,
342 plat->dma_tx_param); 336 plat->dma_tx_param);
343 if (!host->dma_tx_channel) 337 if (!host->dma_tx_channel)
344 dev_warn(mmc_dev(host->mmc), "no TX DMA channel\n"); 338 dev_warn(mmc_dev(host->mmc), "no TX DMA channel\n");
345 } else { 339 }
346 host->dma_tx_channel = host->dma_rx_channel;
347 } 340 }
348 341
342 /*
343 * If only an RX channel is specified, the driver will
344 * attempt to use it bidirectionally, however if it is
345 * is specified but cannot be located, DMA will be disabled.
346 */
347 if (host->dma_rx_channel && !host->dma_tx_channel)
348 host->dma_tx_channel = host->dma_rx_channel;
349
349 if (host->dma_rx_channel) 350 if (host->dma_rx_channel)
350 rxname = dma_chan_name(host->dma_rx_channel); 351 rxname = dma_chan_name(host->dma_rx_channel);
351 else 352 else