From: Andy Shevchenko Date: Mon, 15 Jul 2013 12:04:39 +0000 (+0300) Subject: dma: dw: allow shared interrupts X-Git-Tag: next-20130731~65^2~1^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6da65e8963a69e706c84117db7869ae6c59ae073;p=karo-tx-linux.git dma: dw: allow shared interrupts In the PC world is quite possible that devices are sharing the same interrupt line. The patch prepares dw_dmac driver to such cases. Signed-off-by: Andy Shevchenko Acked-by: Viresh Kumar Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c index 1ed9a9c9194a..6932645ca1f8 100644 --- a/drivers/dma/dw/core.c +++ b/drivers/dma/dw/core.c @@ -650,10 +650,13 @@ static void dw_dma_tasklet(unsigned long data) static irqreturn_t dw_dma_interrupt(int irq, void *dev_id) { struct dw_dma *dw = dev_id; - u32 status; + u32 status = dma_readl(dw, STATUS_INT); - dev_vdbg(dw->dma.dev, "%s: status=0x%x\n", __func__, - dma_readl(dw, STATUS_INT)); + dev_vdbg(dw->dma.dev, "%s: status=0x%x\n", __func__, status); + + /* Check if we have any interrupt from the DMAC */ + if (!status) + return IRQ_NONE; /* * Just disable the interrupts. We'll turn them back on in the @@ -1566,8 +1569,8 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata) /* Disable BLOCK interrupts as well */ channel_clear_bit(dw, MASK.BLOCK, dw->all_chan_mask); - err = devm_request_irq(chip->dev, chip->irq, dw_dma_interrupt, 0, - "dw_dmac", dw); + err = devm_request_irq(chip->dev, chip->irq, dw_dma_interrupt, + IRQF_SHARED, "dw_dmac", dw); if (err) return err;