From: Sricharan R <r.sricharan@ti.com>
To: r.sricharan@ti.com, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
dmaengine@vger.kernel.org
Cc: santosh.shilimkar@ti.com, rnayak@ti.com, nsekhar@ti.com,
tony@atomide.com, linux@arm.linux.org.uk, vinod.koul@intel.com,
dan.j.williams@intel.com, nm@ti.com
Subject: [RFC PATCH 1/9] drivers: dma: omap-dma: Avoid hard-coding of the dma-request channels
Date: Fri, 7 Mar 2014 17:46:08 +0530 [thread overview]
Message-ID: <1394194576-23741-2-git-send-email-r.sricharan@ti.com> (raw)
In-Reply-To: <1394194576-23741-1-git-send-email-r.sricharan@ti.com>
The total number of dma-request channels is hard-coded. Instead read the
data from DT.
Signed-off-by: Sricharan R <r.sricharan@ti.com>
---
drivers/dma/omap-dma.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index 64ceca2..a0d6639 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -1093,6 +1093,7 @@ static int omap_dma_probe(struct platform_device *pdev)
struct omap_dmadev *od;
struct resource *res;
int rc, i, irq;
+ u32 reqs;
od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL);
if (!od)
@@ -1126,7 +1127,9 @@ static int omap_dma_probe(struct platform_device *pdev)
tasklet_init(&od->task, omap_dma_sched, (unsigned long)od);
- for (i = 0; i < 127; i++) {
+ of_property_read_u32(pdev->dev.of_node, "#dma-requests", &reqs);
+
+ for (i = 0; i < reqs; i++) {
rc = omap_dma_chan_init(od, i);
if (rc) {
omap_dma_free(od);
--
1.7.9.5
next prev parent reply other threads:[~2014-03-07 12:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-07 12:16 [RFC PATCH 0/9] drivers: dma: Add support for dma-channel router Sricharan R
2014-03-07 12:16 ` Sricharan R [this message]
2014-03-07 12:16 ` [RFC PATCH 2/9] drivers: dma: of-dma: Add support for dma-request line routers Sricharan R
2014-03-07 12:16 ` [RFC PATCH 3/9] drivers: dma: omap-dma: Add a seperate xlate function to get router data Sricharan R
2014-03-07 12:16 ` [RFC PATCH 4/9] drivers: omap-dma: Add crossbar line as a resource to omap_chan structure Sricharan R
2014-03-07 12:16 ` [RFC PATCH 5/9] drivers: dma: Add dma crossbar driver Sricharan R
2014-03-07 12:16 ` [RFC PATCH 6/9] arm: dts: dra: Add dma crossbar node Sricharan R
2014-03-07 12:16 ` [RFC PATCH 7/9] arm: dts: dra: Add dma-request crossbar phandle to dma-specs Sricharan R
2014-03-07 12:16 ` [RFC PATCH 8/9] arm: dra: Enable dma crossbar support on dra7xx Sricharan R
2014-03-07 12:16 ` [RFC PATCH 9/9] arm: dts: dra7: Change the total dma-req numbers to crossbar channels Sricharan R
2014-03-08 19:53 ` [RFC PATCH 0/9] drivers: dma: Add support for dma-channel router Rob Herring
2014-03-10 13:58 ` Sricharan R
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=1394194576-23741-2-git-send-email-r.sricharan@ti.com \
--to=r.sricharan@ti.com \
--cc=dan.j.williams@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=nm@ti.com \
--cc=nsekhar@ti.com \
--cc=rnayak@ti.com \
--cc=santosh.shilimkar@ti.com \
--cc=tony@atomide.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).