From patchwork Wed Feb 6 06:18:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Padmavathi Venna X-Patchwork-Id: 2102171 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 66B67DFE82 for ; Wed, 6 Feb 2013 06:21:38 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U2yLJ-0003dX-AQ; Wed, 06 Feb 2013 06:18:49 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U2yL0-0003aK-Vo for linux-arm-kernel@lists.infradead.org; Wed, 06 Feb 2013 06:18:32 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MHS00ESTC6I63N0@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 06 Feb 2013 15:18:28 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.124]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id D9.1F.03880.3B5F1115; Wed, 06 Feb 2013 15:18:27 +0900 (KST) X-AuditID: cbfee61b-b7fb06d000000f28-80-5111f5b3a576 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 09.1F.03880.3B5F1115; Wed, 06 Feb 2013 15:18:27 +0900 (KST) Received: from padma-linuxpc.sisodomain.com ([107.108.83.35]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MHS001KWC6CC970@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 06 Feb 2013 15:18:27 +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 V3 2/5] DMA: PL330: Add xlate function Date: Wed, 06 Feb 2013 11:48:46 +0530 Message-id: <1360131529-2847-3-git-send-email-padma.v@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1360131529-2847-1-git-send-email-padma.v@samsung.com> References: <1360131529-2847-1-git-send-email-padma.v@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrELMWRmVeSWpSXmKPExsWyRsSkRnfzV8FAg433rC02Pb7G6sDosXlJ fQBjFJdNSmpOZllqkb5dAlfG4ovVBZ08FXOaHjI1MHZwdTFyckgImEh8+XeTEcIWk7hwbz1b FyMXh5DAUkaJf1fPssEUHfg5ixkisYhRYvXay+wQzlYmiRtPNgNlODjYBHQkWs66gMRFBOYw SjRvn8EI4jAL/GSUeNH3mBVklLCAmcTh7QvZQWwWAVWJb7OXsYDYvAJOEosmn2CGWKcgcWzq V7B6TgFniWUdfWD3CQHVvFx7nRWi5jqbxL91CRBzBCS+TT7EAnKEhICsxKYDUGMkJQ6uuMEy gVF4ASPDKkbR1ILkguKk9FwjveLE3OLSvHS95PzcTYzAEDz975n0DsZVDRaHGAU4GJV4eG/o CQYKsSaWFVfmHmKU4GBWEuG1/QwU4k1JrKxKLcqPLyrNSS0+xJgMtHwis5Rocj4wPvJK4g2N TcxNjU0tjYzMTE1JE1YS52U89SRASCA9sSQ1OzW1ILUIZgsTB6dUA6P46YLWC5ff6G52Ek19 f1QxwnGDxYvD85Kq5zk3TrsgKS1nPo9jkoH3/xPMUV0rGh86Li58Od1rXTjH7CP13Qfk1h0O zCzn4PZIEmv6xaQ8a1/MwnUf5zMYHI84aVu1nI3dXfuaLkvM1q+rPJICuba4/tK7epRl5+0D sb8vT+VekztP+kJhT74SS3FGoqEWc1FxIgAWcjLPhQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEIsWRmVeSWpSXmKPExsVy+t9jAd3NXwUDDU6+N7DY9PgaqwOjx+Yl 9QGMUQ2MNhmpiSmpRQqpecn5KZl56bZK3sHxzvGmZgaGuoaWFuZKCnmJuam2Si4+AbpumTlA U5UUyhJzSoFCAYnFxUr6dpgmhIa46VrANEbo+oYEwfUYGaCBhDWMGYsvVhd08lTMaXrI1MDY wdXFyMkhIWAiceDnLGYIW0ziwr31bF2MXBxCAosYJVavvcwO4WxlkrjxZDNQFQcHm4CORMtZ F5C4iMAcRonm7TMYQRxmgZ+MEi/6HrOCjBIWMJM4vH0hO4jNIqAq8W32MhYQm1fASWLR5BNQ 6xQkjk39ClbPKeAssayjjxHEFgKqebn2OusERt4FjAyrGEVTC5ILipPSc430ihNzi0vz0vWS 83M3MYJD/Jn0DsZVDRaHGAU4GJV4eG/oCQYKsSaWFVfmHmKU4GBWEuG1/QwU4k1JrKxKLcqP LyrNSS0+xJgMdNVEZinR5Hxg/OWVxBsam5ibGptamliYmFmSJqwkzst46kmAkEB6Yklqdmpq QWoRzBYmDk6pBsaGjkX+08P//rT+Zldm+nRdy61Fz5eESL+NrOn6yBX+9prZvMTtmlohd/z2 nn6s+OZcqQuXde+077LHZhxv31t0XH5thRdbhfC1rjfdB3XD+Wf4s82f0d5luU7WcoHhwRcr r0Xek/hz8qCWzyX1jwyb9926Jnd+0lylwPLzG2ddqWJqmmTSI96pxFKckWioxVxUnAgA4ivP O7UCAAA= 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-20130206_011831_287136_D56B49AB X-CRM114-Status: UNSURE ( 9.69 ) X-CRM114-Notice: Please train this message. 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.33 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 87110f2..e68c83b 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);