dma: move dma_ops to dma-uclass.h
[platform/kernel/u-boot.git] / include / dma-uclass.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2018 Álvaro Fernández Rojas <noltari@gmail.com>
4  * Copyright (C) 2015 Texas Instruments Incorporated <www.ti.com>
5  * Written by Mugunthan V N <mugunthanvnm@ti.com>
6  *
7  */
8
9 #ifndef _DMA_UCLASS_H
10 #define _DMA_UCLASS_H
11
12 /* See dma.h for background documentation. */
13
14 #include <dma.h>
15
16 /*
17  * struct dma_ops - Driver model DMA operations
18  *
19  * The uclass interface is implemented by all DMA devices which use
20  * driver model.
21  */
22 struct dma_ops {
23         /**
24          * transfer() - Issue a DMA transfer. The implementation must
25          *   wait until the transfer is done.
26          *
27          * @dev: The DMA device
28          * @direction: direction of data transfer (should be one from
29          *   enum dma_direction)
30          * @dst: The destination pointer.
31          * @src: The source pointer.
32          * @len: Length of the data to be copied (number of bytes).
33          * @return zero on success, or -ve error code.
34          */
35         int (*transfer)(struct udevice *dev, int direction, void *dst,
36                         void *src, size_t len);
37 };
38
39 #endif /* _DMA_UCLASS_H */