
Linux Device Driver Development
By :

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:
Figure 11.2 – DMA engine framework
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: