| Electronic Components Datasheet Search |
|
UM0851 Datasheet(PDF) 165 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 Datasheet(HTML) 165 Page - STMicroelectronics |
|
165 / 245 page ![]() UM0851 Accelerator engine device drivers Doc ID 16604 Rev 2 165/245 Client registration A client can register with the framework by using the following call: dma_async_client_register(&dma_client1); /* dma_client1 is an instance of struct dma_client present in include/linux/dmaengine.h */ struct dma_client { dma_event_callback event_callback; /* Function ptr for DMA framework purposes (Mandatory). */ dma_cap_mask_t cap_mask; /* Capability of the DMA Channel to be requested, a value of zero corresponds to any capability (Mandatory) */ struct dma_slave *slave; /* Data for preparing slave transfer. Must be non-NULL if the DMA_SLAVE capability is requested (Optional) */ struct list_head global_node; /* list_head for global dma_client_list (Not for user driver) */ }; /* CAP can be one of DMA_MEMCPY (memory to memory), DMA_MEMSET(memory to memory), DMA_SLAVE(peripheral to peripheral or memory to/from peripheral). */ /* Prototype of this event_callback. */ static enum dma_state_client dma_event(struct dma_client *client, struct dma_chan *chan, enum dma_state state); /* cap_mask can be set using following function */ dma_cap_set(CAP, dma_client1.cap_mask); After registering the client, you must request the DMA channels for transferring data. This can be done using following call: dma_async_client_chan_request(&dma_client1); The DMA framework calls the dma_event() function twice, once for channel allocation and once for channel removal. The value of enum dma_state state is: ● DMA_RESOURCE_AVAILABLE during channel allocation, and ● DMA_RESOURCE_REMOVED during channel removal. You have to check the value of the state variable in dma_event() to determine the cause of the function call. During channel allocation, dma_event() is called for every free DMA channel available that satisfies the capability requested by the client. This callback is called until you return DMA_NAK from the dma_event() function. Suppose there are 8 DMA channels available and you need only three of them, then you must return DMA_ACK on the first three calls to event_callback() and return DMA_NAK on the fourth call. In addition, you must save all the struct dma_chan *chan parameters passed to event_callback(), chan is a pointer to the DMA channel which is currently allocated to the client. During channel removal, dma_event() is called for every DMA channel allocated to the client. You must return DMA_ACK for the channels you want to free. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |