Lines Matching refs:chan_id
72 uint32_t chan_id) in lookup_channel() argument
88 if (chan_id >= data->ctx.dma_channels) { in lookup_channel()
92 return &data->channels[chan_id]; in lookup_channel()
100 if (data->channels[i].id == chan_id) { in lookup_channel()
108 static int edma_config(const struct device *dev, uint32_t chan_id, in edma_config() argument
241 chan = lookup_channel(dev, chan_id); in edma_config()
243 LOG_ERR("channel ID %u is not valid", chan_id); in edma_config()
283 chan_id, chan->state); in edma_config()
296 ret = EDMA_ConfigureTransfer(data->hal_cfg, chan_id, in edma_config()
311 ret = EDMA_SetChannelMux(data->hal_cfg, chan_id, dma_cfg->dma_slot); in edma_config()
319 ret = set_slast_dlast(dma_cfg, transfer_type, data, chan_id); in edma_config()
331 EDMA_ChannelRegUpdate(data->hal_cfg, chan_id, in edma_config()
338 EDMA_ChannelRegUpdate(data->hal_cfg, chan_id, EDMA_TCD_CSR, in edma_config()
343 edma_dump_channel_registers(data, chan_id); in edma_config()
350 static int edma_get_status(const struct device *dev, uint32_t chan_id, in edma_get_status() argument
361 chan = lookup_channel(dev, chan_id); in edma_get_status()
363 LOG_ERR("channel ID %u is not valid", chan_id); in edma_get_status()
378 citer = EDMA_ChannelRegRead(data->hal_cfg, chan_id, EDMA_TCD_CITER); in edma_get_status()
379 biter = EDMA_ChannelRegRead(data->hal_cfg, chan_id, EDMA_TCD_BITER); in edma_get_status()
380 done = EDMA_ChannelRegRead(data->hal_cfg, chan_id, EDMA_TCD_CH_CSR) & in edma_get_status()
396 static int edma_suspend(const struct device *dev, uint32_t chan_id) in edma_suspend() argument
406 chan = lookup_channel(dev, chan_id); in edma_suspend()
408 LOG_ERR("channel ID %u is not valid", chan_id); in edma_suspend()
412 edma_dump_channel_registers(data, chan_id); in edma_suspend()
417 chan_id, chan->state); in edma_suspend()
421 LOG_DBG("suspending channel %u", chan_id); in edma_suspend()
424 EDMA_ChannelRegUpdate(data->hal_cfg, chan_id, in edma_suspend()
432 static int edma_stop(const struct device *dev, uint32_t chan_id) in edma_stop() argument
444 chan = lookup_channel(dev, chan_id); in edma_stop()
446 LOG_ERR("channel ID %u is not valid", chan_id); in edma_stop()
455 chan_id, chan->state); in edma_stop()
459 LOG_DBG("stopping channel %u", chan_id); in edma_stop()
470 EDMA_ChannelRegUpdate(data->hal_cfg, chan_id, EDMA_TCD_CH_CSR, 0, in edma_stop()
483 ret = EDMA_SetChannelMux(data->hal_cfg, chan_id, 0); in edma_stop()
490 edma_dump_channel_registers(data, chan_id); in edma_stop()
497 static int edma_start(const struct device *dev, uint32_t chan_id) in edma_start() argument
507 chan = lookup_channel(dev, chan_id); in edma_start()
509 LOG_ERR("channel ID %u is not valid", chan_id); in edma_start()
516 chan_id, chan->state); in edma_start()
520 LOG_DBG("starting channel %u", chan_id); in edma_start()
523 EDMA_ChannelRegUpdate(data->hal_cfg, chan_id, in edma_start()
531 static int edma_reload(const struct device *dev, uint32_t chan_id, uint32_t src, in edma_reload() argument
542 chan = lookup_channel(dev, chan_id); in edma_reload()
544 LOG_ERR("channel ID %u is not valid", chan_id); in edma_reload()
559 LOG_ERR("chan %d buffer overflow/underrun", chan_id); in edma_reload()
586 static bool edma_channel_filter(const struct device *dev, int chan_id, void *param) in edma_channel_filter() argument
595 if (*(int *)param != chan_id) { in edma_channel_filter()
599 chan = lookup_channel(dev, chan_id); in edma_channel_filter()
608 chan_id, ret); in edma_channel_filter()
618 static void edma_channel_release(const struct device *dev, uint32_t chan_id) in edma_channel_release() argument
624 chan = lookup_channel(dev, chan_id); in edma_channel_release()
633 chan_id, chan->state); in edma_channel_release()
656 chan_id, ret); in edma_channel_release()