From: Stephen Rothwell Date: Mon, 21 Nov 2011 00:08:29 +0000 (+1100) Subject: Merge remote-tracking branch 'slave-dma/next' X-Git-Tag: next-20111121~43 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=01a01f9db7dd061e6ec6ae587deb773d2864e3a0;p=karo-tx-linux.git Merge remote-tracking branch 'slave-dma/next' Conflicts: drivers/dma/pl330.c --- 01a01f9db7dd061e6ec6ae587deb773d2864e3a0 diff --cc arch/arm/plat-samsung/dma-ops.c index 2cded872f22b,1baa8ce82432..0747c77a2fd5 --- a/arch/arm/plat-samsung/dma-ops.c +++ b/arch/arm/plat-samsung/dma-ops.c @@@ -29,15 -34,9 +29,15 @@@ static unsigned samsung_dmadev_request( dma_cap_zero(mask); dma_cap_set(info->cap, mask); - chan = dma_request_channel(mask, pl330_filter, (void *)dma_ch); + /* + * If a dma channel property of a device node from device tree is + * specified, use that as the fliter parameter. + */ + filter_param = (dma_ch == DMACH_DT_PROP) ? (void *)info->dt_dmach_prop : + (void *)dma_ch; + chan = dma_request_channel(mask, pl330_filter, filter_param); - if (info->direction == DMA_FROM_DEVICE) { + if (info->direction == DMA_DEV_TO_MEM) { memset(&slave_config, 0, sizeof(struct dma_slave_config)); slave_config.direction = info->direction; slave_config.src_addr = info->fifo; diff --cc drivers/dma/pl330.c index a626e15799a5,e0da795bdcb3..833254d8a784 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@@ -636,17 -612,15 +636,17 @@@ static struct dma_async_tx_descriptor * } switch (direction) { - case DMA_TO_DEVICE: + case DMA_MEM_TO_DEV: desc->rqcfg.src_inc = 1; desc->rqcfg.dst_inc = 0; + desc->req.rqtype = MEMTODEV; src = dma_addr; dst = pch->fifo_addr; break; - case DMA_FROM_DEVICE: + case DMA_DEV_TO_MEM: desc->rqcfg.src_inc = 0; desc->rqcfg.dst_inc = 1; + desc->req.rqtype = DEVTOMEM; src = pch->fifo_addr; dst = dma_addr; break; @@@ -759,10 -747,9 +759,10 @@@ pl330_prep_slave_sg(struct dma_chan *ch else list_add_tail(&desc->node, &first->node); - if (direction == DMA_TO_DEVICE) { + if (direction == DMA_MEM_TO_DEV) { desc->rqcfg.src_inc = 1; desc->rqcfg.dst_inc = 0; + desc->req.rqtype = MEMTODEV; fill_px(&desc->px, addr, sg_dma_address(sg), sg_dma_len(sg)); } else { @@@ -870,8 -856,8 +870,8 @@@ pl330_probe(struct amba_device *adev, c INIT_LIST_HEAD(&pd->channels); /* Initialize channel parameters */ - num_chan = max(pdat ? pdat->nr_valid_peri : (u8)pi->pcfg.num_peri, - (u8)pi->pcfg.num_chan); - num_chan = max(pdat ? (int)pdat->nr_valid_peri : 0, - (int)pi->pcfg.num_chan); ++ num_chan = max(pdat ? (int)pdat->nr_valid_peri : (int)pi->pcfg.num_peri, ++ (int)pi->pcfg.num_chan); pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL); for (i = 0; i < num_chan; i++) {