From patchwork Thu Feb 14 03:40:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Padmavathi Venna X-Patchwork-Id: 2140221 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 57FB6DF283 for ; Thu, 14 Feb 2013 03:42:53 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U5pgE-0006NM-U7; Thu, 14 Feb 2013 03:40:14 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U5pfs-0006KN-US for linux-arm-kernel@lists.infradead.org; Thu, 14 Feb 2013 03:39:54 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MI6001GZY5Z1UD0@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 14 Feb 2013 12:39:47 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.126]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 55.35.03918.38C5C115; Thu, 14 Feb 2013 12:39:47 +0900 (KST) X-AuditID: cbfee61a-b7f7d6d000000f4e-d7-511c5c837e2c Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 54.35.03918.38C5C115; Thu, 14 Feb 2013 12:39:47 +0900 (KST) Received: from padma-linuxpc.sisodomain.com ([107.108.83.35]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MI600N0PY5X1F30@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 14 Feb 2013 12:39:47 +0900 (KST) From: Padmavathi Venna To: linux-samsung-soc@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, padma.v@samsung.com, padma.kvr@gmail.com Subject: [PATCH V4 2/4] DMA: PL330: Add xlate function Date: Thu, 14 Feb 2013 09:10:06 +0530 Message-id: <1360813208-9498-3-git-send-email-padma.v@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1360813208-9498-1-git-send-email-padma.v@samsung.com> References: <1360813208-9498-1-git-send-email-padma.v@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMLMWRmVeSWpSXmKPExsWyRsSkTrc5RibQYNsUE4tNj6+xOjB6bF5S H8AYxWWTkpqTWZZapG+XwJXxcuZlxoJOnoqfPx4wNTB2cHUxcnJICJhItJ1tZYawxSQu3FvP BmILCSxllLjVXQVTs75nHnsXIxdQfDqjxM8ni1ggnK1MEn9/dQM5HBxsAjoSLWddQOIiAnMY JZq3z2AEcZgFJjBJTFy0mh1klLCAmcSKjqtg61gEVCW+d3eDreMVcJL4eGU7C8Q6BYljU7+y gticAs4Sp7acZoI4yUni3Y0uJpChEgLX2ST+7z4PNUhA4tvkQ2BXSAjISmw6APWOpMTBFTdY JjAKL2BkWMUomlqQXFCclJ5rqFecmFtcmpeul5yfu4kRGISn/z2T2sG4ssHiEKMAB6MSD6/i L+lAIdbEsuLK3EOMEhzMSiK8LwNlAoV4UxIrq1KL8uOLSnNSiw8xJgMtn8gsJZqcD4yQvJJ4 Q2MTc1NjU0sjIzNTU9KElcR5GU89CRASSE8sSc1OTS1ILYLZwsTBKdXA6GXl4vLPUY0rv6Ik ZtbFy5cTLi3Oa/zM/uXNdjWeH1Xv3b9fNxDOmizVeOzny46l0vurtVunLtx35dffXYen3lgu xRT8etPS//kdVu07Xps/3Jp6av/i+dYrHi2fcMs5nOGTcVk7ywSvnC9L3zzxkC53/+PvpSLZ rea8VFW5q/27yN6bjjsudSmxFGckGmoxFxUnAgBwJVWOhgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMIsWRmVeSWpSXmKPExsVy+t9jQd3mGJlAg3+dmhabHl9jdWD02Lyk PoAxqoHRJiM1MSW1SCE1Lzk/JTMv3VbJOzjeOd7UzMBQ19DSwlxJIS8xN9VWycUnQNctMwdo qpJCWWJOKVAoILG4WEnfDtOE0BA3XQuYxghd35AguB4jAzSQsIYx4+XMy4wFnTwVP388YGpg 7ODqYuTkkBAwkVjfM48dwhaTuHBvPVsXIxeHkMB0RomfTxaxQDhbmST+/uoGcjg42AR0JFrO uoDERQTmMEo0b5/BCOIwC0xgkpi4aDXYKGEBM4kVHVeZQWwWAVWJ793dbCA2r4CTxMcr21kg 1ilIHJv6lRXE5hRwlji15TQTiC0EVPPuRhfTBEbeBYwMqxhFUwuSC4qT0nMN9YoTc4tL89L1 kvNzNzGCg/yZ1A7GlQ0WhxgFOBiVeHgVf0kHCrEmlhVX5h5ilOBgVhLhfRkoEyjEm5JYWZVa lB9fVJqTWnyIMRnoqonMUqLJ+cAIzCuJNzQ2MTc1NrU0sTAxsyRNWEmcl/HUkwAhgfTEktTs 1NSC1CKYLUwcnFINjAKypgeu6OxszTOISykX6frPM+usbH5A3C7LUD4l75f+bVFCP7TKL5im VTy5FGJ4eadQJXuNgvDJPAGGgvcbJF4yvdpwQ5Xj4q2OEwzMt/kPxa81e+1jMr/+9MpVPGpL g3x/dV9tnPTgmZOwqdvaCfV2bW2WXQfutbYvf5MuXWMyeT2PEuNsJZbijERDLeai4kQAZ7Kf M7YCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130213_223953_268976_5F025F27 X-CRM114-Status: GOOD ( 10.29 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.34 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: jassisinghbrar@gmail.com, kgene.kim@samsung.com, arnd@arndb.de, boojin.kim@samsung.com, sbkim73@samsung.com, broonie@opensource.wolfsonmicro.com, grant.likely@secretlab.ca, vinod.koul@intel.com, thomas.abraham@linaro.org, jon-hunter@ti.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add xlate to translate the device-tree binding information into the appropriate format. The filter function requires the dma controller device and dma channel number as filter_params. Signed-off-by: Padmavathi Venna Acked-by: Arnd Bergmann --- drivers/dma/pl330.c | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 40e9752..f5d47e6 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "dmaengine.h" #define PL330_MAX_CHAN 8 @@ -2379,6 +2380,30 @@ bool pl330_filter(struct dma_chan *chan, void *param) } EXPORT_SYMBOL(pl330_filter); +static struct dma_chan *of_dma_pl330_xlate(struct of_phandle_args *dma_spec, + struct of_dma *ofdma) +{ + int count = dma_spec->args_count; + struct dma_pl330_dmac *pdmac = ofdma->of_dma_data; + struct dma_pl330_filter_args fargs; + dma_cap_mask_t cap; + + if (!pdmac) + return NULL; + + if (count != 1) + return NULL; + + fargs.pdmac = pdmac; + fargs.chan_id = dma_spec->args[0]; + + dma_cap_zero(cap); + dma_cap_set(DMA_SLAVE, cap); + dma_cap_set(DMA_CYCLIC, cap); + + return dma_request_channel(cap, pl330_dt_filter, &fargs); +} + static int pl330_alloc_chan_resources(struct dma_chan *chan) { struct dma_pl330_chan *pch = to_pchan(chan);