From: Russell King <rmk+kernel@arm.linux.org.uk>
To: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead,
org@arm.linux.org.uk, linux-omap@vger.kernel.org
Cc: Tony Lindgren <tony@atomide.com>,
Vinod Koul <vinod.koul@intel.com>,
Dan Williams <dan.j.williams@intel.com>
Subject: [PATCH RFC 02/26] dmaengine: omap-dma: provide a hook to get the underlying DMA platform ops
Date: Thu, 02 Jan 2014 15:07:12 +0000 [thread overview]
Message-ID: <E1Vyjrc-0004zR-5M@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20140102150621.GJ16456@n2100.arm.linux.org.uk>
Provide and use a hook to obtain the underlying DMA platform operations
so that omap-dma.c can access the hardware more directly without
involving the legacy DMA driver.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/plat-omap/dma.c | 6 ++++++
drivers/dma/omap-dma.c | 7 +++++++
include/linux/omap-dma.h | 2 ++
3 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 01619c2910e3..d4d9a5e62152 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -2000,6 +2000,12 @@ void omap_dma_global_context_restore(void)
omap_clear_dma(ch);
}
+struct omap_system_dma_plat_info *omap_get_plat_info(void)
+{
+ return p;
+}
+EXPORT_SYMBOL_GPL(omap_get_plat_info);
+
static int omap_system_dma_probe(struct platform_device *pdev)
{
int ch, ret = 0;
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index d9349be33bdf..3c1bb34aad0a 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -26,11 +26,13 @@ struct omap_dmadev {
spinlock_t lock;
struct tasklet_struct task;
struct list_head pending;
+ struct omap_system_dma_plat_info *plat;
};
struct omap_chan {
struct virt_dma_chan vc;
struct list_head node;
+ struct omap_system_dma_plat_info *plat;
struct dma_slave_config cfg;
unsigned dma_sig;
@@ -573,6 +575,7 @@ static int omap_dma_chan_init(struct omap_dmadev *od, int dma_sig)
if (!c)
return -ENOMEM;
+ c->plat = od->plat;
c->dma_sig = dma_sig;
c->vc.desc_free = omap_dma_desc_free;
vchan_init(&c->vc, &od->ddev);
@@ -605,6 +608,10 @@ static int omap_dma_probe(struct platform_device *pdev)
if (!od)
return -ENOMEM;
+ od->plat = omap_get_plat_info();
+ if (!od->plat)
+ return -EPROBE_DEFER;
+
dma_cap_set(DMA_SLAVE, od->ddev.cap_mask);
dma_cap_set(DMA_CYCLIC, od->ddev.cap_mask);
od->ddev.device_alloc_chan_resources = omap_dma_alloc_chan_resources;
diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h
index 7af25a9c9c51..14742fc2aefe 100644
--- a/include/linux/omap-dma.h
+++ b/include/linux/omap-dma.h
@@ -292,6 +292,8 @@ struct omap_system_dma_plat_info {
#define dma_omap15xx() ((dma_omap1() && (d->dev_caps & ENABLE_1510_MODE)))
#define dma_omap16xx() ((dma_omap1() && (d->dev_caps & ENABLE_16XX_MODE)))
+extern struct omap_system_dma_plat_info *omap_get_plat_info(void);
+
extern void omap_set_dma_priority(int lch, int dst_port, int priority);
extern int omap_request_dma(int dev_id, const char *dev_name,
void (*callback)(int lch, u16 ch_status, void *data),
--
1.7.4.4
next prev parent reply other threads:[~2014-01-02 15:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-02 15:06 [PATCH RFC 00/26] Migrate more OMAP DMA code to DMA engine Russell King - ARM Linux
2014-01-02 15:07 ` [PATCH RFC 01/26] dmaengine: omap-dma: use devm_kzalloc() to allocate omap_dmadev Russell King
2014-01-02 15:07 ` Russell King [this message]
2014-01-02 15:07 ` [PATCH RFC 03/26] dmaengine: omap-dma: program hardware directly Russell King
2014-01-02 15:07 ` [PATCH RFC 04/26] dmaengine: omap-dma: consolidate writes to DMA registers Russell King
2014-01-10 12:16 ` [PATCH RFC 00/26] Migrate more OMAP DMA code to DMA engine Sricharan R
2014-01-13 14:17 ` Russell King - ARM Linux
2014-01-17 14:23 ` Sricharan R
-- strict thread matches above, loose matches on Subject: below --
2014-01-02 15:08 Russell King - ARM Linux
2014-01-02 15:09 ` [PATCH RFC 02/26] dmaengine: omap-dma: provide a hook to get the underlying DMA platform ops Russell King
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=E1Vyjrc-0004zR-5M@rmk-PC.arm.linux.org.uk \
--to=rmk+kernel@arm.linux.org.uk \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead \
--cc=linux-omap@vger.kernel.org \
--cc=org@arm.linux.org.uk \
--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).