From patchwork Fri Aug 26 08:40:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas.abraham@linaro.org X-Patchwork-Id: 3711 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id AD61523FA6 for ; Fri, 26 Aug 2011 08:40:47 +0000 (UTC) Received: from mail-gw0-f52.google.com (mail-gw0-f52.google.com [74.125.83.52]) by fiordland.canonical.com (Postfix) with ESMTP id 6C5B9A1854D for ; Fri, 26 Aug 2011 08:40:45 +0000 (UTC) Received: by mail-gw0-f52.google.com with SMTP id 15so3656975gwj.11 for ; Fri, 26 Aug 2011 01:40:45 -0700 (PDT) Received: by 10.151.122.13 with SMTP id z13mr1931884ybm.269.1314348045204; Fri, 26 Aug 2011 01:40:45 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.151.27.20 with SMTP id e20cs274311ybj; Fri, 26 Aug 2011 01:40:45 -0700 (PDT) Received: by 10.236.191.170 with SMTP id g30mr4616145yhn.117.1314348044906; Fri, 26 Aug 2011 01:40:44 -0700 (PDT) Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by mx.google.com with ESMTP id u45si5387565yhu.133.2011.08.26.01.40.44; Fri, 26 Aug 2011 01:40:44 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.24 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.24; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.24 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm2.samsung.com (mailout1.samsung.com [203.254.224.24]) by mailout1.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LQJ007FB1FIWAR0@mailout1.samsung.com> for patches@linaro.org; Fri, 26 Aug 2011 17:40:43 +0900 (KST) X-AuditID: cbfee61b-b7b7fae000005864-50-4e575c0b7c5c Received: from epmmp1 ( [203.254.227.16]) by epcpsbgm2.samsung.com (MMPCPMTA) with SMTP id 13.60.22628.B0C575E4; Fri, 26 Aug 2011 17:40:43 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LQJ005J71FB2H@mmp1.samsung.com> for patches@linaro.org; Fri, 26 Aug 2011 17:40:44 +0900 (KST) Date: Fri, 26 Aug 2011 14:10:13 +0530 From: Thomas Abraham Subject: [PATCH 5/6] ARM: SAMSUNG: Add device tree support for pl330 dma engine wrappers In-reply-to: <1314348014-2481-5-git-send-email-thomas.abraham@linaro.org> To: devicetree-discuss@lists.ozlabs.org Cc: grant.likely@secretlab.ca, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com, vinod.koul@intel.com, patches@linaro.org, jassisinghbrar@gmail.com, boojin.kim@samsung.com Message-id: <1314348014-2481-6-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 Content-transfer-encoding: 7BIT References: <1314348014-2481-1-git-send-email-thomas.abraham@linaro.org> <1314348014-2481-2-git-send-email-thomas.abraham@linaro.org> <1314348014-2481-3-git-send-email-thomas.abraham@linaro.org> <1314348014-2481-4-git-send-email-thomas.abraham@linaro.org> <1314348014-2481-5-git-send-email-thomas.abraham@linaro.org> X-Brightmail-Tracker: AAAAAA== A new dma request id 'DMACH_DT_PROP' is introduced for client drivers requesting a dma channel. This request indicates that a device tree node property represting the dma channel is available in 'struct samsung_dma_info'. The dma channel request wrapper uses the node property value as the value for the filter parameter. Signed-off-by: Thomas Abraham --- arch/arm/plat-samsung/dma-ops.c | 9 ++++++++- arch/arm/plat-samsung/include/plat/dma-ops.h | 1 + arch/arm/plat-samsung/include/plat/dma-pl330.h | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-samsung/dma-ops.c b/arch/arm/plat-samsung/dma-ops.c index 8d18425..b1135dd 100644 --- a/arch/arm/plat-samsung/dma-ops.c +++ b/arch/arm/plat-samsung/dma-ops.c @@ -23,11 +23,18 @@ static unsigned samsung_dmadev_request(enum dma_ch dma_ch, struct dma_chan *chan; dma_cap_mask_t mask; struct dma_slave_config slave_config; + void *filter_param; dma_cap_zero(mask); dma_cap_set(info->cap, mask); - chan = dma_request_channel(mask, pl330_filter, (void *)dma_ch); + /* + * If a dma channel property of a device node from device tree is + * specified, use that as the fliter parameter. + */ + filter_param = (dma_ch == DMACH_DT_PROP) ? (void *)info->dt_dmach_prop : + (void *)dma_ch; + chan = dma_request_channel(mask, pl330_filter, filter_param); if (info->direction == DMA_FROM_DEVICE) { memset(&slave_config, 0, sizeof(struct dma_slave_config)); diff --git a/arch/arm/plat-samsung/include/plat/dma-ops.h b/arch/arm/plat-samsung/include/plat/dma-ops.h index 4c1a363..22eafc3 100644 --- a/arch/arm/plat-samsung/include/plat/dma-ops.h +++ b/arch/arm/plat-samsung/include/plat/dma-ops.h @@ -31,6 +31,7 @@ struct samsung_dma_info { enum dma_slave_buswidth width; dma_addr_t fifo; struct s3c2410_dma_client *client; + struct property *dt_dmach_prop; }; struct samsung_dma_ops { diff --git a/arch/arm/plat-samsung/include/plat/dma-pl330.h b/arch/arm/plat-samsung/include/plat/dma-pl330.h index 2e55e59..c5eaad5 100644 --- a/arch/arm/plat-samsung/include/plat/dma-pl330.h +++ b/arch/arm/plat-samsung/include/plat/dma-pl330.h @@ -21,7 +21,8 @@ * use these just as IDs. */ enum dma_ch { - DMACH_UART0_RX, + DMACH_DT_PROP = -1, + DMACH_UART0_RX = 0, DMACH_UART0_TX, DMACH_UART1_RX, DMACH_UART1_TX,