Commit 1b416c4b authored by Russell King's avatar Russell King

dmaengine: omap-dma: provide a hook to get the underlying DMA platform ops

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.
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Acked-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 104fce73
...@@ -2000,6 +2000,12 @@ void omap_dma_global_context_restore(void) ...@@ -2000,6 +2000,12 @@ void omap_dma_global_context_restore(void)
omap_clear_dma(ch); 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) static int omap_system_dma_probe(struct platform_device *pdev)
{ {
int ch, ret = 0; int ch, ret = 0;
......
...@@ -26,11 +26,13 @@ struct omap_dmadev { ...@@ -26,11 +26,13 @@ struct omap_dmadev {
spinlock_t lock; spinlock_t lock;
struct tasklet_struct task; struct tasklet_struct task;
struct list_head pending; struct list_head pending;
struct omap_system_dma_plat_info *plat;
}; };
struct omap_chan { struct omap_chan {
struct virt_dma_chan vc; struct virt_dma_chan vc;
struct list_head node; struct list_head node;
struct omap_system_dma_plat_info *plat;
struct dma_slave_config cfg; struct dma_slave_config cfg;
unsigned dma_sig; unsigned dma_sig;
...@@ -573,6 +575,7 @@ static int omap_dma_chan_init(struct omap_dmadev *od, int dma_sig) ...@@ -573,6 +575,7 @@ static int omap_dma_chan_init(struct omap_dmadev *od, int dma_sig)
if (!c) if (!c)
return -ENOMEM; return -ENOMEM;
c->plat = od->plat;
c->dma_sig = dma_sig; c->dma_sig = dma_sig;
c->vc.desc_free = omap_dma_desc_free; c->vc.desc_free = omap_dma_desc_free;
vchan_init(&c->vc, &od->ddev); vchan_init(&c->vc, &od->ddev);
...@@ -605,6 +608,10 @@ static int omap_dma_probe(struct platform_device *pdev) ...@@ -605,6 +608,10 @@ static int omap_dma_probe(struct platform_device *pdev)
if (!od) if (!od)
return -ENOMEM; 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_SLAVE, od->ddev.cap_mask);
dma_cap_set(DMA_CYCLIC, od->ddev.cap_mask); dma_cap_set(DMA_CYCLIC, od->ddev.cap_mask);
od->ddev.device_alloc_chan_resources = omap_dma_alloc_chan_resources; od->ddev.device_alloc_chan_resources = omap_dma_alloc_chan_resources;
......
...@@ -292,6 +292,8 @@ struct omap_system_dma_plat_info { ...@@ -292,6 +292,8 @@ struct omap_system_dma_plat_info {
#define dma_omap15xx() ((dma_omap1() && (d->dev_caps & ENABLE_1510_MODE))) #define dma_omap15xx() ((dma_omap1() && (d->dev_caps & ENABLE_1510_MODE)))
#define dma_omap16xx() ((dma_omap1() && (d->dev_caps & ENABLE_16XX_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 void omap_set_dma_priority(int lch, int dst_port, int priority);
extern int omap_request_dma(int dev_id, const char *dev_name, extern int omap_request_dma(int dev_id, const char *dev_name,
void (*callback)(int lch, u16 ch_status, void *data), void (*callback)(int lch, u16 ch_status, void *data),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment