aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/mmp_pdma.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-03-07 11:52:03 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2015-03-07 11:52:03 -0800
commit374dab2366c64666612b8f6275f8c373a373b8d0 (patch)
tree4f6c5ce1f1d18ae0511848920b9a39f12dabe2c2 /drivers/dma/mmp_pdma.c
parentMerge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux (diff)
parentdmaengine: mmp_pdma: fix warning about slave caps (diff)
downloadlinux-dev-374dab2366c64666612b8f6275f8c373a373b8d0.tar.xz
linux-dev-374dab2366c64666612b8f6275f8c373a373b8d0.zip
Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dmaengine fixes from Vinod Koul: "This contains small fixes spread across the drivers" * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma: dmaengine: mmp_pdma: fix warning about slave caps dmaengine: qcom_bam_dma: fix wrong register offsets dmaengine: bam-dma: fix a warning about missing capabilities dmaengine: ioatdma: workaround for incorrect DMACAP register dmaengine: at_xdmac: fix for chan conf simplification dmaengine: dw: don't handle interrupt when dmaengine is not used dma: mmp-tdma: refine dma disable and dma-pos update dmaengine: shdma: Move DMA stop to (runtime) suspend callbacks dmaenegine: mmp-pdma: fix irq handler overwrite physical chan issue
Diffstat (limited to 'drivers/dma/mmp_pdma.c')
-rw-r--r--drivers/dma/mmp_pdma.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
index 8926f271904e..eb410044e1af 100644
--- a/drivers/dma/mmp_pdma.c
+++ b/drivers/dma/mmp_pdma.c
@@ -219,6 +219,9 @@ static irqreturn_t mmp_pdma_int_handler(int irq, void *dev_id)
while (dint) {
i = __ffs(dint);
+ /* only handle interrupts belonging to pdma driver*/
+ if (i >= pdev->dma_channels)
+ break;
dint &= (dint - 1);
phy = &pdev->phy[i];
ret = mmp_pdma_chan_handler(irq, phy);
@@ -999,6 +1002,9 @@ static int mmp_pdma_probe(struct platform_device *op)
struct resource *iores;
int i, ret, irq = 0;
int dma_channels = 0, irq_num = 0;
+ const enum dma_slave_buswidth widths =
+ DMA_SLAVE_BUSWIDTH_1_BYTE | DMA_SLAVE_BUSWIDTH_2_BYTES |
+ DMA_SLAVE_BUSWIDTH_4_BYTES;
pdev = devm_kzalloc(&op->dev, sizeof(*pdev), GFP_KERNEL);
if (!pdev)
@@ -1066,6 +1072,10 @@ static int mmp_pdma_probe(struct platform_device *op)
pdev->device.device_config = mmp_pdma_config;
pdev->device.device_terminate_all = mmp_pdma_terminate_all;
pdev->device.copy_align = PDMA_ALIGNMENT;
+ pdev->device.src_addr_widths = widths;
+ pdev->device.dst_addr_widths = widths;
+ pdev->device.directions = BIT(DMA_MEM_TO_DEV) | BIT(DMA_DEV_TO_MEM);
+ pdev->device.residue_granularity = DMA_RESIDUE_GRANULARITY_DESCRIPTOR;
if (pdev->dev->coherent_dma_mask)
dma_set_mask(pdev->dev, pdev->dev->coherent_dma_mask);