From patchwork Mon Feb 11 08:38:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Padmavathi Venna X-Patchwork-Id: 2123561 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 51041E00C6 for ; Mon, 11 Feb 2013 08:40:45 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U4ou0-0006Cp-Bl; Mon, 11 Feb 2013 08:38:16 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U4otn-0006AV-Rl for linux-arm-kernel@lists.infradead.org; Mon, 11 Feb 2013 08:38:04 +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:37:58 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.126]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 8A.E0.03918.6EDA8115; Mon, 11 Feb 2013 17:37:58 +0900 (KST) X-AuditID: cbfee61a-b7f7d6d000000f4e-cc-5118ade679d2 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id B9.E0.03918.6EDA8115; Mon, 11 Feb 2013 17:37:58 +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:37: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 V4 1/5] DMA: PL330: Add new pl330 filter for DT case. Date: Mon, 11 Feb 2013 14:08:21 +0530 Message-id: <1360571905-15285-2-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+NgFvrCLMWRmVeSWpSXmKPExsWyRsSkTvfZWolAg7lX5Cw2Pb7G6sDosXlJ fQBjFJdNSmpOZllqkb5dAlfG0nsbmAu+81W0T2tma2Ccz9PFyMkhIWAisezif2YIW0ziwr31 bF2MXBxCAksZJbqmL2KHKfq9uYcdIrGIUeJby3kWCGcrk8ThLTOAWjg42AR0JFrOuoDERQTm MEo0b5/BCOIwC0xgkpi4aDXYKGEBV4mrj26ygtgsAqoSvS2/2UBsXgFniUsNi6DuUJA4NvUr WA2ngIvEykMQ9UJANcfOHgG7T0LgOpvE/i/fGCEGCUh8m3yIBeQKCQFZiU0HoOZIShxccYNl AqPwAkaGVYyiqQXJBcVJ6bmGesWJucWleel6yfm5mxiBYXj63zOpHYwrGywOMQpwMCrx8AaE SgQKsSaWFVfmHmKU4GBWEuE9fkg8UIg3JbGyKrUoP76oNCe1+BBjMtDyicxSosn5wBjJK4k3 NDYxNzU2tTQyMjM1JU1YSZyX8dSTACGB9MSS1OzU1ILUIpgtTBycUg2MHvWhRwwr0xe9f+x+ sLJT/INtktrRXr+4xe+1Dy5j/lc6IdPqeF3q8rrFpRwaUU7/lkbFzM7dNjn72m0XFq3tR/eX bDmg7lz6POhsU+bvxHqP/x6BJeJuttrrpp07Y2hVHm1z7+mn/wqBTbwql59yMaYLKSjEf33c Kpui4xrE0HXS72Erq5kSS3FGoqEWc1FxIgDW+5HJhwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMIsWRmVeSWpSXmKPExsVy+t9jAd1nayUCDc49E7bY9PgaqwOjx+Yl 9QGMUQ2MNhmpiSmpRQqpecn5KZl56bZK3sHxzvGmZgaGuoaWFuZKCnmJuam2Si4+AbpumTlA U5UUyhJzSoFCAYnFxUr6dpgmhIa46VrANEbo+oYEwfUYGaCBhDWMGUvvbWAu+M5X0T6tma2B cT5PFyMnh4SAicTvzT3sELaYxIV769m6GLk4hAQWMUp8aznPAuFsZZI4vGUGUIaDg01AR6Ll rAtIXERgDqNE8/YZjCAOs8AEJomJi1aDjRIWcJW4+ugmK4jNIqAq0dvymw3E5hVwlrjUsIgZ Yp2CxLGpX8FqOAVcJFYegqgXAqo5dvYI2wRG3gWMDKsYRVMLkguKk9JzDfWKE3OLS/PS9ZLz czcxgoP8mdQOxpUNFocYBTgYlXh4A0IlAoVYE8uKK3MPMUpwMCuJ8B4/JB4oxJuSWFmVWpQf X1Sak1p8iDEZ6KqJzFKiyfnACMwriTc0NjE3NTa1NLEwMbMkTVhJnJfx1JMAIYH0xJLU7NTU gtQimC1MHJxSDYxnPnEXSFu4P+hfsPKdioLjrLULbWw65jc92FB5uyecyWvlr5lJ+tL/DlVk xqwzvf7kjMdyL546s8nnGC9FlB95vHfrE1+xXZub3907sZl13+NNpdPurP28RMPiaMvXzrtS fiHpDM73dlrftXLbZvH9wq6rlZlLax693b3V/chut4dSWpM/HC+NUGIpzkg01GIuKk4EAAkM X7q2AgAA 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_033804_160163_376214B1 X-CRM114-Status: UNSURE ( 9.90 ) 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.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 This patch adds a new pl330_dt_filter for DT case to filter the required channel based on the new filter params and modifies the old filter only for non-DT case as suggested by Arnd Bergmann. Signed-off-by: Padmavathi Venna Acked-by: Arnd Bergmann --- drivers/dma/pl330.c | 29 +++++++++++++++-------------- 1 files changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 80680ee..87110f2 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -606,6 +606,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 +2357,16 @@ static void dma_pl330_rqcb(void *token, enum pl330_op_err err) tasklet_schedule(&pch->task); } +static bool pl330_dt_filter(struct dma_chan *chan, void *param) +{ + struct dma_pl330_filter_args *fargs = param; + + if (chan->device != &fargs->pdmac->ddma) + return false; + + return (chan->chan_id == fargs->chan_id); +} + bool pl330_filter(struct dma_chan *chan, void *param) { u8 *peri_id; @@ -2359,20 +2374,6 @@ bool pl330_filter(struct dma_chan *chan, void *param) if (chan->device->dev->driver != &pl330_driver.drv) return false; -#ifdef CONFIG_OF - if (chan->device->dev->of_node) { - const __be32 *prop_value; - phandle phandle; - struct device_node *node; - - prop_value = ((struct property *)param)->value; - phandle = be32_to_cpup(prop_value++); - node = of_find_node_by_phandle(phandle); - return ((chan->private == node) && - (chan->chan_id == be32_to_cpup(prop_value))); - } -#endif - peri_id = chan->private; return *peri_id == (unsigned)param; }