From patchwork Fri Feb 6 08:47:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 437095 X-Patchwork-Delegate: l.majewski@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 24DA71402A0 for ; Fri, 6 Feb 2015 19:49:55 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C88914B72A; Fri, 6 Feb 2015 09:49:26 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sjKxzkS4f5jJ; Fri, 6 Feb 2015 09:49:26 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 631A44B7DD; Fri, 6 Feb 2015 09:49:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E7A3F4B779 for ; Fri, 6 Feb 2015 09:49:14 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vUpIm4LAjE_P for ; Fri, 6 Feb 2015 09:49:14 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by theia.denx.de (Postfix) with ESMTPS id 55E1C4B7BF for ; Fri, 6 Feb 2015 09:49:11 +0100 (CET) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id t168n8cw031542; Fri, 6 Feb 2015 02:49:08 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t168n7hS030914; Fri, 6 Feb 2015 02:49:07 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Fri, 6 Feb 2015 02:49:06 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t168mN0c007034; Fri, 6 Feb 2015 02:49:04 -0600 From: Kishon Vijay Abraham I To: , , , , , , Date: Fri, 6 Feb 2015 14:17:50 +0530 Message-ID: <1423212497-11970-14-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1423212497-11970-1-git-send-email-kishon@ti.com> References: <1423212497-11970-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 Cc: nsekhar@ti.com, kishon@ti.com Subject: [U-Boot] [u-boot 13/40] arm: asm: dma-mapping: added dma_free_coherent API X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" Added dma_free_coherent corresponding to the dma_alloc_coherent in dma-mapping.h in order to free memory allocated using dma_alloc_coherent. This API is used in dwc3 driver. Signed-off-by: Kishon Vijay Abraham I Reviewed-by: Lukasz Majewski --- arch/arm/include/asm/dma-mapping.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index 14f00efd2..a5821f5 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h @@ -8,6 +8,8 @@ #ifndef __ASM_ARM_DMA_MAPPING_H #define __ASM_ARM_DMA_MAPPING_H +#define dma_mapping_error(x, y) 0 + enum dma_data_direction { DMA_BIDIRECTIONAL = 0, DMA_TO_DEVICE = 1, @@ -20,6 +22,11 @@ static inline void *dma_alloc_coherent(size_t len, unsigned long *handle) return (void *)*handle; } +static inline void dma_free_coherent(void *addr) +{ + free(addr); +} + static inline unsigned long dma_map_single(volatile void *vaddr, size_t len, enum dma_data_direction dir) {