From patchwork Sat Nov 10 21:06:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 150747 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1412348ljp; Sat, 10 Nov 2018 13:07:02 -0800 (PST) X-Google-Smtp-Source: AJdET5c2OkcGZimgGIfymEuiIMJf3L6EQVaNk8rQlxB2BoNzKuv2QKm/jnpGEJv1JQ7zbxKYYZNP X-Received: by 2002:a17:906:1ba1:: with SMTP id r1-v6mr5332064ejg.116.1541884022508; Sat, 10 Nov 2018 13:07:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541884022; cv=none; d=google.com; s=arc-20160816; b=ukEMPqUCqzBlhcdqb6qhD0CqbFrC0rWTzmlDCnv+ZjZU+HF+iI/ZuHCidtujdWlu4z BWcl4+PcLDo1fwUXB1d8jeXGd4Ve/fTGLml+GAZ29ICYrRXrrcIHb16Hj676PI5JqdHv 4HC8ADk9o7obBiP3QXEPjaVXQcplZibcOnoN+gOVgoSiMs3IaddwNXU8HnbI4P1QKSCg nTI+ok/UrkPZgS6PcT4Jnt2hJq6zCjyv9xH3DN47iEnYyWZMvd5LX3HuUl3+keGLQfbp fVJTKBZCHANg5c4GQLHtvTYKizMV9SYg5Q0Rxl+1CuHB0ZEXaCpJ+eKefP3y1jPPYylv fndg== 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=U6oi+A6b57RhXaOzi7d8cs9gJXNMESbtDJMCR035WFQ=; b=FFgJxlFMaSeRKBAgO1D+QufW/FmnXU5Bq196IxbhdF+k+sEHxYarTfHHDiGCKDm4MY PhdjVyx+/BsNfCJw4vj0oMpwlIOb7fHgyly62cfKgwAu+dWxrPSrbnpcQcQnQyix8oLt ezHNynKChdfhoeEhrPryyJxI0E1o7yaJMmW6TQAYc6v1yyPBWm6mBn6JlY4bTZJW0ssY WwSQ75e95u/9Qtlhy576WxKx3gPx4HTfL9mv2R72BrS1ddOMeiPONtiVT8J50vxGS0wk UebtGK/auyfIIhVf5xGwONbcbU0bkTGt7nifVrXOYaTWCmH9U3ySXAYLPgmHrtPRdGaA Kstg== 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 i13si787168edx.304.2018.11.10.13.07.01; Sat, 10 Nov 2018 13:07:02 -0800 (PST) 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 5E3C5C222B7; Sat, 10 Nov 2018 21:06:59 +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 116C9C21F03; Sat, 10 Nov 2018 21:06:56 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 22A61C21FCA; Sat, 10 Nov 2018 21:06:54 +0000 (UTC) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lists.denx.de (Postfix) with ESMTPS id 797FCC21C38 for ; Sat, 10 Nov 2018 21:06:53 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id wAAL6psF088646; Sat, 10 Nov 2018 15:06:51 -0600 Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wAAL6p11008891 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 10 Nov 2018 15:06:51 -0600 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Sat, 10 Nov 2018 15:06:50 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Sat, 10 Nov 2018 15:06:50 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id wAAL6oEN006679; Sat, 10 Nov 2018 15:06:50 -0600 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 wAAL6ox25833; Sat, 10 Nov 2018 15:06:50 -0600 (CST) From: Grygorii Strashko To: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= , Joe Hershberger , Lokesh Vutla , Tom Rini , Simon Glass Date: Sat, 10 Nov 2018 15:06:45 -0600 Message-ID: <20181110210649.8992-2-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.10.5 In-Reply-To: <20181110210649.8992-1-grygorii.strashko@ti.com> References: <20181110210649.8992-1-grygorii.strashko@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: Jagan Teki , u-boot@lists.denx.de Subject: [U-Boot] [PATCH v7 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: Tom Rini Reviewed-by: Simon Glass Signed-off-by: Álvaro Fernández Rojas Signed-off-by: Grygorii Strashko --- 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..7bec5d3 --- /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) 2015 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