Lines Matching refs:channel

64 	for (int channel = 0; channel < DMA_CHANNELS_NO; channel++) {  in sam_xdmac_isr()  local
65 if (!(isr_status & (1 << channel))) { in sam_xdmac_isr()
69 channel_cfg = &dev_data->dma_channels[channel]; in sam_xdmac_isr()
72 err = xdmac->XDMAC_CHID[channel].XDMAC_CIS & XDMAC_INT_ERR; in sam_xdmac_isr()
77 channel, err); in sam_xdmac_isr()
82 int sam_xdmac_channel_configure(const struct device *dev, uint32_t channel, in sam_xdmac_channel_configure() argument
89 if (channel >= DMA_CHANNELS_NO) { in sam_xdmac_channel_configure()
94 if (xdmac->XDMAC_GS & (XDMAC_GS_ST0 << channel)) { in sam_xdmac_channel_configure()
99 xdmac->XDMAC_CHID[channel].XDMAC_CID = 0xFF; in sam_xdmac_channel_configure()
101 (void)xdmac->XDMAC_CHID[channel].XDMAC_CIS; in sam_xdmac_channel_configure()
110 xdmac->XDMAC_CHID[channel].XDMAC_CC = param->cfg; in sam_xdmac_channel_configure()
113 xdmac->XDMAC_CHID[channel].XDMAC_CDS_MSP = param->ds_msp; in sam_xdmac_channel_configure()
115 xdmac->XDMAC_CHID[channel].XDMAC_CSUS = param->sus; in sam_xdmac_channel_configure()
117 xdmac->XDMAC_CHID[channel].XDMAC_CDUS = param->dus; in sam_xdmac_channel_configure()
120 xdmac->XDMAC_CHID[channel].XDMAC_CIE = param->cie; in sam_xdmac_channel_configure()
125 int sam_xdmac_transfer_configure(const struct device *dev, uint32_t channel, in sam_xdmac_transfer_configure() argument
132 if (channel >= DMA_CHANNELS_NO) { in sam_xdmac_transfer_configure()
137 if (xdmac->XDMAC_GS & (XDMAC_GS_ST0 << channel)) { in sam_xdmac_transfer_configure()
148 xdmac->XDMAC_CHID[channel].XDMAC_CSA = param->sa; in sam_xdmac_transfer_configure()
150 xdmac->XDMAC_CHID[channel].XDMAC_CDA = param->da; in sam_xdmac_transfer_configure()
159 xdmac->XDMAC_CHID[channel].XDMAC_CUBC = param->ublen; in sam_xdmac_transfer_configure()
161 xdmac->XDMAC_CHID[channel].XDMAC_CBC = param->blen; in sam_xdmac_transfer_configure()
169 xdmac->XDMAC_CHID[channel].XDMAC_CNDA = param->nda; in sam_xdmac_transfer_configure()
173 xdmac->XDMAC_CHID[channel].XDMAC_CNDC = param->ndc; in sam_xdmac_transfer_configure()
178 static int sam_xdmac_config(const struct device *dev, uint32_t channel, in sam_xdmac_config() argument
188 if (channel >= DMA_CHANNELS_NO) { in sam_xdmac_config()
210 dev_data->dma_channels[channel].data_size = data_size; in sam_xdmac_config()
269 ret = sam_xdmac_channel_configure(dev, channel, &channel_cfg); in sam_xdmac_config()
274 dev_data->dma_channels[channel].callback = cfg->dma_callback; in sam_xdmac_config()
275 dev_data->dma_channels[channel].user_data = cfg->user_data; in sam_xdmac_config()
282 ret = sam_xdmac_transfer_configure(dev, channel, &transfer_cfg); in sam_xdmac_config()
287 static int sam_xdmac_transfer_reload(const struct device *dev, uint32_t channel, in sam_xdmac_transfer_reload() argument
294 .ublen = size >> dev_data->dma_channels[channel].data_size, in sam_xdmac_transfer_reload()
297 return sam_xdmac_transfer_configure(dev, channel, &transfer_cfg); in sam_xdmac_transfer_reload()
300 int sam_xdmac_transfer_start(const struct device *dev, uint32_t channel) in sam_xdmac_transfer_start() argument
306 if (channel >= DMA_CHANNELS_NO) { in sam_xdmac_transfer_start()
307 LOG_DBG("Channel %d out of range", channel); in sam_xdmac_transfer_start()
312 if (xdmac->XDMAC_GS & (XDMAC_GS_ST0 << channel)) { in sam_xdmac_transfer_start()
313 LOG_DBG("Channel %d already enabled", channel); in sam_xdmac_transfer_start()
318 xdmac->XDMAC_GIE = XDMAC_GIE_IE0 << channel; in sam_xdmac_transfer_start()
320 xdmac->XDMAC_GE = XDMAC_GE_EN0 << channel; in sam_xdmac_transfer_start()
325 int sam_xdmac_transfer_stop(const struct device *dev, uint32_t channel) in sam_xdmac_transfer_stop() argument
331 if (channel >= DMA_CHANNELS_NO) { in sam_xdmac_transfer_stop()
336 if (!(xdmac->XDMAC_GS & (XDMAC_GS_ST0 << channel))) { in sam_xdmac_transfer_stop()
341 xdmac->XDMAC_GD = XDMAC_GD_DI0 << channel; in sam_xdmac_transfer_stop()
343 xdmac->XDMAC_GID = XDMAC_GID_ID0 << channel; in sam_xdmac_transfer_stop()
345 xdmac->XDMAC_CHID[channel].XDMAC_CID = 0xFF; in sam_xdmac_transfer_stop()
347 (void)xdmac->XDMAC_CHID[channel].XDMAC_CIS; in sam_xdmac_transfer_stop()
378 static int sam_xdmac_get_status(const struct device *dev, uint32_t channel, in sam_xdmac_get_status() argument
384 uint32_t chan_cfg = xdmac->XDMAC_CHID[channel].XDMAC_CC; in sam_xdmac_get_status()
385 uint32_t ublen = xdmac->XDMAC_CHID[channel].XDMAC_CUBC; in sam_xdmac_get_status()