diff options
author | Vinod Koul <vinod.koul@intel.com> | 2015-06-25 06:51:49 +0300 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-06-25 06:51:49 +0300 |
commit | 4fb9c15b4f2371b8640c411ceff2c100857aee2c (patch) | |
tree | 264ffec20dcd50abe1e2f3b2e7fb67f725b8711c /include/linux/dmaengine.h | |
parent | 0e0fa66e39db6b2c72dbc0d8975fc2a45533a8eb (diff) | |
parent | 5abecfa5e969722ab85a173168cae9e0f4cedbfc (diff) | |
download | linux-4fb9c15b4f2371b8640c411ceff2c100857aee2c.tar.xz |
Merge branch 'topic/xdmac' into for-linus
Diffstat (limited to 'include/linux/dmaengine.h')
-rw-r--r-- | include/linux/dmaengine.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 2882a201c1cb..e2f5eb419976 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -923,6 +923,33 @@ static inline int dma_maxpq(struct dma_device *dma, enum dma_ctrl_flags flags) BUG(); } +static inline size_t dmaengine_get_icg(bool inc, bool sgl, size_t icg, + size_t dir_icg) +{ + if (inc) { + if (dir_icg) + return dir_icg; + else if (sgl) + return icg; + } + + return 0; +} + +static inline size_t dmaengine_get_dst_icg(struct dma_interleaved_template *xt, + struct data_chunk *chunk) +{ + return dmaengine_get_icg(xt->dst_inc, xt->dst_sgl, + chunk->icg, chunk->dst_icg); +} + +static inline size_t dmaengine_get_src_icg(struct dma_interleaved_template *xt, + struct data_chunk *chunk) +{ + return dmaengine_get_icg(xt->src_inc, xt->src_sgl, + chunk->icg, chunk->src_icg); +} + /* --- public DMA engine API --- */ #ifdef CONFIG_DMA_ENGINE |