mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
mmc: atmel-mci: restore dma on AVR32
Commit ecb89f2f5f ("mmc: atmel-mci: remove compat for non DT board
when requesting dma chan") broke dma on AVR32 and any other boards not
using DT. This restores a fallback mechanism for such cases.
Signed-off-by: Mans Rullgard <[email protected]>
Acked-by: Hans-Christian Noren Egtvedt <[email protected]>
Acked-by: Ludovic Desroches <[email protected]>
Acked-by: Ulf Hansson <[email protected]>
This commit is contained in:
parent
a193f07d1e
commit
7484378715
3 changed files with 35 additions and 0 deletions
|
|
@ -2280,6 +2280,23 @@ static int atmci_configure_dma(struct atmel_mci *host)
|
|||
{
|
||||
host->dma.chan = dma_request_slave_channel_reason(&host->pdev->dev,
|
||||
"rxtx");
|
||||
|
||||
if (PTR_ERR(host->dma.chan) == -ENODEV) {
|
||||
struct mci_platform_data *pdata = host->pdev->dev.platform_data;
|
||||
dma_cap_mask_t mask;
|
||||
|
||||
if (!pdata->dma_filter)
|
||||
return -ENODEV;
|
||||
|
||||
dma_cap_zero(mask);
|
||||
dma_cap_set(DMA_SLAVE, mask);
|
||||
|
||||
host->dma.chan = dma_request_channel(mask, pdata->dma_filter,
|
||||
pdata->dma_slave);
|
||||
if (!host->dma.chan)
|
||||
host->dma.chan = ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
if (IS_ERR(host->dma.chan))
|
||||
return PTR_ERR(host->dma.chan);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue