Skip to content

Commit 8d3bb53

Browse files
smalaekartben
authored andcommitted
drivers: dma: siwx91x: Add chan_filter API for DMA channel assignment
This new API allows the assignment of desired DMA channels for peripheral transfers, enhancing flexibility and control over DMA operations. Signed-off-by: Sai Santhosh Malae <[email protected]>
1 parent 8930aed commit 8d3bb53

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/dma/dma_silabs_siwx91x.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,21 @@ static int siwx91x_dma_get_status(const struct device *dev, uint32_t channel,
352352
return 0;
353353
}
354354

355+
bool siwx91x_dma_chan_filter(const struct device *dev, int channel, void *filter_param)
356+
{
357+
ARG_UNUSED(dev);
358+
359+
if (!filter_param) {
360+
return false;
361+
}
362+
363+
if (*(int *)filter_param == channel) {
364+
return true;
365+
} else {
366+
return false;
367+
}
368+
}
369+
355370
/* Function to initialize DMA peripheral */
356371
static int siwx91x_dma_init(const struct device *dev)
357372
{
@@ -440,6 +455,7 @@ static DEVICE_API(dma, siwx91x_dma_api) = {
440455
.start = siwx91x_dma_start,
441456
.stop = siwx91x_dma_stop,
442457
.get_status = siwx91x_dma_get_status,
458+
.chan_filter = siwx91x_dma_chan_filter,
443459
};
444460

445461
#define SIWX91X_DMA_INIT(inst) \

0 commit comments

Comments
 (0)