Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dma: pl330: Support per channel irq allocation

Some pl330 have per channel irq and it is necessary
to allocate all of them. Loop over irq assigned for this
device to support these pl330 IPs.

For example this IP is available on Xilinx Zynq platform.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Tested-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>

authored by

Michal Simek and committed by
Vinod Koul
e98b3caf 20a90b0e

+12 -5
+12 -5
drivers/dma/pl330.c
··· 2922 2922 2923 2923 amba_set_drvdata(adev, pdmac); 2924 2924 2925 - irq = adev->irq[0]; 2926 - ret = devm_request_irq(&adev->dev, irq, pl330_irq_handler, 0, 2927 - dev_name(&adev->dev), pi); 2928 - if (ret) 2929 - return ret; 2925 + for (i = 0; i <= AMBA_NR_IRQS; i++) { 2926 + irq = adev->irq[i]; 2927 + if (irq) { 2928 + ret = devm_request_irq(&adev->dev, irq, 2929 + pl330_irq_handler, 0, 2930 + dev_name(&adev->dev), pi); 2931 + if (ret) 2932 + return ret; 2933 + } else { 2934 + break; 2935 + } 2936 + } 2930 2937 2931 2938 pi->pcfg.periph_id = adev->periphid; 2932 2939 ret = pl330_add(pi);