aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dmaengine.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-29 18:34:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-29 18:34:57 -0400
commitef08e78268423fc4d7fbc3e54bd9a67fc8da7cc5 (patch)
treed0561d3ef89c9cd277a38168e33850666cbd33c4 /include/linux/dmaengine.h
parent71db34fc4330f7c784397acb9f1e6ee7f7b32eb2 (diff)
parent5b2e02e401deb44e7f5befe19404d8b2688efea4 (diff)
Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dmaengine update from Vinod Koul: "This includes the cookie cleanup by Russell, the addition of context parameter for dmaengine APIs, more arm dmaengine driver cleanup by moving code to dmaengine, this time for imx by Javier and pl330 by Boojin along with the usual driver fixes." Fix up some fairly trivial conflicts with various other cleanups. * 'next' of git://git.infradead.org/users/vkoul/slave-dma: (67 commits) dmaengine: imx: fix the build failure on x86_64 dmaengine: i.MX: Fix merge of cookie branch. dmaengine: i.MX: Add support for interleaved transfers. dmaengine: imx-dma: use 'dev_dbg' and 'dev_warn' for messages. dmaengine: imx-dma: remove 'imx_dmav1_baseaddr' and 'dma_clk'. dmaengine: imx-dma: remove unused arg of imxdma_sg_next. dmaengine: imx-dma: remove internal structure. dmaengine: imx-dma: remove 'resbytes' field of 'internal' structure. dmaengine: imx-dma: remove 'in_use' field of 'internal' structure. dmaengine: imx-dma: remove sg member from internal structure. dmaengine: imx-dma: remove 'imxdma_setup_sg_hw' function. dmaengine: imx-dma: remove 'imxdma_config_channel_hw' function. dmaengine: imx-dma: remove 'imxdma_setup_mem2mem_hw' function. dmaengine: imx-dma: remove dma_mode member of internal structure. dmaengine: imx-dma: remove data member from internal structure. dmaengine: imx-dma: merge old dma-v1.c with imx-dma.c dmaengine: at_hdmac: add slave config operation dmaengine: add context parameter to prep_slave_sg and prep_dma_cyclic dmaengine/dma_slave: introduce inline wrappers dma: imx-sdma: Treat firmware messages as warnings instead of erros ...
Diffstat (limited to 'include/linux/dmaengine.h')
-rw-r--r--include/linux/dmaengine.h35
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 {
269struct dma_chan { 271struct 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
363static inline const char *dma_chan_name(struct dma_chan *chan) 370static 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
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);
617} 642}
618 643
619static inline int dmaengine_terminate_all(struct dma_chan *chan) 644static inline int dmaengine_terminate_all(struct dma_chan *chan)