aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dmaengine.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/dmaengine.h')
-rw-r--r--include/linux/dmaengine.h34
1 files changed, 20 insertions, 14 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index a3b6035b6c86..acbb364674ff 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -29,7 +29,7 @@
29#include <linux/dma-mapping.h> 29#include <linux/dma-mapping.h>
30 30
31/** 31/**
32 * enum dma_state - resource PNP/power managment state 32 * enum dma_state - resource PNP/power management state
33 * @DMA_RESOURCE_SUSPEND: DMA device going into low power state 33 * @DMA_RESOURCE_SUSPEND: DMA device going into low power state
34 * @DMA_RESOURCE_RESUME: DMA device returning to full power 34 * @DMA_RESOURCE_RESUME: DMA device returning to full power
35 * @DMA_RESOURCE_AVAILABLE: DMA device available to the system 35 * @DMA_RESOURCE_AVAILABLE: DMA device available to the system
@@ -95,6 +95,15 @@ enum dma_transaction_type {
95#define DMA_TX_TYPE_END (DMA_INTERRUPT + 1) 95#define DMA_TX_TYPE_END (DMA_INTERRUPT + 1)
96 96
97/** 97/**
98 * enum dma_prep_flags - DMA flags to augment operation preparation
99 * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of
100 * this transaction
101 */
102enum dma_prep_flags {
103 DMA_PREP_INTERRUPT = (1 << 0),
104};
105
106/**
98 * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t. 107 * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t.
99 * See linux/cpumask.h 108 * See linux/cpumask.h
100 */ 109 */
@@ -132,7 +141,7 @@ struct dma_chan {
132 141
133 /* sysfs */ 142 /* sysfs */
134 int chan_id; 143 int chan_id;
135 struct class_device class_dev; 144 struct device dev;
136 145
137 struct kref refcount; 146 struct kref refcount;
138 int slow_ref; 147 int slow_ref;
@@ -142,6 +151,7 @@ struct dma_chan {
142 struct dma_chan_percpu *local; 151 struct dma_chan_percpu *local;
143}; 152};
144 153
154#define to_dma_chan(p) container_of(p, struct dma_chan, dev)
145 155
146void dma_chan_cleanup(struct kref *kref); 156void dma_chan_cleanup(struct kref *kref);
147 157
@@ -208,8 +218,6 @@ typedef void (*dma_async_tx_callback)(void *dma_async_param);
208 * descriptors 218 * descriptors
209 * @chan: target channel for this operation 219 * @chan: target channel for this operation
210 * @tx_submit: set the prepared descriptor(s) to be executed by the engine 220 * @tx_submit: set the prepared descriptor(s) to be executed by the engine
211 * @tx_set_dest: set a destination address in a hardware descriptor
212 * @tx_set_src: set a source address in a hardware descriptor
213 * @callback: routine to call after this operation is complete 221 * @callback: routine to call after this operation is complete
214 * @callback_param: general parameter to pass to the callback routine 222 * @callback_param: general parameter to pass to the callback routine
215 * ---async_tx api specific fields--- 223 * ---async_tx api specific fields---
@@ -226,10 +234,6 @@ struct dma_async_tx_descriptor {
226 struct list_head tx_list; 234 struct list_head tx_list;
227 struct dma_chan *chan; 235 struct dma_chan *chan;
228 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); 236 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx);
229 void (*tx_set_dest)(dma_addr_t addr,
230 struct dma_async_tx_descriptor *tx, int index);
231 void (*tx_set_src)(dma_addr_t addr,
232 struct dma_async_tx_descriptor *tx, int index);
233 dma_async_tx_callback callback; 237 dma_async_tx_callback callback;
234 void *callback_param; 238 void *callback_param;
235 struct list_head depend_list; 239 struct list_head depend_list;
@@ -278,15 +282,17 @@ struct dma_device {
278 void (*device_free_chan_resources)(struct dma_chan *chan); 282 void (*device_free_chan_resources)(struct dma_chan *chan);
279 283
280 struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)( 284 struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)(
281 struct dma_chan *chan, size_t len, int int_en); 285 struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
286 size_t len, unsigned long flags);
282 struct dma_async_tx_descriptor *(*device_prep_dma_xor)( 287 struct dma_async_tx_descriptor *(*device_prep_dma_xor)(
283 struct dma_chan *chan, unsigned int src_cnt, size_t len, 288 struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src,
284 int int_en); 289 unsigned int src_cnt, size_t len, unsigned long flags);
285 struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)( 290 struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)(
286 struct dma_chan *chan, unsigned int src_cnt, size_t len, 291 struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt,
287 u32 *result, int int_en); 292 size_t len, u32 *result, unsigned long flags);
288 struct dma_async_tx_descriptor *(*device_prep_dma_memset)( 293 struct dma_async_tx_descriptor *(*device_prep_dma_memset)(
289 struct dma_chan *chan, int value, size_t len, int int_en); 294 struct dma_chan *chan, dma_addr_t dest, int value, size_t len,
295 unsigned long flags);
290 struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( 296 struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)(
291 struct dma_chan *chan); 297 struct dma_chan *chan);
292 298