All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Álvaro Fernández Rojas" <noltari@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC v4 01/15] dma: move dma_ops to dma-uclass.h
Date: Sat,  3 Mar 2018 09:59:03 +0100	[thread overview]
Message-ID: <20180303085917.8293-2-noltari@gmail.com> (raw)
In-Reply-To: <20180303085917.8293-1-noltari@gmail.com>

Move dma_ops to a separate header file, following other uclass implementations.
While doing so, this patch also improves dma_ops documentation.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
 v4: no changes
 v3: Introduce changes reported by Simon Glass:
  - Improve dma-uclass.h documentation.
  - Switch to live tree API.

 drivers/dma/dma-uclass.c |  3 ++-
 include/dma-uclass.h     | 39 +++++++++++++++++++++++++++++++++++++++
 include/dma.h            | 22 ----------------------
 3 files changed, 41 insertions(+), 23 deletions(-)
 create mode 100644 include/dma-uclass.h

diff --git a/drivers/dma/dma-uclass.c b/drivers/dma/dma-uclass.c
index 3d0ce22fbc..6fd4e1b35d 100644
--- a/drivers/dma/dma-uclass.c
+++ b/drivers/dma/dma-uclass.c
@@ -10,10 +10,11 @@
  */
 
 #include <common.h>
-#include <dma.h>
 #include <dm.h>
 #include <dm/uclass-internal.h>
 #include <dm/device-internal.h>
