From patchwork Thu Sep 1 09:04:41 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: 3826 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 53C3F23F22 for ; Thu, 1 Sep 2011 09:05:07 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 48F46A18587 for ; Thu, 1 Sep 2011 09:05:07 +0000 (UTC) Received: by mail-fx0-f52.google.com with SMTP id 18so721928fxd.11 for ; Thu, 01 Sep 2011 02:05:07 -0700 (PDT) Received: by 10.223.76.201 with SMTP id d9mr1374461fak.119.1314867907161; Thu, 01 Sep 2011 02:05:07 -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.152.11.8 with SMTP id m8cs44983lab; Thu, 1 Sep 2011 02:05:07 -0700 (PDT) Received: by 10.90.19.10 with SMTP id 10mr1145818ags.133.1314867906066; Thu, 01 Sep 2011 02:05:06 -0700 (PDT) Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by mx.google.com with ESMTP id s3si533123anh.62.2011.09.01.02.05.05; Thu, 01 Sep 2011 02:05:06 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.34; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm1.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LQU00KZF6K5OK50@mailout4.samsung.com> for patches@linaro.org; Thu, 01 Sep 2011 18:05:04 +0900 (KST) X-AuditID: cbfee61a-b7cf1ae00000208e-71-4e5f4ac0855f Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id AE.39.08334.0CA4F5E4; Thu, 01 Sep 2011 18:05:04 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp2.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LQU001MY6JYD0@mmp2.samsung.com> for patches@linaro.org; Thu, 01 Sep 2011 18:05:04 +0900 (KST) Date: Thu, 01 Sep 2011 14:34:41 +0530 From: Thomas Abraham Subject: [PATCH v2 5/6] ARM: SAMSUNG: Add device tree support for pl330 dma engine wrappers In-reply-to: <1314867882-11755-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, robherring2@gmail.com, vinod.koul@intel.com, patches@linaro.org, jassisinghbrar@gmail.com, boojin.kim@samsung.com Message-id: <1314867882-11755-6-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 Content-transfer-encoding: 7BIT References: <1314867882-11755-1-git-send-email-thomas.abraham@linaro.org> <1314867882-11755-2-git-send-email-thomas.abraham@linaro.org> <1314867882-11755-3-git-send-email-thomas.abraham@linaro.org> <1314867882-11755-4-git-send-email-thomas.abraham@linaro.org> <1314867882-11755-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,