From patchwork Mon Feb 11 08:38:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Padmavathi Venna X-Patchwork-Id: 2123551 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 175E7E00C6 for ; Mon, 11 Feb 2013 08:40:40 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U4ouD-0006FD-Qw; Mon, 11 Feb 2013 08:38:29 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U4otp-0006AV-7y for linux-arm-kernel@lists.infradead.org; Mon, 11 Feb 2013 08:38:06 +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 <0MI100KHFRZ14B30@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 11 Feb 2013 17:38:01 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.126]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id CC.E0.03918.9EDA8115; Mon, 11 Feb 2013 17:38:01 +0900 (KST) X-AuditID: cbfee61a-b7f7d6d000000f4e-de-5118ade959c9 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id DB.E0.03918.8EDA8115; Mon, 11 Feb 2013 17:38:00 +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 <0MI1001YDRZ0HC30@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 11 Feb 2013 17:38:00 +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/5] DMA: PL330: Add xlate function Date: Mon, 11 Feb 2013 14:08:22 +0530 Message-id: <1360571905-15285-3-git-send-email-padma.v@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1360571905-15285-1-git-send-email-padma.v@samsung.com> References: <1360571905-15285-1-git-send-email-padma.v@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrILMWRmVeSWpSXmKPExsWyRsSkTvflWolAgyvHOSw2Pb7G6sDosXlJ fQBjFJdNSmpOZllqkb5dAlfG4ovVBZ08FXOaHjI1MHZwdTFyckgImEj8nb2dFcIWk7hwbz1b FyMXh5DAUkaJi6sWscAUHZy/jBnEFhJYxCix4RGUvZVJYukeni5GDg42AR2JlrMuIL0iAnMY JZq3z2AEcZgFJjBJTFy0mh2kQVjATKJ/UivYNhYBVYnFC+6DxXkFnCV+TdvHBLFMQeLY1K9g NZwCLhIrD91khVjmLHHs7BGw6yQELrNJdNy6ygQxSEDi2+RDLCBXSAjISmw6wAwxR1Li4Iob LBMYhRcwMqxiFE0tSC4oTkrPNdQrTswtLs1L10vOz93ECAzA0/+eSe1gXNlgcYhRgINRiYc3 IFQiUIg1say4MvcQowQHs5II7/FD4oFCvCmJlVWpRfnxRaU5qcWHGJOBlk9klhJNzgdGR15J vKGxibmpsamlkZGZqSlpwkrivIynngQICaQnlqRmp6YWpBbBbGHi4JRqYAxUeeLy/jBn0pNV mnL3hP5JZauvM2iSvjddfXGa0MasiDeatzU298d+lUuyN9wndGKhQyKn9swLPsuzcplal9zc 9eVM6AnWtoAZZ5Icn879ZLjKdS3nwX/+89win/7+5W+55V5dz//ZnoJCJh1vIt8bdP76LaRQ o71rwfzHMhLXTjvd829++0aJpTgj0VCLuag4EQCQZxNuhAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrAIsWRmVeSWpSXmKPExsVy+t9jAd0XayUCDT69s7LY9PgaqwOjx+Yl 9QGMUQ2MNhmpiSmpRQqpecn5KZl56bZK3sHxzvGmZgaGuoaWFuZKCnmJuam2Si4+AbpumTlA U5UUyhJzSoFCAYnFxUr6dpgmhIa46VrANEbo+oYEwfUYGaCBhDWMGYsvVhd08lTMaXrI1MDY wdXFyMkhIWAicXD+MmYIW0ziwr31bCC2kMAiRokNj5gh7K1MEkv38HQxcnCwCehItJx16WLk 4hARmMMo0bx9BiOIwywwgUli4qLV7CANwgJmEv2TWllBbBYBVYnFC+6DxXkFnCV+TdvHBLFM QeLY1K9gNZwCLhIrD91khVjmLHHs7BG2CYy8CxgZVjGKphYkFxQnpeca6hUn5haX5qXrJefn bmIEh/czqR2MKxssDjEKcDAq8fAGhEoECrEmlhVX5h5ilOBgVhLhPX5IPFCINyWxsiq1KD++ qDQntfgQYzLQVROZpUST84Gxl1cSb2hsYm5qbGppYmFiZkmasJI4L+OpJwFCAumJJanZqakF qUUwW5g4OKUaGH38fsz/+sX16utXcRpLJ63Xc/X+zKpm7cXnHfPiO//0+1ZtPzaxMOVsLiw4 N/2/67e/HcXFH0o/pcX/jZNyX+/640+yzz71JfoFtgd9Ft00/uaWE2tg5vRUMp1p4YfL9wW/ rX9V1J1/lVFvR1RwgtK64EQ5cz6rT7My+B78rm1OWtb69Y1kpxJLcUaioRZzUXEiAOwAdbyz AgAA 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-20130211_033805_569602_906086AA X-CRM114-Status: GOOD ( 10.50 ) 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 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);