From: Piotr Mieńkowski [mailto:piotr.mienkowski(a)gmail.com][...]
"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."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.