From patchwork Mon Oct 22 21:24:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 149401 Delivered-To: patch@linaro.org Received: by 2002:a2e:29db:0:0:0:0:0 with SMTP id p88-v6csp152742ljp; Mon, 22 Oct 2018 14:25:11 -0700 (PDT) X-Google-Smtp-Source: ACcGV60nFm0dSYAsj4h5F2TuW+eQXmpwugUkAYS1/cBRuyrOSSgAAwJ4rzs94psL6FFzOfOasJNj X-Received: by 2002:a17:906:3010:: with SMTP id 16-v6mr37151759ejz.4.1540243511233; Mon, 22 Oct 2018 14:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540243511; cv=none; d=google.com; s=arc-20160816; b=qP08uMkQPloUnnTht/GRKPgCRdIFU3cdMLI84IT6KD014vqLpN/Nnjp52kLYW024Yl fGV/PaNH1fjaJc6gOlRZVYJvNpom7Rht91YuS+d8BlBgc64pwQ1DoXMUmeOemQKsDlCe Kv5TwoxvU4cmV60ZiHu+igDUrknibcx090DRuckNsHs/EJMUY/wrivfhBhGE+2u6yicf 5Kw93ozOuRu3W58mhglyfCPR5BIrb4DuORZ5AQ2bVktwYjmjRwVul9eBPNcb32t62qZP gEjROf5socwoHhzJBgVLAMfhIxMBRHIy1RsWvdC9T0hEnoith2aV6Ov32b6LV4tY/Bwx xEXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from; bh=yg483zs8kEeBzhnYFbnJVln1PqUVtEJgyBdVGtckepo=; b=hRgdJO3TjsiGNpnYKyMj5fCF/sX6EWrjE+l+6kUNXp9GIz9Dmt4E7n2OxEqWGyNzWg o9qH7Mp8k6qxXgy8P8nYs+fNbC/v/Agty4Pj+DyrMcbpVz9aiwd6ssN898Lu6ABxC+bn Z9/2eOEVfiCnZRAVs752aOw0gPL7j+BN9WLjkOps0p2CW1mU/okfKpGfJreDGBFpfrb7 VdHdqe5CTZuPmtScKZR0+gzlPJdfJk4JpkPfDqkVzAeM2UanRtYOzwgTwceDzbanmQHa xjROS79gFl59q9gxsAvxtMIyIpgR0KJQ+bufYfUJDZwI5M7eDWlzOJRAKL/6HoVNboYz r+OQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id z14-v6si3194795edx.446.2018.10.22.14.25.11; Mon, 22 Oct 2018 14:25:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: by lists.denx.de (Postfix, from userid 105) id C7B16C21E4F; Mon, 22 Oct 2018 21:25:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id CA577C21DF3; Mon, 22 Oct 2018 21:25:06 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A1F24C21DF3; Mon, 22 Oct 2018 21:25:05 +0000 (UTC) Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lists.denx.de (Postfix) with ESMTPS id 083A4C21C27 for ; Mon, 22 Oct 2018 21:25:04 +0000 (UTC) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id w9MLP2Ph092755; Mon, 22 Oct 2018 16:25:02 -0500 Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id w9MLP2WY080565 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 22 Oct 2018 16:25:02 -0500 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 22 Oct 2018 16:25:02 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Mon, 22 Oct 2018 16:25:02 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w9MLP26g009090; Mon, 22 Oct 2018 16:25:02 -0500 Received: from localhost (uda0226610.dhcp.ti.com [128.247.59.147]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id w9MLP2x06947; Mon, 22 Oct 2018 16:25:02 -0500 (CDT) From: Grygorii Strashko To: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= , Joe Hershberger , Tom Rini , Simon Glass Date: Mon, 22 Oct 2018 16:24:56 -0500 Message-ID: <20181022212500.17162-2-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.10.5 In-Reply-To: <20181022212500.17162-1-grygorii.strashko@ti.com> References: <20181022212500.17162-1-grygorii.strashko@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: u-boot@lists.denx.de, Jagan Teki Subject: [U-Boot] [PATCH v6 1/5] dma: move dma_ops to dma-uclass.h X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Álvaro Fernández Rojas Move dma_ops to a separate header file, following other uclass implementations. While doing so, this patch also improves dma_ops documentation. Reviewed-by: Simon Glass Signed-off-by: Álvaro Fernández Rojas Reviewed-by: Tom Rini --- drivers/dma/dma-uclass.c | 2 +- drivers/dma/ti-edma3.c | 2 +- include/dma-uclass.h | 39 +++++++++++++++++++++++++++++++++++++++ include/dma.h | 22 ---------------------- 4 files changed, 41 insertions(+), 24 deletions(-) create mode 100644 include/dma-uclass.h diff --git a/drivers/dma/dma-uclass.c b/drivers/dma/dma-uclass.c index a33f7d5..6c3506c 100644 --- a/drivers/dma/dma-uclass.c +++ b/drivers/dma/dma-uclass.c @@ -9,10 +9,10 @@ */ #include -#include #include #include #include +#include #include int dma_get_device(u32 transfer_type, struct udevice **devp) diff --git a/drivers/dma/ti-edma3.c b/drivers/dma/ti-edma3.c index 2131e10..7e11b13 100644 --- a/drivers/dma/ti-edma3.c +++ b/drivers/dma/ti-edma3.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include diff --git a/include/dma-uclass.h b/include/dma-uclass.h new file mode 100644 index 0000000..c9308c8 --- /dev/null +++ b/include/dma-uclass.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2018 Álvaro Fernández Rojas + * Copyright (C) 2018 Texas Instruments Incorporated + * Written by Mugunthan V N + * + */ + +#ifndef _DMA_UCLASS_H +#define _DMA_UCLASS_H + +/* See dma.h for background documentation. */ + +#include + +/* + * 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 50e9652..97fa0cf 100644 --- a/include/dma.h +++ b/include/dma.h @@ -27,28 +27,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