Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
dw_dmac.c File Reference
#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include "dw_dmac_regs.h"
#include "dmaengine.h"

Go to the source code of this file.

Macros

#define DWC_DEFAULT_CTLLO(_chan)
 
#define NR_DESCS_PER_CHANNEL   64
 

Functions

dma_addr_t dw_dma_get_src_addr (struct dma_chan *chan)
 
 EXPORT_SYMBOL (dw_dma_get_src_addr)
 
dma_addr_t dw_dma_get_dst_addr (struct dma_chan *chan)
 
 EXPORT_SYMBOL (dw_dma_get_dst_addr)
 
int dw_dma_cyclic_start (struct dma_chan *chan)
 
 EXPORT_SYMBOL (dw_dma_cyclic_start)
 
void dw_dma_cyclic_stop (struct dma_chan *chan)
 
 EXPORT_SYMBOL (dw_dma_cyclic_stop)
 
struct dw_cyclic_descdw_dma_cyclic_prep (struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, size_t period_len, enum dma_transfer_direction direction)
 
 EXPORT_SYMBOL (dw_dma_cyclic_prep)
 
void dw_dma_cyclic_free (struct dma_chan *chan)
 
 EXPORT_SYMBOL (dw_dma_cyclic_free)
 
 subsys_initcall (dw_init)
 
 module_exit (dw_exit)
 
 MODULE_LICENSE ("GPL v2")
 
 MODULE_DESCRIPTION ("Synopsys DesignWare DMA Controller driver")
 
 MODULE_AUTHOR ("Haavard Skinnemoen (Atmel)")
 
 MODULE_AUTHOR ("Viresh Kumar <[email protected]>")
 

Macro Definition Documentation

#define DWC_DEFAULT_CTLLO (   _chan)
Value:
({ \
struct dw_dma_slave *__slave = (_chan->private); \
struct dw_dma_chan *_dwc = to_dw_dma_chan(_chan); \
struct dma_slave_config *_sconfig = &_dwc->dma_sconfig; \
int _dms = dwc_get_dms(__slave); \
int _sms = dwc_get_sms(__slave); \
u8 _smsize = __slave ? _sconfig->src_maxburst : \
DW_DMA_MSIZE_16; \
u8 _dmsize = __slave ? _sconfig->dst_maxburst : \
DW_DMA_MSIZE_16; \
\
(DWC_CTLL_DST_MSIZE(_dmsize) \
| DWC_CTLL_SRC_MSIZE(_smsize) \
| DWC_CTLL_DMS(_dms) \
| DWC_CTLL_SMS(_sms)); \
})

Definition at line 49 of file dw_dmac.c.

#define NR_DESCS_PER_CHANNEL   64

Definition at line 73 of file dw_dmac.c.

Function Documentation

void dw_dma_cyclic_free ( struct dma_chan chan)

dw_dma_cyclic_free - free a prepared cyclic DMA transfer : the DMA channel to free

Definition at line 1413 of file dw_dmac.c.

struct dw_cyclic_desc* dw_dma_cyclic_prep ( struct dma_chan chan,
dma_addr_t  buf_addr,
size_t  buf_len,
size_t  period_len,
enum dma_transfer_direction  direction 
)
read

dw_dma_cyclic_prep - prepare the cyclic DMA transfer : the DMA channel to prepare : physical DMA address where the buffer starts : total number of bytes for the entire buffer : number of bytes for each period : transfer direction, to or from device

Must be called before trying to start the transfer. Returns a valid struct dw_cyclic_desc if successful or an ERR_PTR(-errno) if not successful.

Definition at line 1260 of file dw_dmac.c.

int dw_dma_cyclic_start ( struct dma_chan chan)

dw_dma_cyclic_start - start the cyclic DMA transfer : the DMA channel to start

Must be called with soft interrupts disabled. Returns zero on success or -errno on failure.

Definition at line 1191 of file dw_dmac.c.

void dw_dma_cyclic_stop ( struct dma_chan chan)

dw_dma_cyclic_stop - stop the cyclic DMA transfer : the DMA channel to stop

Must be called with soft interrupts disabled.

Definition at line 1235 of file dw_dmac.c.

dma_addr_t dw_dma_get_dst_addr ( struct dma_chan chan)
inline

Definition at line 519 of file dw_dmac.c.

dma_addr_t dw_dma_get_src_addr ( struct dma_chan chan)
inline

Definition at line 512 of file dw_dmac.c.

EXPORT_SYMBOL ( dw_dma_get_src_addr  )
EXPORT_SYMBOL ( dw_dma_get_dst_addr  )
EXPORT_SYMBOL ( dw_dma_cyclic_start  )
EXPORT_SYMBOL ( dw_dma_cyclic_stop  )
EXPORT_SYMBOL ( dw_dma_cyclic_prep  )
EXPORT_SYMBOL ( dw_dma_cyclic_free  )
MODULE_AUTHOR ( "Haavard Skinnemoen (Atmel)"  )
MODULE_AUTHOR ( "Viresh Kumar <[email protected]>"  )
MODULE_DESCRIPTION ( "Synopsys DesignWare DMA Controller driver )
module_exit ( dw_exit  )
MODULE_LICENSE ( "GPL v2 )
subsys_initcall ( dw_init  )