Lines Matching refs:channel
198 uint32_t channel, bool status) in dma_smartbond_set_channel_status() argument
201 struct channel_regs *regs = DMA_CHN2REG(channel); in dma_smartbond_set_channel_status()
207 DMA->DMA_CLEAR_INT_REG |= BIT(channel); in dma_smartbond_set_channel_status()
209 DMA->DMA_INT_MASK_REG |= BIT(channel); in dma_smartbond_set_channel_status()
230 DMA->DMA_INT_MASK_REG &= ~(BIT(channel)); in dma_smartbond_set_channel_status()
232 DMA->DMA_CLEAR_INT_REG |= BIT(channel); in dma_smartbond_set_channel_status()
245 static bool dma_channel_dst_addr_check_and_adjust(uint32_t channel, uint32_t *dst) in dma_channel_dst_addr_check_and_adjust() argument
265 (channel != DMA_SECURE_CHANNEL))) { in dma_channel_dst_addr_check_and_adjust()
281 static bool dma_channel_src_addr_check_and_adjust(uint32_t channel, uint32_t *src) in dma_channel_src_addr_check_and_adjust() argument
313 (channel != DMA_SECURE_CHANNEL)) { in dma_channel_src_addr_check_and_adjust()
417 uint32_t channel, uint32_t *dma_ctrl_reg) in dma_channel_update_req_sense() argument
427 if (channel & BIT(0)) { in dma_channel_update_req_sense()
436 static void dma_set_mux_request(enum dma_smartbond_trig_mux trig_mux, uint32_t channel) in dma_set_mux_request() argument
441 DMA_REQ_MUX_REG_SET(channel, trig_mux); in dma_set_mux_request()
455 switch (channel) { in dma_set_mux_request()
485 static int dma_smartbond_config(const struct device *dev, uint32_t channel, struct dma_config *cfg) in dma_smartbond_config() argument
492 if (channel >= DMA_CHANNELS_COUNT) { in dma_smartbond_config()
496 regs = DMA_CHN2REG(channel); in dma_smartbond_config()
516 data->channel_data[channel].cb = cfg->dma_callback; in dma_smartbond_config()
517 data->channel_data[channel].user_data = cfg->user_data; in dma_smartbond_config()
522 data->channel_data[channel].cb = NULL; in dma_smartbond_config()
523 data->channel_data[channel].user_data = NULL; in dma_smartbond_config()
526 data->channel_data[channel].dir = cfg->channel_direction; in dma_smartbond_config()
545 data->channel_data[channel].burst_len = cfg->source_burst_length; in dma_smartbond_config()
553 data->channel_data[channel].bus_width = cfg->source_data_size; in dma_smartbond_config()
597 dma_channel_update_req_sense(cfg->dma_slot, channel, &dma_ctrl_reg); in dma_smartbond_config()
603 if (!dma_channel_src_addr_check_and_adjust(channel, &src_dst_address)) { in dma_smartbond_config()
615 if (!dma_channel_dst_addr_check_and_adjust(channel, &src_dst_address)) { in dma_smartbond_config()
642 dma_set_mux_request(cfg->dma_slot, channel); in dma_smartbond_config()
645 data->channel_data[channel].is_dma_configured = true; in dma_smartbond_config()
651 static int dma_smartbond_reload(const struct device *dev, uint32_t channel, uint32_t src, in dma_smartbond_reload() argument
657 if (channel >= DMA_CHANNELS_COUNT) { in dma_smartbond_reload()
661 regs = DMA_CHN2REG(channel); in dma_smartbond_reload()
663 if (!data->channel_data[channel].is_dma_configured) { in dma_smartbond_reload()
678 if (src % data->channel_data[channel].bus_width) { in dma_smartbond_reload()
683 if (!dma_channel_src_addr_check_and_adjust(channel, &src)) { in dma_smartbond_reload()
689 if (dst % data->channel_data[channel].bus_width) { in dma_smartbond_reload()
694 if (!dma_channel_dst_addr_check_and_adjust(channel, &dst)) { in dma_smartbond_reload()
700 if (size % (data->channel_data[channel].burst_len * in dma_smartbond_reload()
701 data->channel_data[channel].bus_width)) { in dma_smartbond_reload()
706 regs->DMA_LEN_REG = (size / data->channel_data[channel].bus_width) - 1; in dma_smartbond_reload()
709 regs->DMA_INT_REG = (size / data->channel_data[channel].bus_width) - 1; in dma_smartbond_reload()
714 static int dma_smartbond_start(const struct device *dev, uint32_t channel) in dma_smartbond_start() argument
719 if (channel >= DMA_CHANNELS_COUNT) { in dma_smartbond_start()
723 regs = DMA_CHN2REG(channel); in dma_smartbond_start()
725 if (!data->channel_data[channel].is_dma_configured) { in dma_smartbond_start()
735 dma_smartbond_set_channel_status(dev, channel, true); in dma_smartbond_start()
740 static int dma_smartbond_stop(const struct device *dev, uint32_t channel) in dma_smartbond_stop() argument
744 if (channel >= DMA_CHANNELS_COUNT) { in dma_smartbond_stop()
748 regs = DMA_CHN2REG(channel); in dma_smartbond_stop()
755 dma_smartbond_set_channel_status(dev, channel, false); in dma_smartbond_stop()
760 static int dma_smartbond_suspend(const struct device *dev, uint32_t channel) in dma_smartbond_suspend() argument
762 if (channel >= DMA_CHANNELS_COUNT) { in dma_smartbond_suspend()
783 static int dma_smartbond_resume(const struct device *dev, uint32_t channel) in dma_smartbond_resume() argument
785 if (channel >= DMA_CHANNELS_COUNT) { in dma_smartbond_resume()
798 static int dma_smartbond_get_status(const struct device *dev, uint32_t channel, in dma_smartbond_get_status() argument
807 if (channel >= DMA_CHANNELS_COUNT) { in dma_smartbond_get_status()
816 if (!data->channel_data[channel].is_dma_configured) { in dma_smartbond_get_status()
821 regs = DMA_CHN2REG(channel); in dma_smartbond_get_status()
847 stat->dir = data->channel_data[channel].dir; in dma_smartbond_get_status()
889 static bool dma_smartbond_chan_filter(const struct device *dev, int channel, void *filter_param) in dma_smartbond_chan_filter() argument
893 if (channel >= DMA_CHANNELS_COUNT) { in dma_smartbond_chan_filter()
905 if (channel == requested_channel) { in dma_smartbond_chan_filter()