All of lore.kernel.org
 help / color / mirror / Atom feed
From: Padmavathi Venna <padma.v@samsung.com>
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 V3 1/5] DMA: PL330: Add new pl330 filter for DT case.
Date: Wed, 06 Feb 2013 11:48:45 +0530	[thread overview]
Message-ID: <1360131529-2847-2-git-send-email-padma.v@samsung.com> (raw)
In-Reply-To: <1360131529-2847-1-git-send-email-padma.v@samsung.com>

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 <padma.v@samsung.com>
---
 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;
 }
-- 
1.7.4.4

WARNING: multiple messages have this Message-ID (diff)
From: padma.v@samsung.com (Padmavathi Venna)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V3 1/5] DMA: PL330: Add new pl330 filter for DT case.
Date: Wed, 06 Feb 2013 11:48:45 +0530	[thread overview]
Message-ID: <1360131529-2847-2-git-send-email-padma.v@samsung.com> (raw)
In-Reply-To: <1360131529-2847-1-git-send-email-padma.v@samsung.com>

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 <padma.v@samsung.com>
---
 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;
 }
-- 
1.7.4.4

  reply	other threads:[~2013-02-06  6:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-06  6:18 [PATCH V3 0/5] Add generic DMA DT binding support Padmavathi Venna
2013-02-06  6:18 ` Padmavathi Venna
2013-02-06  6:18 ` Padmavathi Venna [this message]
2013-02-06  6:18   ` [PATCH V3 1/5] DMA: PL330: Add new pl330 filter for DT case Padmavathi Venna
2013-02-06  9:00   ` Arnd Bergmann
2013-02-06  9:00     ` Arnd Bergmann
2013-02-06  6:18 ` [PATCH V3 2/5] DMA: PL330: Add xlate function Padmavathi Venna
2013-02-06  6:18   ` Padmavathi Venna
2013-02-06  6:18 ` [PATCH V3 3/5] DMA: PL330: Register the DMA controller with the generic DMA helpers Padmavathi Venna
2013-02-06  6:18   ` Padmavathi Venna
2013-02-06  6:18 ` [PATCH V3 4/5] ARM: dts: Add #dma-cells for generic dma binding support Padmavathi Venna
2013-02-06  6:18   ` Padmavathi Venna
2013-02-06 15:24   ` Rob Herring
2013-02-06 15:24     ` Rob Herring
2013-02-08  4:20     ` Padma Venkat
2013-02-08  4:20       ` Padma Venkat
2013-02-08 13:12       ` Rob Herring
2013-02-08 13:12         ` Rob Herring
2013-02-06  6:18 ` [PATCH V3 5/5] ARM: SAMSUNG: dma: Remove unnecessary code Padmavathi Venna
2013-02-06  6:18   ` Padmavathi Venna
2013-02-06  9:00   ` Arnd Bergmann
2013-02-06  9:00     ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360131529-2847-2-git-send-email-padma.v@samsung.com \
    --to=padma.v@samsung.com \
    --cc=arnd@arndb.de \
    --cc=boojin.kim@samsung.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=jassisinghbrar@gmail.com \
    --cc=jon-hunter@ti.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=padma.kvr@gmail.com \
    --cc=sbkim73@samsung.com \
    --cc=thomas.abraham@linaro.org \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.