HI Gustavo, On 03-01-19, 12:55, Gustavo Pimentel wrote: > On 03/01/2019 12:45, Vinod Koul wrote: > > On 03-01-19, 09:53, Gustavo Pimentel wrote: > >> I've a doubt now. As you know, for a DMA transfer you need the source and > >> destination addresses, which in the limited can be swapped according to the > >> direction MEM_TO_DEV/DEV_TO_MEM case. > >> > >> For the sake of simplicity, I'll just consider now the MEM_TO_DEV case, since > >> the other case is similar but the source and destination address are swapped. > >> > >> In my code I can get some of the information that I need by using the > >> sg_dma_address() in the scatter-gather list (which gives me the source address). > >> > >> The remaining information I got from here, using the direction to help me to > >> select which address I'll use later on the DMA transfer, in this case the > >> destination address. > >> > >> Since this is deprecated how should I proceed? How can I get that information? > >> There is some similar function to sg_dma_address() that could give me the > >> destination address? > > > > So the direction field is deprecated but rest of the configuration comes > > from from dma_slave_config. The user should set src_addr, dst_addr and > > then based on direction passed in the .device_prep_dma_* call arguments > > one can use one of these as peripheral address. > > Ok, and the address given by sg_dma_address()? Is redundant or not applicable > for this case? It is, it is the memory address you need to program. The device address comes from dma_slave_config. To elaborate, if you have MEM_TO_DEV use sg_dma_address() for src address and dst_addr from dma_slave_config. Similarly for DEV_TO_MEM, we use src_addr from dma_slave_config and sg_dma_address() The peripheral is static but memory buffer keeps changing wrt different descriptors, so device address can be programmed once for multiple descriptors to be transferred from a device. HTH -- ~Vinod