From patchwork Mon Feb 23 13:09:56 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: 442482 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 0D27F14012C for ; Tue, 24 Feb 2015 00:20:45 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5DC9A4B6A7; Mon, 23 Feb 2015 14:18: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 UTNgPKxNsdAY; Mon, 23 Feb 2015 14:18:14 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DB5A14B61E; Mon, 23 Feb 2015 14:18:13 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 04E4B4A047 for ; Mon, 23 Feb 2015 14:11:34 +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 AYq0pWZoAO9P for ; Mon, 23 Feb 2015 14:11:33 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 IX_MANITU=ERR(0) (only DNSBL check requested) Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by theia.denx.de (Postfix) with ESMTPS id 6D2054A03C for ; Mon, 23 Feb 2015 14:11:09 +0100 (CET) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id t1NDB6kV019594; Mon, 23 Feb 2015 07:11:06 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t1NDB5FC030819; Mon, 23 Feb 2015 07:11:05 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Mon, 23 Feb 2015 07:11:05 -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 t1NDAQg3012678; Mon, 23 Feb 2015 07:11:03 -0600 From: Kishon Vijay Abraham I To: , , , Date: Mon, 23 Feb 2015 18:39:56 +0530 Message-ID: <1424697023-26696-14-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1424697023-26696-1-git-send-email-kishon@ti.com> References: <1424697023-26696-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 Cc: kishon@ti.com, nsekhar@ti.com, rogerq@ti.com Subject: [U-Boot] [u-boot PATCH v2 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) {