/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to dma/nwl_irq.c

  • Committer: Suren A. Chilingaryan
  • Date: 2011-07-18 14:42:51 UTC
  • Revision ID: csa@dside.dyndns.org-20110718144251-nmbl7xhcq00mfx1p
IRQ acknowledgement support in the engine API

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
    return 0;
101
101
}
102
102
 
103
 
 
104
 
 
105
 
// ACK
 
103
int dma_nwl_acknowledge_irq(pcilib_dma_context_t *vctx, pcilib_irq_type_t irq_type, pcilib_irq_source_t irq_source) {
 
104
    uint32_t val;
 
105
    
 
106
    nwl_dma_t *ctx = (nwl_dma_t*)vctx;
 
107
    pcilib_nwl_engine_description_t *info = ctx->engines + irq_source;
 
108
 
 
109
    if (irq_type != PCILIB_DMA_IRQ) return PCILIB_ERROR_NOTSUPPORTED;
 
110
    if (irq_source >= ctx->n_engines) return PCILIB_ERROR_NOTAVAILABLE;
 
111
 
 
112
    nwl_read_register(val, ctx, info->base_addr, REG_DMA_ENG_CTRL_STATUS);
 
113
    if (val & DMA_ENG_INT_ACTIVE_MASK) {
 
114
        val |= DMA_ENG_ALLINT_MASK;
 
115
        nwl_write_register(val, ctx, info->base_addr, REG_DMA_ENG_CTRL_STATUS);
 
116
    }
 
117
    
 
118
    return 0;
 
119
}