From 9e424252a35879f121e7ea4531a9ab3dda56d595 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 18 Jul 2011 16:42:51 +0200 Subject: IRQ acknowledgement support in the engine API --- dma/nwl_irq.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'dma/nwl_irq.c') diff --git a/dma/nwl_irq.c b/dma/nwl_irq.c index 86f1845..ae4aacc 100644 --- a/dma/nwl_irq.c +++ b/dma/nwl_irq.c @@ -100,6 +100,20 @@ int dma_nwl_disable_engine_irq(nwl_dma_t *ctx, pcilib_dma_engine_t dma) { return 0; } +int dma_nwl_acknowledge_irq(pcilib_dma_context_t *vctx, pcilib_irq_type_t irq_type, pcilib_irq_source_t irq_source) { + uint32_t val; + + nwl_dma_t *ctx = (nwl_dma_t*)vctx; + pcilib_nwl_engine_description_t *info = ctx->engines + irq_source; + if (irq_type != PCILIB_DMA_IRQ) return PCILIB_ERROR_NOTSUPPORTED; + if (irq_source >= ctx->n_engines) return PCILIB_ERROR_NOTAVAILABLE; -// ACK + nwl_read_register(val, ctx, info->base_addr, REG_DMA_ENG_CTRL_STATUS); + if (val & DMA_ENG_INT_ACTIVE_MASK) { + val |= DMA_ENG_ALLINT_MASK; + nwl_write_register(val, ctx, info->base_addr, REG_DMA_ENG_CTRL_STATUS); + } + + return 0; +} -- cgit v1.2.3