[Sound-open-firmware] [PATCH 2/2] cnl: dma: refine dma interrupt processing on cnl

Rander Wang rander.wang at linux.intel.com
Tue Mar 6 06:26:24 CET 2018


On cnl, all the dma share the same interrupt pin, so
all the dma controller need to be checked in interrupt
function.

Signed-off-by: Rander Wang <rander.wang at linux.intel.com>
---
 src/drivers/dw-dma.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/src/drivers/dw-dma.c b/src/drivers/dw-dma.c
index f736679..a06087e 100644
--- a/src/drivers/dw-dma.c
+++ b/src/drivers/dw-dma.c
@@ -1136,6 +1136,26 @@ static void dw_dma_irq_handler(void *data)
 	}
 }
 
+/*All the dma share the same interrupt on CNL, so check each dma*/
+/*controller when interrupt coming, then do the work            */
+static void dw_dma_irq_cnl(void *data)
+{
+	struct dma *dma;
+	uint32_t status_intr;
+
+	/*check interrupt status of DMA controller 0*/
+	dma = dma_get(DMA_GP_LP_DMAC0);
+	status_intr = dw_read(dma, DW_INTR_STATUS);
+	if (status_intr)
+		dw_dma_irq_handler(dma);
+
+	/*check interrupt status of DMA controller 1*/
+	dma = dma_get(DMA_GP_LP_DMAC1);
+	status_intr = dw_read(dma, DW_INTR_STATUS);
+	if (status_intr)
+		dw_dma_irq_handler(dma);
+}
+
 static int dw_dma_probe(struct dma *dma)
 {
 	struct dma_pdata *dw_pdata;
@@ -1157,7 +1177,11 @@ static int dw_dma_probe(struct dma *dma)
 	}
 
 	/* register our IRQ handler */
+#ifdef CONFIG_CANNONLAKE
+	interrupt_register(dma_irq(dma), dw_dma_irq_cnl, dma);
+#else
 	interrupt_register(dma_irq(dma), dw_dma_irq_handler, dma);
+#endif
 	interrupt_enable(dma_irq(dma));
 
 	return 0;
-- 
2.14.1



More information about the Sound-open-firmware mailing list