diff options
-rw-r--r-- | include/linux/dmaengine.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 32cd84b47478..2218fdcbe8a9 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -494,6 +494,40 @@ struct dma_device { | |||
494 | void (*device_issue_pending)(struct dma_chan *chan); | 494 | void (*device_issue_pending)(struct dma_chan *chan); |
495 | }; | 495 | }; |
496 | 496 | ||
497 | static inline int dmaengine_device_control(struct dma_chan *chan, | ||
498 | enum dma_ctrl_cmd cmd, | ||
499 | unsigned long arg) | ||
500 | { | ||
501 | return chan->device->device_control(chan, cmd, arg); | ||
502 | } | ||
503 | |||
504 | static inline int dmaengine_slave_config(struct dma_chan *chan, | ||
505 | struct dma_slave_config *config) | ||
506 | { | ||
507 | return dmaengine_device_control(chan, DMA_SLAVE_CONFIG, | ||
508 | (unsigned long)config); | ||
509 | } | ||
510 | |||
511 | static inline int dmaengine_terminate_all(struct dma_chan *chan) | ||
512 | { | ||
513 | return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0); | ||
514 | } | ||
515 | |||
516 | static inline int dmaengine_pause(struct dma_chan *chan) | ||
517 | { | ||
518 | return dmaengine_device_control(chan, DMA_PAUSE, 0); | ||
519 | } | ||
520 | |||
521 | static inline int dmaengine_resume(struct dma_chan *chan) | ||
522 | { | ||
523 | return dmaengine_device_control(chan, DMA_RESUME, 0); | ||
524 | } | ||
525 | |||
526 | static inline int dmaengine_submit(struct dma_async_tx_descriptor *desc) | ||
527 | { | ||
528 | return desc->tx_submit(desc); | ||
529 | } | ||
530 | |||
497 | static inline bool dmaengine_check_align(u8 align, size_t off1, size_t off2, size_t len) | 531 | static inline bool dmaengine_check_align(u8 align, size_t off1, size_t off2, size_t len) |
498 | { | 532 | { |
499 | size_t mask; | 533 | size_t mask; |