From patchwork Fri Feb 1 12:51:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Padmavathi Venna X-Patchwork-Id: 2079811 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 BFC37DFE75 for ; Fri, 1 Feb 2013 12:56:32 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U1G86-00044R-4t; Fri, 01 Feb 2013 12:54:06 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U1G82-00041y-6T for linux-arm-kernel@lists.infradead.org; Fri, 01 Feb 2013 12:54:03 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MHJ00IBNL5Q3NV0@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 01 Feb 2013 21:53:59 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.123]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 7D.1F.03918.7EABB015; Fri, 01 Feb 2013 21:53:59 +0900 (KST) X-AuditID: cbfee61a-b7f7d6d000000f4e-03-510bbae7d29a Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id AC.1F.03918.6EABB015; Fri, 01 Feb 2013 21:53:58 +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 <0MHJ00DM6L1HSU70@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 01 Feb 2013 21:53:58 +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 V2 1/4] DMA: PL330: Add xlate function Date: Fri, 01 Feb 2013 18:21:53 +0530 Message-id: <1359723116-18173-2-git-send-email-padma.v@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1359723116-18173-1-git-send-email-padma.v@samsung.com> References: <1359723116-18173-1-git-send-email-padma.v@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCLMWRmVeSWpSXmKPExsWyRsSkWvf5Lu5Ag5blvBabHl9jdWD02Lyk PoAxissmJTUnsyy1SN8ugSvj86m9jAVdfBXff79naWC8xN3FyMkhIWAi8W3fJFYIW0ziwr31 bF2MXBxCAksZJQ7f/sEEUzTv2FGoxHRGifbTN1khnK1MEpe69wE5HBxsAjoSLWddQOIiAnMY JZq3z2AEcZgFfjJKvOh7DLZDWMBM4tb9FywgNouAqkTPqi/sIDavgLPEpb9XodYpSByb+hWs nlPAReL+9/nMILYQUM3xievZQYZKCNxmk/g5eQ8bxCABiW+TD7GAXCEhICux6QAzxBxJiYMr brBMYBRewMiwilE0tSC5oDgpPddQrzgxt7g0L10vOT93EyMwDE//eya1g3Flg8UhRgEORiUe 3oLvXIFCrIllxZW5hxglOJiVRHhta7kDhXhTEiurUovy44tKc1KLDzEmAy2fyCwlmpwPjJG8 knhDYxNzU2NTSyMjM1NT0oSVxHkZTz0JEBJITyxJzU5NLUgtgtnCxMEp1cDIcVryxKfM58G5 BqLvFQTvGE28Um12sic+at38L4V8LcfLr734lfBF1oQ7nfP+m1hd74c3ja+FbPG383jOLzTl 5tPj0UuF3txYd/nw5GYv+ylJ906sP7HSdrtW0LRrDwpZHt/hVWFInPvi4ufS5UcnBk9h7478 G2H+QkSB1a9dIdL/xc9Loo4aSizFGYmGWsxFxYkAYhRXOIcCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMIsWRmVeSWpSXmKPExsVy+t9jQd1nu7gDDW7ftbTY9PgaqwOjx+Yl 9QGMUQ2MNhmpiSmpRQqpecn5KZl56bZK3sHxzvGmZgaGuoaWFuZKCnmJuam2Si4+AbpumTlA U5UUyhJzSoFCAYnFxUr6dpgmhIa46VrANEbo+oYEwfUYGaCBhDWMGZ9P7WUs6OKr+P77PUsD 4yXuLkZODgkBE4l5x46yQdhiEhfurQeyuTiEBKYzSrSfvskK4WxlkrjUvQ/I4eBgE9CRaDnr AhIXEZjDKNG8fQYjiMMs8JNR4kXfY1aQUcICZhK37r9gAbFZBFQlelZ9YQexeQWcJS79vcoE sU5B4tjUr2D1nAIuEve/z2cGsYWAao5PXM8+gZF3ASPDKkbR1ILkguKk9FxDveLE3OLSvHS9 5PzcTYzgIH8mtYNxZYPFIUYBDkYlHt6C71yBQqyJZcWVuYcYJTiYlUR4bWu5A4V4UxIrq1KL 8uOLSnNSiw8xJgNdNZFZSjQ5HxiBeSXxhsYm5qbGppYmFiZmlqQJK4nzMp56EiAkkJ5Ykpqd mlqQWgSzhYmDU6qBcfmtq7HfzjH2+V7XO3FW5mzsAZNNHisOXNn7+MOuE6cLrmXvO/qB4/Kc N3NYXjtMebd51sbcjc0KTatM0wqvFwVMVT++nJP1zMrs/+uqbaQmLD0t2v7Bqq7vmPnuV3rd ekf9511L+jPbx8graNX+o5m6vFLa85MErDP7v/x8k+Nr9k5TfhOvqIYSS3FGoqEWc1FxIgCD mj7YtgIAAA== 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-20130201_075402_490693_ABE7FF32 X-CRM114-Status: GOOD ( 10.57 ) 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.24 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 | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 80680ee..6196cc0 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 @@ -606,6 +607,11 @@ struct dma_pl330_desc { struct dma_pl330_chan *pchan; }; +struct dma_pl330_filter_args { + struct dma_pl330_dmac *pdmac; + unsigned int chan_id; +}; + static inline void _callback(struct pl330_req *r, enum pl330_op_err err) { if (r && r->xfer_cb) @@ -2352,6 +2358,31 @@ static void dma_pl330_rqcb(void *token, enum pl330_op_err err) tasklet_schedule(&pch->task); } +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_filter, &fargs); +} +EXPORT_SYMBOL_GPL(of_dma_pl330_xlate); + bool pl330_filter(struct dma_chan *chan, void *param) { u8 *peri_id;