/* De-initialize DMA Interface. stops operation and releases the software resources used by the interface.  */
int32_t csi_dma_uninitialize(dmac_handle_t handle)
/* De-initialize DMA Interface. stops operation and releases the software resources used by the interface.  */
int32_t csi_dma_uninitialize(dmac_handle_t handle)
{
    if (handle == NULL) {
        return ERR_DMA(EDRV_PARAMETER);
    }
    ck_dma_priv_t *dma_priv = handle;
    ck_dma_reg_t *addr = (ck_dma_reg_t *)(dma_priv->base);
    uint8_t count;
    for (count = 0; count < dma_priv->ch_num; count++) {
        addr = (ck_dma_reg_t *)(dma_priv->base + count * 0x30);
        addr->CHINTM = CK_DMA_MASK;
        addr->CHINTC = CK_DMA_INTC;
    }
    drv_nvic_disable_irq(dma_priv->irq);
    return 0;
}