aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/mach-at32ap/at32ap700x.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/avr32/mach-at32ap/at32ap700x.c')
-rw-r--r--arch/avr32/mach-at32ap/at32ap700x.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index b4cb3bd89d8a..bf445aa48282 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -17,7 +17,6 @@
17#include <linux/spi/spi.h> 17#include <linux/spi/spi.h>
18#include <linux/usb/atmel_usba_udc.h> 18#include <linux/usb/atmel_usba_udc.h>
19 19
20#include <linux/platform_data/mmc-atmel-mci.h>
21#include <linux/atmel-mci.h> 20#include <linux/atmel-mci.h>
22 21
23#include <asm/io.h> 22#include <asm/io.h>
@@ -1321,11 +1320,26 @@ static struct clk atmel_mci0_pclk = {
1321 .index = 9, 1320 .index = 9,
1322}; 1321};
1323 1322
1323static bool at32_mci_dma_filter(struct dma_chan *chan, void *pdata)
1324{
1325 struct dw_dma_slave *sl = pdata;
1326
1327 if (!sl)
1328 return false;
1329
1330 if (sl->dma_dev == chan->device->dev) {
1331 chan->private = sl;
1332 return true;
1333 }
1334
1335 return false;
1336}
1337
1324struct platform_device *__init 1338struct platform_device *__init
1325at32_add_device_mci(unsigned int id, struct mci_platform_data *data) 1339at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
1326{ 1340{
1327 struct platform_device *pdev; 1341 struct platform_device *pdev;
1328 struct mci_dma_data *slave; 1342 struct dw_dma_slave *slave;
1329 u32 pioa_mask; 1343 u32 pioa_mask;
1330 u32 piob_mask; 1344 u32 piob_mask;
1331 1345
@@ -1344,17 +1358,18 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
1344 ARRAY_SIZE(atmel_mci0_resource))) 1358 ARRAY_SIZE(atmel_mci0_resource)))
1345 goto fail; 1359 goto fail;
1346 1360
1347 slave = kzalloc(sizeof(struct mci_dma_data), GFP_KERNEL); 1361 slave = kzalloc(sizeof(*slave), GFP_KERNEL);
1348 if (!slave) 1362 if (!slave)
1349 goto fail; 1363 goto fail;
1350 1364
1351 slave->sdata.dma_dev = &dw_dmac0_device.dev; 1365 slave->dma_dev = &dw_dmac0_device.dev;
1352 slave->sdata.src_id = 0; 1366 slave->src_id = 0;
1353 slave->sdata.dst_id = 1; 1367 slave->dst_id = 1;
1354 slave->sdata.src_master = 1; 1368 slave->src_master = 1;
1355 slave->sdata.dst_master = 0; 1369 slave->dst_master = 0;
1356 1370
1357 data->dma_slave = slave; 1371 data->dma_slave = slave;
1372 data->dma_filter = at32_mci_dma_filter;
1358 1373
1359 if (platform_device_add_data(pdev, data, 1374 if (platform_device_add_data(pdev, data,
1360 sizeof(struct mci_platform_data))) 1375 sizeof(struct mci_platform_data)))