/* this function will be called when dma transferring is completed or error happened  */
static void dma_handler(sedi_dma_t dma_device, int channel, int event_id, void *args)
/* this function will be called when dma transferring is completed or error happened  */
static void dma_handler(sedi_dma_t dma_device, int channel, int event_id, void *args)
{
	ARG_UNUSED(args);
	const struct device *dev = (const struct device *)args;
	struct dma_sedi_driver_data *const data = DEV_DATA(dev);
	struct dma_config *config = &(data->dma_configs[channel]);
	if (config->dma_callback) {
		if ((event_id == SEDI_DMA_EVENT_TRANSFER_DONE) &&
		    (config->complete_callback_en)) {
			config->dma_callback(dev, config->user_data,
					channel, 0);
		} else if (config->error_callback_en) {
			config->dma_callback(dev, config->user_data,
					channel, event_id);
		}
	}
}