Lines Matching refs:channel

39 	uint32_t channel;  member
101 uint32_t channel) in dma_emul_get_channel_state() argument
105 __ASSERT_NO_MSG(channel < config->num_channels); in dma_emul_get_channel_state()
107 return (enum dma_emul_channel_state)config->xfer[channel].config._reserved; in dma_emul_get_channel_state()
110 static void dma_emul_set_channel_state(const struct device *dev, uint32_t channel, in dma_emul_set_channel_state() argument
115 LOG_DBG("setting channel %u state to %s", channel, dma_emul_channel_state_to_string(state)); in dma_emul_set_channel_state()
117 __ASSERT_NO_MSG(channel < config->num_channels); in dma_emul_set_channel_state()
120 config->xfer[channel].config._reserved = state; in dma_emul_set_channel_state()
200 uint32_t channel; in dma_emul_work_handler() local
211 channel = dma_work->channel; in dma_emul_work_handler()
215 xfer = &config->xfer[channel]; in dma_emul_work_handler()
223 LOG_DBG("processing xfer %p for channel %u", xfer, channel); in dma_emul_work_handler()
234 &config->block[channel * config->num_requests + in dma_emul_work_handler()
246 state = dma_emul_get_channel_state(dev, channel); in dma_emul_work_handler()
253 channel, -ECANCELED); in dma_emul_work_handler()
273 dma_emul_set_channel_state(dev, channel, DMA_EMUL_CHANNEL_STOPPED); in dma_emul_work_handler()
278 xfer_config.dma_callback(dev, xfer_config.user_data, channel, in dma_emul_work_handler()
285 LOG_DBG("%s(): Linked channel %u -> %u", __func__, channel, in dma_emul_work_handler()
287 __ASSERT_NO_MSG(channel != xfer_config.linked_channel); in dma_emul_work_handler()
288 channel = xfer_config.linked_channel; in dma_emul_work_handler()
299 static bool dma_emul_config_valid(const struct device *dev, uint32_t channel, in dma_emul_config_valid() argument
311 if (channel >= config->num_channels) { in dma_emul_config_valid()
312 LOG_ERR("invalid DMA channel %u", channel); in dma_emul_config_valid()
347 static int dma_emul_configure(const struct device *dev, uint32_t channel, in dma_emul_configure() argument
361 if (!dma_emul_config_valid(dev, channel, xfer_config)) { in dma_emul_configure()
366 xfer = &config->xfer[channel]; in dma_emul_configure()
368 LOG_DBG("%s():\nchannel: %u\nconfig: %s", __func__, channel, in dma_emul_configure()
371 block_idx = channel * config->num_requests + xfer_config->dma_slot; in dma_emul_configure()
373 block = &config->block[channel * config->num_requests + xfer_config->dma_slot]; in dma_emul_configure()
374 state = dma_emul_get_channel_state(dev, channel); in dma_emul_configure()
390 dma_emul_set_channel_state(dev, channel, DMA_EMUL_CHANNEL_LOADED); in dma_emul_configure()
402 static int dma_emul_reload(const struct device *dev, uint32_t channel, dma_addr_t src, in dma_emul_reload() argument
410 static int dma_emul_start(const struct device *dev, uint32_t channel) in dma_emul_start() argument
420 LOG_DBG("%s(channel: %u)", __func__, channel); in dma_emul_start()
422 if (channel >= config->num_channels) { in dma_emul_start()
427 xfer = &config->xfer[channel]; in dma_emul_start()
428 state = dma_emul_get_channel_state(dev, channel); in dma_emul_start()
435 data->work.channel = channel; in dma_emul_start()
437 dma_emul_set_channel_state(dev, channel, DMA_EMUL_CHANNEL_STARTED); in dma_emul_start()
439 xfer_config = &config->xfer[channel].config; in dma_emul_start()
441 LOG_DBG("%s(): Linked channel %u -> %u", __func__, channel, in dma_emul_start()
443 channel = xfer_config->linked_channel; in dma_emul_start()
461 static int dma_emul_stop(const struct device *dev, uint32_t channel) in dma_emul_stop() argument
467 dma_emul_set_channel_state(dev, channel, DMA_EMUL_CHANNEL_STOPPED); in dma_emul_stop()
473 static int dma_emul_suspend(const struct device *dev, uint32_t channel) in dma_emul_suspend() argument
480 static int dma_emul_resume(const struct device *dev, uint32_t channel) in dma_emul_resume() argument
487 static int dma_emul_get_status(const struct device *dev, uint32_t channel, in dma_emul_get_status() argument
502 static bool dma_emul_chan_filter(const struct device *dev, int channel, void *filter_param) in dma_emul_chan_filter() argument
510 success = dma_emul_get_channel_state(dev, channel) == DMA_EMUL_CHANNEL_UNUSED; in dma_emul_chan_filter()