diff options
author | Ingo Molnar <mingo@kernel.org> | 2012-04-13 03:57:10 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-04-13 03:57:10 -0400 |
commit | a385ec4f11bdcf81af094c03e2444ee9b7fad2e5 (patch) | |
tree | a2c186cb828e3713c2ec48a4d7191166fb798b3d /include/linux/dmaengine.h | |
parent | 659c36fcda403013a01b85da07cf2d9711e6d6c7 (diff) | |
parent | 0034102808e0dbbf3a2394b82b1bb40b5778de9e (diff) |
Merge tag 'v3.4-rc2' into perf/core
Merge Linux 3.4-rc2: we were on v3.3, update the base.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/dmaengine.h')
-rw-r--r-- | include/linux/dmaengine.h | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index a5966f691ef8..676f967390ae 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -18,14 +18,15 @@ | |||
18 | * The full GNU General Public License is included in this distribution in the | 18 | * The full GNU General Public License is included in this distribution in the |
19 | * file called COPYING. | 19 | * file called COPYING. |
20 | */ | 20 | */ |
21 | #ifndef DMAENGINE_H | 21 | #ifndef LINUX_DMAENGINE_H |
22 | #define DMAENGINE_H | 22 | #define LINUX_DMAENGINE_H |
23 | 23 | ||
24 | #include <linux/device.h> | 24 | #include <linux/device.h> |
25 | #include <linux/uio.h> | 25 | #include <linux/uio.h> |
26 | #include <linux/bug.h> | 26 | #include <linux/bug.h> |
27 | #include <linux/scatterlist.h> | 27 | #include <linux/scatterlist.h> |
28 | #include <linux/bitmap.h> | 28 | #include <linux/bitmap.h> |
29 | #include <linux/types.h> | ||
29 | #include <asm/page.h> | 30 | #include <asm/page.h> |
30 | 31 | ||
31 | /** | 32 | /** |
@@ -258,6 +259,7 @@ struct dma_chan_percpu { | |||
258 | * struct dma_chan - devices supply DMA channels, clients use them | 259 | * struct dma_chan - devices supply DMA channels, clients use them |
259 | * @device: ptr to the dma device who supplies this channel, always !%NULL | 260 | * @device: ptr to the dma device who supplies this channel, always !%NULL |
260 | * @cookie: last cookie value returned to client | 261 | * @cookie: last cookie value returned to client |
262 | * @completed_cookie: last completed cookie for this channel | ||
261 | * @chan_id: channel ID for sysfs | 263 | * @chan_id: channel ID for sysfs |
262 | * @dev: class device for sysfs | 264 | * @dev: class device for sysfs |
263 | * @device_node: used to add this to the device chan list | 265 | * @device_node: used to add this to the device chan list |
@@ -269,6 +271,7 @@ struct dma_chan_percpu { | |||
269 | struct dma_chan { | 271 | struct dma_chan { |
270 | struct dma_device *device; | 272 | struct dma_device *device; |
271 | dma_cookie_t cookie; | 273 | dma_cookie_t cookie; |
274 | dma_cookie_t completed_cookie; | ||
272 | 275 | ||
273 | /* sysfs */ | 276 | /* sysfs */ |
274 | int chan_id; | 277 | int chan_id; |
@@ -332,6 +335,9 @@ enum dma_slave_buswidth { | |||
332 | * may or may not be applicable on memory sources. | 335 | * may or may not be applicable on memory sources. |
333 | * @dst_maxburst: same as src_maxburst but for destination target | 336 | * @dst_maxburst: same as src_maxburst but for destination target |
334 | * mutatis mutandis. | 337 | * mutatis mutandis. |
338 | * @device_fc: Flow Controller Settings. Only valid for slave channels. Fill | ||
339 | * with 'true' if peripheral should be flow controller. Direction will be | ||
340 | * selected at Runtime. | ||
335 | * | 341 | * |
336 | * This struct is passed in as configuration data to a DMA engine | 342 | * This struct is passed in as configuration data to a DMA engine |
337 | * in order to set up a certain channel for DMA transport at runtime. | 343 | * in order to set up a certain channel for DMA transport at runtime. |
@@ -358,6 +364,7 @@ struct dma_slave_config { | |||
358 | enum dma_slave_buswidth dst_addr_width; | 364 | enum dma_slave_buswidth dst_addr_width; |
359 | u32 src_maxburst; | 365 | u32 src_maxburst; |
360 | u32 dst_maxburst; | 366 | u32 dst_maxburst; |
367 | bool device_fc; | ||
361 | }; | 368 | }; |
362 | 369 | ||
363 | static inline const char *dma_chan_name(struct dma_chan *chan) | 370 | static inline const char *dma_chan_name(struct dma_chan *chan) |
@@ -576,10 +583,11 @@ struct dma_device { | |||
576 | struct dma_async_tx_descriptor *(*device_prep_slave_sg)( | 583 | struct dma_async_tx_descriptor *(*device_prep_slave_sg)( |
577 | struct dma_chan *chan, struct scatterlist *sgl, | 584 | struct dma_chan *chan, struct scatterlist *sgl, |
578 | unsigned int sg_len, enum dma_transfer_direction direction, | 585 | unsigned int sg_len, enum dma_transfer_direction direction, |
579 | unsigned long flags); | 586 | unsigned long flags, void *context); |
580 | struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)( | 587 | struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)( |
581 | struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, | 588 | struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, |
582 | size_t period_len, enum dma_transfer_direction direction); | 589 | size_t period_len, enum dma_transfer_direction direction, |
590 | void *context); | ||
583 | struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)( | 591 | struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)( |
584 | struct dma_chan *chan, struct dma_interleaved_template *xt, | 592 | struct dma_chan *chan, struct dma_interleaved_template *xt, |
585 | unsigned long flags); | 593 | unsigned long flags); |
@@ -613,7 +621,24 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single( | |||
613 | struct scatterlist sg; | 621 | struct scatterlist sg; |
614 | sg_init_one(&sg, buf, len); | 622 | sg_init_one(&sg, buf, len); |
615 | 623 | ||
616 | return chan->device->device_prep_slave_sg(chan, &sg, 1, dir, flags); | 624 | return chan->device->device_prep_slave_sg(chan, &sg, 1, |
625 | dir, flags, NULL); | ||
626 | } | ||
627 | |||
628 | static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_sg( | ||
629 | struct dma_chan *chan, struct scatterlist *sgl, unsigned int sg_len, | ||
630 | enum dma_transfer_direction dir, unsigned long flags) | ||
631 | { | ||
632 | return chan->device->device_prep_slave_sg(chan, sgl, sg_len, | ||
633 | dir, flags, NULL); | ||
634 | } | ||
635 | |||
636 | static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_cyclic( | ||
637 | struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, | ||
638 | size_t period_len, enum dma_transfer_direction dir) | ||
639 | { | ||
640 | return chan->device->device_prep_dma_cyclic(chan, buf_addr, buf_len, | ||
641 | period_len, dir, NULL); | ||
617 | } | 642 | } |
618 | 643 | ||
619 | static inline int dmaengine_terminate_all(struct dma_chan *chan) | 644 | static inline int dmaengine_terminate_all(struct dma_chan *chan) |