diff options
author | Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> | 2009-04-01 09:47:02 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-04-01 18:42:34 -0400 |
commit | d9de451989a88a2003ca06e524aca4665c0c7f06 (patch) | |
tree | a926d4ff1b73da88d5112324611a579a94e28095 /drivers/dma/dw_dmac_regs.h | |
parent | 0f571515c332e00b3515dbe0859ceaa30ab66e00 (diff) |
dw_dmac: add cyclic API to DW DMA driver
This patch adds a cyclic DMA interface to the DW DMA driver. This is
very useful if you want to use the DMA controller in combination with a
sound device which uses cyclic buffers.
Using a DMA channel for cyclic DMA will disable the possibility to use
it as a normal DMA engine until the user calls the cyclic free function
on the DMA channel. Also a cyclic DMA list can not be prepared if the
channel is already active.
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/dw_dmac_regs.h')
-rw-r--r-- | drivers/dma/dw_dmac_regs.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/dma/dw_dmac_regs.h b/drivers/dma/dw_dmac_regs.h index b252b202c5cf..13a580767031 100644 --- a/drivers/dma/dw_dmac_regs.h +++ b/drivers/dma/dw_dmac_regs.h | |||
@@ -126,6 +126,10 @@ struct dw_dma_regs { | |||
126 | 126 | ||
127 | #define DW_REGLEN 0x400 | 127 | #define DW_REGLEN 0x400 |
128 | 128 | ||
129 | enum dw_dmac_flags { | ||
130 | DW_DMA_IS_CYCLIC = 0, | ||
131 | }; | ||
132 | |||
129 | struct dw_dma_chan { | 133 | struct dw_dma_chan { |
130 | struct dma_chan chan; | 134 | struct dma_chan chan; |
131 | void __iomem *ch_regs; | 135 | void __iomem *ch_regs; |
@@ -134,10 +138,12 @@ struct dw_dma_chan { | |||
134 | spinlock_t lock; | 138 | spinlock_t lock; |
135 | 139 | ||
136 | /* these other elements are all protected by lock */ | 140 | /* these other elements are all protected by lock */ |
141 | unsigned long flags; | ||
137 | dma_cookie_t completed; | 142 | dma_cookie_t completed; |
138 | struct list_head active_list; | 143 | struct list_head active_list; |
139 | struct list_head queue; | 144 | struct list_head queue; |
140 | struct list_head free_list; | 145 | struct list_head free_list; |
146 | struct dw_cyclic_desc *cdesc; | ||
141 | 147 | ||
142 | unsigned int descs_allocated; | 148 | unsigned int descs_allocated; |
143 | }; | 149 | }; |
@@ -158,7 +164,6 @@ static inline struct dw_dma_chan *to_dw_dma_chan(struct dma_chan *chan) | |||
158 | return container_of(chan, struct dw_dma_chan, chan); | 164 | return container_of(chan, struct dw_dma_chan, chan); |
159 | } | 165 | } |
160 | 166 | ||
161 | |||
162 | struct dw_dma { | 167 | struct dw_dma { |
163 | struct dma_device dma; | 168 | struct dma_device dma; |
164 | void __iomem *regs; | 169 | void __iomem *regs; |