Re: [RFC]DMA API Update


Liu, Baohong
 

Hi Piotr,

From: Piotr MieĊ„kowski [mailto:piotr.mienkowski(a)gmail.com]
Sent: Tuesday, January 24, 2017 5:25 AM
Subject: Re: [devel] [RFC]DMA API Update
[...]
"Instead, the callback would provide the pointer of struct dma_channel_config which triggered it. Then, up to the user to relevantly design his own data structure to be able to use CONTAINER_OF() with that pointer."

So we would need to pass a pointer to dma_config.
For the callback function to get the dma config info, channel id and device pointer are good enough.
A dma userdata pointer is not needed.

[...]
I'm not saying that we need to go to the old dma_api_channel_config/dma_api_transfer_config split. We may try to think about something else, e.g. have dma_start take something like the old dma_transfer_config struct as a parameter.
We need to take care of both single block and block chaining. What's your proposal?

[...]
Is one driver accessing other driver via a private and not public API violating some Zephyr design guideline?
If a driver (e.g. SPI or I2C driver) needs to use DMA, it should be using the DMA APIs
but not through any private API.

Join devel@lists.zephyrproject.org to automatically receive all group messages.