+#include <dma.h>
+#include <dma-uclass.h>
 #include <errno.h>
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/include/dma-uclass.h b/include/dma-uclass.h
new file mode 100644
index 0000000000..3429f65ec4
--- /dev/null
+++ b/include/dma-uclass.h
@@ -0,0 +1,39 @@
+/*
+ * 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>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#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 */
diff --git a/include/dma.h b/include/dma.h
index 71fa77f2ea..89320f10d9 100644
--- a/include/dma.h
+++ b/include/dma.h
@@ -28,28 +28,6 @@ enum dma_direction {
 #define DMA_SUPPORTS_DEV_TO_DEV	BIT(3)
 
 /*
- * struct dma_ops - Driver model DMA operations
- *
- * The uclass interface is implemented by all DMA devices which use
- * driver model.
- */
-struct dma_ops {
-	/*
-	 * Get the current timer count
-	 *
-	 * @dev: The DMA device
-	 * @direction: direction of data transfer should be one from
-		       enum dma_direction
-	 * @dst: Destination pointer
-	 * @src: Source pointer
-	 * @len: Length of the data to be copied.
-	 * @return: 0 if OK, -ve on error
-	 */
-	int (*transfer)(struct udevice *dev, int direction, void *dst,
-			void *src, size_t len);
-};
-
-/*
  * struct dma_dev_priv - information about a device used by the uclass
  *
  * @supported: mode of transfers that DMA can support, should be
-- 
2.11.0

  reply	other threads:[~2018-03-03  8:59 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-12 16:38 [U-Boot] [RFC 00/14] bmips: add bcm6348-enet support Álvaro Fernández Rojas
2018-02-12 16:38 ` [U-Boot] [RFC 01/14] dma: add dma channels support and improve uclass Álvaro Fernández Rojas
2018-02-20  8:24   ` Vignesh R
2018-02-12 16:38 ` [U-Boot] [RFC 02/14] dma: add bcm6348-iudma support Álvaro Fernández Rojas
2018-02-12 16:38 ` [U-Boot] [RFC 03/14] bmips: bcm6338: " Álvaro Fernández Rojas
2018-02-12 16:38 ` [U-Boot] [RFC 04/14] bmips: bcm6348: " Álvaro Fernández Rojas
2018-02-12 16:38 ` [U-Boot] [RFC 05/14] bmips: bcm6358: " Álvaro Fernández Rojas
2018-02-12 16:38 ` [U-Boot] [RFC 06/14] phy: add support for internal phys Álvaro Fernández Rojas
2018-02-12 16:38 ` [U-Boot] [RFC 07/14] net: add support for bcm6348-enet Álvaro Fernández Rojas
2018-02-12 16:38 ` [U-Boot] [RFC 08/14] bmips: bcm6338: " Álvaro Fernández Rojas
2018-02-12 16:38 ` [U-Boot] [RFC 09/14] bmips: enable f@st1704 enet support Álvaro Fernández Rojas
2018-02-12 16:38 ` [U-Boot] [RFC 10/14] bmips: bcm6348: add support for bcm6348-enet Álvaro Fernández Rojas
2018-02-12 16:38 ` [U-Boot] [RFC 11/14] bmips: enable ct-5361 enet support Álvaro Fernández Rojas
2018-02-12 16:38 ` [U-Boot] [RFC 12/14] bmips: bcm6358: add support for bcm6348-enet Álvaro Fernández Rojas
2018-02-12 16:38 ` [U-Boot] [RFC 13/14] bmips: enable hg556a enet support Álvaro Fernández Rojas
2018-02-12 16:38 ` [U-Boot] [RFC 14/14] bmips: enable nb4-ser " Álvaro Fernández Rojas
2018-02-19 17:26 ` [U-Boot] [RFC 00/14] bmips: add bcm6348-enet support Álvaro Fernández Rojas
2018-02-20 17:46 ` [U-Boot] [RFC v2 00/15] " Álvaro Fernández Rojas
2018-02-20 17:46   ` [U-Boot] [RFC v2 01/15] dma: move dma_ops to dma-uclass.h Álvaro Fernández Rojas
2018-02-20 18:49     ` Simon Glass
2018-02-20 18:55       ` Álvaro Fernández Rojas
2018-02-20 17:46   ` [U-Boot] [RFC v2 02/15] dma: add channels support Álvaro Fernández Rojas
2018-02-20 18:49     ` Simon Glass
2018-02-20 19:00       ` Álvaro Fernández Rojas
2018-02-21 15:51       ` Álvaro Fernández Rojas
2018-02-20 17:46   ` [U-Boot] [RFC v2 03/15] dma: add bcm6348-iudma support Álvaro Fernández Rojas
2018-02-20 17:46   ` [U-Boot] [RFC v2 04/15] bmips: bcm6338: " Álvaro Fernández Rojas
2018-02-20 17:46   ` [U-Boot] [RFC v2 05/15] bmips: bcm6348: " Álvaro Fernández Rojas
2018-02-20 17:46   ` [U-Boot] [RFC v2 06/15] bmips: bcm6358: " Álvaro Fernández Rojas
2018-02-20 17:46   ` [U-Boot] [RFC v2 07/15] phy: add support for internal phys Álvaro Fernández Rojas
2018-02-20 17:46   ` [U-Boot] [RFC v2 08/15] net: add support for bcm6348-enet Álvaro Fernández Rojas
2018-02-20 17:46   ` [U-Boot] [RFC v2 09/15] bmips: bcm6338: " Álvaro Fernández Rojas
2018-02-20 17:46   ` [U-Boot] [RFC v2 10/15] bmips: enable f@st1704 enet support Álvaro Fernández Rojas
2018-02-20 17:46   ` [U-Boot] [RFC v2 11/15] bmips: bcm6348: add support for bcm6348-enet Álvaro Fernández Rojas
2018-02-20 17:46   ` [U-Boot] [RFC v2 12/15] bmips: enable ct-5361 enet support Álvaro Fernández Rojas
2018-02-20 17:46   ` [U-Boot] [RFC v2 13/15] bmips: bcm6358: add support for bcm6348-enet Álvaro Fernández Rojas
2018-02-20 17:46   ` [U-Boot] [RFC v2 14/15] bmips: enable hg556a enet support Álvaro Fernández Rojas
2018-02-20 17:46   ` [U-Boot] [RFC v2 15/15] bmips: enable nb4-ser " Álvaro Fernández Rojas
2018-02-21 16:10 ` [U-Boot] [RFC v3 00/15] bmips: add bcm6348-enet support Álvaro Fernández Rojas
2018-02-21 16:10   ` [U-Boot] [RFC v3 01/15] dma: move dma_ops to dma-uclass.h Álvaro Fernández Rojas
2018-02-22 16:18     ` Simon Glass
2018-03-05 19:35       ` Grygorii Strashko
2018-03-05 20:06         ` Álvaro Fernández Rojas
2018-02-21 16:10   ` [U-Boot] [RFC v3 02/15] dma: add channels support Álvaro Fernández Rojas
2018-02-22 16:18     ` Simon Glass
2018-02-21 16:10   ` [U-Boot] [RFC v3 03/15] dma: add bcm6348-iudma support Álvaro Fernández Rojas
2018-02-22 19:50     ` Grygorii Strashko
2018-02-22 20:48       ` Álvaro Fernández Rojas
2018-02-23 16:57         ` Grygorii Strashko
2018-03-03  9:06           ` Álvaro Fernández Rojas
2018-02-21 16:10   ` [U-Boot] [RFC v3 04/15] bmips: bcm6338: " Álvaro Fernández Rojas
2018-02-21 16:10   ` [U-Boot] [RFC v3 05/15] bmips: bcm6348: " Álvaro Fernández Rojas
2018-02-21 16:10   ` [U-Boot] [RFC v3 06/15] bmips: bcm6358: " Álvaro Fernández Rojas
2018-02-21 16:10   ` [U-Boot] [RFC v3 07/15] phy: add support for internal phys Álvaro Fernández Rojas
2018-02-21 16:10   ` [U-Boot] [RFC v3 08/15] net: add support for bcm6348-enet Álvaro Fernández Rojas
2018-02-21 16:10   ` [U-Boot] [RFC v3 09/15] bmips: bcm6338: " Álvaro Fernández Rojas
2018-02-21 16:10   ` [U-Boot] [RFC v3 10/15] bmips: enable f@st1704 enet support Álvaro Fernández Rojas
2018-02-21 16:10   ` [U-Boot] [RFC v3 11/15] bmips: bcm6348: add support for bcm6348-enet Álvaro Fernández Rojas
2018-02-21 16:10   ` [U-Boot] [RFC v3 12/15] bmips: enable ct-5361 enet support Álvaro Fernández Rojas
2018-02-21 16:10   ` [U-Boot] [RFC v3 13/15] bmips: bcm6358: add support for bcm6348-enet Álvaro Fernández Rojas
2018-02-21 16:10   ` [U-Boot] [RFC v3 14/15] bmips: enable hg556a enet support Álvaro Fernández Rojas
2018-02-21 16:10   ` [U-Boot] [RFC v3 15/15] bmips: enable nb4-ser " Álvaro Fernández Rojas
2018-03-03  8:59 ` [U-Boot] [RFC v4 00/15] bmips: add bcm6348-enet support Álvaro Fernández Rojas
2018-03-03  8:59   ` Álvaro Fernández Rojas [this message]
2018-03-05 19:38     ` [U-Boot] [RFC v4 01/15] dma: move dma_ops to dma-uclass.h Grygorii Strashko
2018-03-03  8:59   ` [U-Boot] [RFC v4 02/15] dma: add channels support Álvaro Fernández Rojas
2018-03-03  8:59   ` [U-Boot] [RFC v4 03/15] dma: add bcm6348-iudma support Álvaro Fernández Rojas
2018-03-03  8:59   ` [U-Boot] [RFC v4 04/15] bmips: bcm6338: " Álvaro Fernández Rojas
2018-03-03  8:59   ` [U-Boot] [RFC v4 05/15] bmips: bcm6348: " Álvaro Fernández Rojas
2018-03-03  8:59   ` [U-Boot] [RFC v4 06/15] bmips: bcm6358: " Álvaro Fernández Rojas
2018-03-03  8:59   ` [U-Boot] [RFC v4 07/15] phy: add support for internal phys Álvaro Fernández Rojas
2018-03-03  8:59   ` [U-Boot] [RFC v4 08/15] net: add support for bcm6348-enet Álvaro Fernández Rojas
2018-03-03  8:59   ` [U-Boot] [RFC v4 09/15] bmips: bcm6338: " Álvaro Fernández Rojas
2018-03-03  8:59   ` [U-Boot] [RFC v4 10/15] bmips: enable f@st1704 enet support Álvaro Fernández Rojas
2018-03-03  8:59   ` [U-Boot] [RFC v4 11/15] bmips: bcm6348: add support for bcm6348-enet Álvaro Fernández Rojas
2018-03-03  8:59   ` [U-Boot] [RFC v4 12/15] bmips: enable ct-5361 enet support Álvaro Fernández Rojas
2018-03-03  8:59   ` [U-Boot] [RFC v4 13/15] bmips: bcm6358: add support for bcm6348-enet Álvaro Fernández Rojas
2018-03-03  8:59   ` [U-Boot] [RFC v4 14/15] bmips: enable hg556a enet support Álvaro Fernández Rojas
2018-03-03  8:59   ` [U-Boot] [RFC v4 15/15] bmips: enable nb4-ser " Álvaro Fernández Rojas
2018-03-05 20:05 ` [U-Boot] [PATCH v5 00/15] bmips: add bcm6348-enet support Álvaro Fernández Rojas
2018-03-05 20:05   ` [U-Boot] [PATCH v5 01/15] dma: move dma_ops to dma-uclass.h Álvaro Fernández Rojas
2018-03-06 15:10     ` Grygorii Strashko
2018-03-05 20:05   ` [U-Boot] [PATCH v5 02/15] dma: add channels support Álvaro Fernández Rojas
2018-03-07 21:27     ` Joe Hershberger
2018-03-08 19:46       ` Álvaro Fernández Rojas
2018-03-08 23:07     ` Grygorii Strashko
2018-03-09 18:42       ` Álvaro Fernández Rojas
2018-03-11 19:14     ` Daniel Schwierzeck
2018-03-05 20:05   ` [U-Boot] [PATCH v5 03/15] dma: add bcm6348-iudma support Álvaro Fernández Rojas
2018-03-05 20:05   ` [U-Boot] [PATCH v5 04/15] bmips: bcm6338: " Álvaro Fernández Rojas
2018-03-05 20:05   ` [U-Boot] [PATCH v5 05/15] bmips: bcm6348: " Álvaro Fernández Rojas
2018-03-05 20:05   ` [U-Boot] [PATCH v5 06/15] bmips: bcm6358: " Álvaro Fernández Rojas
2018-03-05 20:05   ` [U-Boot] [PATCH v5 07/15] phy: add support for internal phys Álvaro Fernández Rojas
2018-03-07 20:28     ` Joe Hershberger
2018-03-08 19:38       ` Álvaro Fernández Rojas
2018-03-08 20:11         ` Joe Hershberger
2018-03-05 20:05   ` [U-Boot] [PATCH v5 08/15] net: add support for bcm6348-enet Álvaro Fernández Rojas
2018-03-07 21:46     ` Joe Hershberger
2018-03-08 19:50       ` Álvaro Fernández Rojas
2018-03-05 20:05   ` [U-Boot] [PATCH v5 09/15] bmips: bcm6338: " Álvaro Fernández Rojas
2018-03-05 20:05   ` [U-Boot] [PATCH v5 10/15] bmips: enable f@st1704 enet support Álvaro Fernández Rojas
2018-03-05 20:05   ` [U-Boot] [PATCH v5 11/15] bmips: bcm6348: add support for bcm6348-enet Álvaro Fernández Rojas
2018-03-05 20:05   ` [U-Boot] [PATCH v5 12/15] bmips: enable ct-5361 enet support Álvaro Fernández Rojas
2018-03-05 20:05   ` [U-Boot] [PATCH v5 13/15] bmips: bcm6358: add support for bcm6348-enet Álvaro Fernández Rojas
2018-03-05 20:05   ` [U-Boot] [PATCH v5 14/15] bmips: enable hg556a enet support Álvaro Fernández Rojas
2018-03-05 20:05   ` [U-Boot] [PATCH v5 15/15] bmips: enable nb4-ser " Álvaro Fernández Rojas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180303085917.8293-2-noltari@gmail.com \
    --to=noltari@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.