Date
1 - 1 of 1
[EXT] Re: about DMA API updates proposal
Hake Huang
Hi Gala,
toggle quoted messageShow quoted text
I will create a separated PR for DMA new API only. and one question for below: "use some of the generic devicetree properties in "dts/bindings/dma/dma-controller.yaml”. The number space allocation code seems pretty generic" Do you mean, instead of just add API call but move below implement to common code? static int dma_mcux_edma_request_channel(const struct device *dev, enum dma_channel_filter filter) { int i = 0; int channel = -EINVAL; k_mutex_lock(&DEV_DATA(dev)->dma_mutex, K_FOREVER); for (i = 0; i < DEV_CFG(dev)->dma_channels; i++) { /* channel 0-3 is Period trigger enabled */ if (filter == DMA_CHANNEL_PERIODIC && i > 3) { break; } if (!atomic_test_and_set_bit(DEV_DATA(dev)->dma_channels, i)) { channel = i; break; } } k_mutex_unlock(&DEV_DATA(dev)->dma_mutex); return channel; } If so the filter is hard to aligned, as different SOC has different filter setting. Regards, Hake
-----Original Message-----
From: Kumar Gala <kumar.gala@linaro.org> Sent: 2021年3月3日 1:43 To: Hake Huang <hake.huang@nxp.com> Cc: devel@lists.zephyrproject.org; Maureen Helm <maureen.helm@nxp.com> Subject: [EXT] Re: about DMA API updates proposal Caution: EXT Email On Feb 26, 2021, at 5:46 AM, Hake Huang <hake.huang@nxp.com> wrote:I wonder if we should pull this into a separate PR. I think a fair amount of the code for these APIs could be generic. For example I think we can use some of the generic devicetree properties in "dts/bindings/dma/dma-controller.yaml”. The number space allocation code seems pretty generic, even if it just library code used by all the drivers. - k
|
|