From patchwork Thu Feb 14 03:40:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Padmavathi Venna X-Patchwork-Id: 2140231 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id B453D3FCFC for ; Thu, 14 Feb 2013 03:42:55 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U5pg3-0006Lz-Q4; Thu, 14 Feb 2013 03:40:03 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U5pfq-0006Ji-9o for linux-arm-kernel@lists.infradead.org; Thu, 14 Feb 2013 03:39:51 +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 <0MI6005XPY61RK60@mailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 14 Feb 2013 12:39:44 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.125]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id AE.30.03880.08C5C115; Thu, 14 Feb 2013 12:39:44 +0900 (KST) X-AuditID: cbfee61b-b7fb06d000000f28-de-511c5c807075 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 4D.30.03880.08C5C115; Thu, 14 Feb 2013 12:39:44 +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 <0MI600N0PY5X1F30@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 14 Feb 2013 12:39:44 +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/4] DMA: PL330: Add new pl330 filter for DT case. Date: Thu, 14 Feb 2013 09:10:05 +0530 Message-id: <1360813208-9498-2-git-send-email-padma.v@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1360813208-9498-1-git-send-email-padma.v@samsung.com> References: <1360813208-9498-1-git-send-email-padma.v@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMLMWRmVeSWpSXmKPExsWyRsSkVrchRibQoG+XocWmx9dYHRg9Ni+p D2CM4rJJSc3JLEst0rdL4Mp4ufQWU8F3vopZFx8zNjDO5+li5OSQEDCRuHFkOxOELSZx4d56 ti5GLg4hgaWMElc+LmHsYuQAK7p+mRsiPp1R4vbzG6wQzlYmidunjrGBFLEJ6Ei0nHUBiYsI zGGUaN4+gxHEYRaYwCQxcdFqdpAVwgKuEq13etlAbBYBVYl3D68wgti8Ak4SP4/9Z4Y4Q0Hi 2NSvrCA2p4CzxKktp8HOEwKqeXejiwlkqITAfTaJVbMbmCEGCUh8m3yIBeJUWYlNB6DmSEoc XHGDZQKj8AJGhlWMoqkFyQXFSem5RnrFibnFpXnpesn5uZsYgUF4+t8z6R2MqxosDjEKcDAq 8fAq/JIOFGJNLCuuzD3EKMHBrCTC+zJQJlCINyWxsiq1KD++qDQntfgQYzLQ8onMUqLJ+cAI ySuJNzQ2MTc1NrU0MjIzNSVNWEmcl/HUkwAhgfTEktTs1NSC1CKYLUwcnFINjLa6toffs607 MH9vtmvFZ62jj54ZzLj+8NOj1Lmhnk0i+9uuKO0JvLap1n/b0RmJQpwX1k7dFPJR12B3eW3l un9BR4+o/PRtk/ri/mZOgwTz2i+veXP8Psv3iV6t39N0qbrzcOOimGOPC2+d3KNovP35vWuT 1OrfVf6ps9rjm72y6xfPbfnsGdeVWIozEg21mIuKEwH+Udl2hgIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEIsWRmVeSWpSXmKPExsVy+t9jQd2GGJlAg+1zFCw2Pb7G6sDosXlJ fQBjVAOjTUZqYkpqkUJqXnJ+SmZeuq2Sd3C8c7ypmYGhrqGlhbmSQl5ibqqtkotPgK5bZg7Q VCWFssScUqBQQGJxsZK+HaYJoSFuuhYwjRG6viFBcD1GBmggYQ1jxsult5gKvvNVzLr4mLGB cT5PFyMHh4SAicT1y9xdjJxAppjEhXvr2boYuTiEBKYzStx+foMVwtnKJHH71DE2kAY2AR2J lrMuIHERgTmMEs3bZzCCOMwCE5gkJi5azQ4ySljAVaL1Ti8biM0ioCrx7uEVRhCbV8BJ4uex /8wQ6xQkjk39ygpicwo4S5zacpoJxBYCqnl3o4tpAiPvAkaGVYyiqQXJBcVJ6blGesWJucWl eel6yfm5mxjBIf5MegfjqgaLQ4wCHIxKPLwKv6QDhVgTy4orcw8xSnAwK4nwvgyUCRTiTUms rEotyo8vKs1JLT7EmAx01URmKdHkfGD85ZXEGxqbmJsam1qaWJiYWZImrCTOy3jqSYCQQHpi SWp2ampBahHMFiYOTqkGxnVHTph/TuH/M3HxxcVnCl4dzzJvVA7Zu+SPfIePS23JmvsPim6t /nvm/8+DUivvqtyZwvPUZsKGmTFbLRSDUzundbr/b2r7NLdV6H+y9HGZ1mdOUr/XsBt+m9iX vSl7Sf+zmV/fvdKx6tjXMWfezIzfP5NvrbRlMFTXqN2Su91axfPJHk3vaRVKLMUZiYZazEXF iQBIM2g/tQIAAA== 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-20130213_223950_597803_99E3E776 X-CRM114-Status: UNSURE ( 9.19 ) 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 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 f7edb6f..40e9752 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; }