Working with the DMA engine's API
The DMA engine is a generic kernel framework used to develop DMA controller drivers and leverage this controller from the consumer side. Through this framework, the DMA controller driver exposes a set of channels that can be used by client devices. This framework then makes it possible for client drivers (also called slaves) to request and use DMA channels from the controller to issue DMA transfers.
The following diagram is the layering, showing how this framework is integrated with the Linux kernel:
Here we will simply walk through that (slave) API, which is applicable for slave DMA usage only. The mandatory header here is as follows:
#include <linux/dmaengine.h>
The slave DMA usage is straightforward, and consists of the following steps:
- Informing the kernel about the device's DMA addressing capabilities.
- Requesting a DMA channel.
- If successful...