diff options
author | Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | 2019-08-28 21:35:40 +0900 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2019-09-03 08:33:01 +0200 |
commit | 6ba99411b858bd70bae966633561e698cd6de38c (patch) | |
tree | 5679bf75e3c4fc1a8bba626da01c2d0ce42f556f /kernel | |
parent | 38c38cb73223218f6eedf485280917af1f8a0af2 (diff) |
dma-mapping: introduce dma_get_merge_boundary()
This patch adds a new DMA API "dma_get_merge_boundary". This function
returns the DMA merge boundary if the DMA layer can merge the segments.
This patch also adds the implementation for a new dma_map_ops pointer.
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/dma/mapping.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index 1b96616c9f20..72c825c1788e 100644 --- a/kernel/dma/mapping.c +++ b/kernel/dma/mapping.c @@ -407,3 +407,14 @@ size_t dma_max_mapping_size(struct device *dev) return size; } EXPORT_SYMBOL_GPL(dma_max_mapping_size); + +unsigned long dma_get_merge_boundary(struct device *dev) +{ + const struct dma_map_ops *ops = get_dma_ops(dev); + + if (!ops || !ops->get_merge_boundary) + return 0; /* can't merge */ + + return ops->get_merge_boundary(dev); +} +EXPORT_SYMBOL_GPL(dma_get_merge_boundary); |