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: 2079691 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C6FF240E3D for ; Fri, 1 Feb 2013 12:54:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752977Ab3BAMyB (ORCPT ); Fri, 1 Feb 2013 07:54:01 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:44572 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750879Ab3BAMyA (ORCPT ); Fri, 1 Feb 2013 07:54:00 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MHJ006IVL5ZY5R0@mailout2.samsung.com> for linux-samsung-soc@vger.kernel.org; Fri, 01 Feb 2013 21:53:59 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.122]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 6C.DC.03880.7EABB015; Fri, 01 Feb 2013 21:53:59 +0900 (KST) X-AuditID: cbfee61b-b7fb06d000000f28-23-510bbae7b501 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 6B.DC.03880.6EABB015; Fri, 01 Feb 2013 21:53:59 +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-samsung-soc@vger.kernel.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 Cc: sbkim73@samsung.com, broonie@opensource.wolfsonmicro.com, kgene.kim@samsung.com, jassisinghbrar@gmail.com, arnd@arndb.de, vinod.koul@intel.com, grant.likely@secretlab.ca, jon-hunter@ti.com, boojin.kim@samsung.com, thomas.abraham@linaro.org 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+NgFvrMLMWRmVeSWpSXmKPExsWyRsSkSvf5Lu5Ag46vwhYzzu9jcmD0+LxJ LoAxissmJTUnsyy1SN8ugSvj86m9jAVdfBXff79naWC8xN3FyMEhIWAiMWO/TBcjJ5ApJnHh 3nq2LkYuDiGBpYwSu1/NYoZImEhsenudCSIxnVHi5YQrLBDOJiaJq5+OM4FMYhPQkWg56wIS FxGYwyjRvH0GI4jDLPCTUeJF32NWkFHCAmYSt+6/YAGxWQRUJXpWfWEHsXkFnCUu/b3KBLFO QeLY1K9g9ZwCLhL3v88HO0MIqOb4xPXsIEMlBG6zSRyaM5MRYpCAxLfJh1gg/pGV2HQA6mxJ iYMrbrBMYBRewMiwilE0tSC5oDgpPddIrzgxt7g0L10vOT93EyMwCE//eya9g3FVg8UhRgEO RiUe3hM/uQKFWBPLiitzDzFKcDArifDa1nIHCvGmJFZWpRblxxeV5qQWH2JMBlo+kVlKNDkf GCF5JfGGxibmpsamlkZGZqampAkrifMynnoSICSQnliSmp2aWpBaBLOFiYNTqoFx3bu/G/Z/ apm5qGpb0iYuB1uOKrfa5ykLpRz/zesRXF5nsyR5g0R+2pec6eurFiRWuK+0Cs1gqM01X24T t7xsw3aF3VGfJx0WmzDTZuu2tQtXTfxps6dAY1sxw4LQ0l+ckub3r8/j7XE/oyIW8WMDK5uP m5H/o/8bk14dzmbIP7VujcBVHr6vSizFGYmGWsxFxYkAavJtwIYCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMIsWRmVeSWpSXmKPExsVy+t9jQd3nu7gDDdp6WCxmnN/H5MDo8XmT XABjVAOjTUZqYkpqkUJqXnJ+SmZeuq2Sd3C8c7ypmYGhrqGlhbmSQl5ibqqtkotPgK5bZg7Q VCWFssScUqBQQGJxsZK+HaYJoSFuuhYwjRG6viFBcD1GBmggYQ1jxudTexkLuvgqvv9+z9LA eIm7i5GTQ0LARGLT2+tMELaYxIV769m6GLk4hASmM0q8nHCFBcLZxCRx9dNxoCoODjYBHYmW sy4gcRGBOYwSzdtnMII4zAI/GSVe9D1mBRklLGAmcev+CxYQm0VAVaJn1Rd2EJtXwFni0t+r UOsUJI5N/QpWzyngInH/+3xmEFsIqOb4xPXsExh5FzAyrGIUTS1ILihOSs810itOzC0uzUvX S87P3cQIDvJn0jsYVzVYHGIU4GBU4uE98ZMrUIg1say4MvcQowQHs5IIr20td6AQb0piZVVq UX58UWlOavEhxmSgqyYyS4km5wMjMK8k3tDYxNzU2NTSxMLEzJI0YSVxXsZTTwKEBNITS1Kz U1MLUotgtjBxcEo1MCbuuvNmbZPc4aCm1XrL5cQd5bfL9W1YzXBRfertxnX+ouw2nEJtngF7 eK8s7d9Q2yIm5draOGHehOkzv1icS7X6vG7uxQtxor/Wd8efOL5Q0mLek9KpzE8Ve5pfntH2 tjeekLz72OaQY4H3DnLrmF0Iz3uuxr6Zsf/Do3nmaiH1f7ffaKna/lqJpTgj0VCLuag4EQAO rA3EtgIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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;