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.h36
1 files changed, 31 insertions, 5 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index a5bb3ad5c7a5..f9a2e5e67a54 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -18,13 +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/scatterlist.h> 27#include <linux/scatterlist.h>
27#include <linux/bitmap.h> 28#include <linux/bitmap.h>
29#include <linux/types.h>
28#include <asm/page.h> 30#include <asm/page.h>
29 31
30/** 32/**
@@ -257,6 +259,7 @@ struct dma_chan_percpu {
257 * struct dma_chan - devices supply DMA channels, clients use them 259 * struct dma_chan - devices supply DMA channels, clients use them
258 * @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
259 * @cookie: last cookie value returned to client 261 * @cookie: last cookie value returned to client
262 * @completed_cookie: last completed cookie for this channel
260 * @chan_id: channel ID for sysfs 263 * @chan_id: channel ID for sysfs
261 * @dev: class device for sysfs 264 * @dev: class device for sysfs
262 * @device_node: used to add this to the device chan list 265 * @device_node: used to add this to the device chan list
@@ -268,6 +271,7 @@ struct dma_chan_percpu {
268struct dma_chan { 271struct dma_chan {
269 struct dma_device *device; 272 struct dma_device *device;
270 dma_cookie_t cookie; 273 dma_cookie_t cookie;
274 dma_cookie_t completed_cookie;
271 275
272 /* sysfs */ 276 /* sysfs */
273 int chan_id; 277 int chan_id;
@@ -331,6 +335,9 @@ enum dma_slave_buswidth {
331 * may or may not be applicable on memory sources. 335 * may or may not be applicable on memory sources.
332 * @dst_maxburst: same as src_maxburst but for destination target 336 * @dst_maxburst: same as src_maxburst but for destination target
333 * 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.
334 * 341 *
335 * 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
336 * 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.
@@ -357,6 +364,7 @@ struct dma_slave_config {
357 enum dma_slave_buswidth dst_addr_width; 364 enum dma_slave_buswidth dst_addr_width;
358 u32 src_maxburst; 365 u32 src_maxburst;
359 u32 dst_maxburst; 366 u32 dst_maxburst;
367 bool device_fc;
360}; 368};
361 369
362static inline const char *dma_chan_name(struct dma_chan *chan) 370static inline const char *dma_chan_name(struct dma_chan *chan)
@@ -575,10 +583,11 @@ struct dma_device {
575 struct dma_async_tx_descriptor *(*device_prep_slave_sg)( 583 struct dma_async_tx_descriptor *(*device_prep_slave_sg)(
576 struct dma_chan *chan, struct scatterlist *sgl, 584 struct dma_chan *chan, struct scatterlist *sgl,
577 unsigned int sg_len, enum dma_transfer_direction direction, 585 unsigned int sg_len, enum dma_transfer_direction direction,
578 unsigned long flags); 586 unsigned long flags, void *context);
579 struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)( 587 struct dma_async_tx_descriptor *(*device_prep_dma_cyclic)(
580 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,
581 size_t period_len, enum dma_transfer_direction direction); 589 size_t period_len, enum dma_transfer_direction direction,
590 void *context);
582 struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)( 591 struct dma_async_tx_descriptor *(*device_prep_interleaved_dma)(
583 struct dma_chan *chan, struct dma_interleaved_template *xt, 592 struct dma_chan *chan, struct dma_interleaved_template *xt,
584 unsigned long flags); 593 unsigned long flags);
@@ -612,7 +621,24 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
612 struct scatterlist sg; 621 struct scatterlist sg;
613 sg_init_one(&sg, buf, len); 622 sg_init_one(&sg, buf, len);
614 623
615 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
628static 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
636static 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);
616} 642}
617 643
618static inline int dmaengine_terminate_all(struct dma_chan *chan) 644static inline int dmaengine_terminate_all(struct dma_chan *chan)