| Synopsis |
static inline struct dma_async_tx_descriptor *
dmaengine_prep_dma_cyclic(struct dma_chan *chan,
dma_addr_t buf_addr,
size_t buf_len,
size_t period_len,
enum dma_transfer_direction dir,
unsigned long flags)
|
| Description |
Prepares a transmission of the ring buffer. The interface is
usually used in audio scenarios. In a DMA transmission with a
certain length, every time when a certain amount of bytes
(defined in period_len) has been transmitted, the system
requests the callback function of transmission
completion. |
| Parameter |
- chan: The relevant DMA channel
- buf_addr: Destination address
- buf_len: The length of the transmission. Must be
integral multiple of
period_len.
- period_len: When a certain number of data bytes
are transferred, the callback function that completes
the transfer is executed.
- dir: Transmission direction. For example:
- DMA_MEM_TO_DEV: From memory to
device.
- DMA_DEV_TO_MEM: From device to
memory.
- flags: The macro definitions started with
"DMA_PREP_", which provides additional information for
the DMA Controller (DMAC) driver. For example:
- DMA_PREP_INTERRUPT: The flag is used to
inform DMAC that an interrupt will be generated
after the transmission, so that DMAC will use the
callback function from the client.
- DMA_PREP_FENCE: The flag is used to
inform DMAC that all the later transmissions rely
on the success of the current transmission, so
that DMAC will prioritize the DMA transmissions
accordingly.
|
| Return |
- Success: A pointer to the transmission descriptor.
- Failure: NULL
|