summaryrefslogtreecommitdiff
path: root/include/dma-uclass.h
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2018-11-28 19:17:49 +0100
committerTom Rini <trini@konsulko.com>2018-12-07 08:13:45 -0500
commit10b4dc520811fdfc5a31f6067be2b0cd0753998d (patch)
treec5dd61f53ac06d1e2e010ed91a3f741f81bea398 /include/dma-uclass.h
parent205b010caf8d07e95c49efcbe15cad3fc5c8f31f (diff)
dma: move dma_ops to dma-uclass.h
Move dma_ops to a separate header file, following other uclass implementations. While doing so, this patch also improves dma_ops documentation. Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Diffstat (limited to 'include/dma-uclass.h')
-rw-r--r--include/dma-uclass.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/dma-uclass.h b/include/dma-uclass.h
new file mode 100644
index 00000000000..7bec5d33990
--- /dev/null
+++ b/include/dma-uclass.h
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2018 Álvaro Fernández Rojas <noltari@gmail.com>
+ * Copyright (C) 2015 Texas Instruments Incorporated <www.ti.com>
+ * Written by Mugunthan V N <mugunthanvnm@ti.com>
+ *
+ */
+
+#ifndef _DMA_UCLASS_H
+#define _DMA_UCLASS_H
+
+/* See dma.h for background documentation. */
+
+#include <dma.h>
+
+/*
+ * struct dma_ops - Driver model DMA operations
+ *
+ * The uclass interface is implemented by all DMA devices which use
+ * driver model.
+ */
+struct dma_ops {
+ /**
+ * transfer() - Issue a DMA transfer. The implementation must
+ * wait until the transfer is done.
+ *
+ * @dev: The DMA device
+ * @direction: direction of data transfer (should be one from
+ * enum dma_direction)
+ * @dst: The destination pointer.
+ * @src: The source pointer.
+ * @len: Length of the data to be copied (number of bytes).
+ * @return zero on success, or -ve error code.
+ */
+ int (*transfer)(struct udevice *dev, int direction, void *dst,
+ void *src, size_t len);
+};
+
+#endif /* _DMA_UCLASS_H */