summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaura Abbott <lauraa@codeaurora.org>2014-07-31 12:43:26 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:04:04 -0700
commit2e3f26f0691a0ef4d9c315cda10c33720492fc2d (patch)
tree8da4588e17a991c2df21b96f52576408263c7ff7 /include
parentcb22ca6421aeb9f3835fae4ef7d965dd6be9d7b9 (diff)
arm64: Add dma mapping APIs for other memory types
Users of dma on arm may call dma_*_writecombine and dma_*_nonconsistent. Add these functions for arm64 as well. Change-Id: I213f8314022969bcefbfcd8581725762c385fb18 Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/dma-mapping-common.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h
index 0b1bd1f9f6c7..5956fef011fe 100644
--- a/include/asm-generic/dma-mapping-common.h
+++ b/include/asm-generic/dma-mapping-common.h
@@ -328,6 +328,29 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
#endif
}
+static inline void *dma_alloc_nonconsistent(struct device *dev, size_t size,
+ dma_addr_t *dma_handle, gfp_t flag)
+{
+ DEFINE_DMA_ATTRS(attrs);
+ dma_set_attr(DMA_ATTR_NON_CONSISTENT, &attrs);
+ return dma_alloc_attrs(dev, size, dma_handle, flag, &attrs);
+}
+
+static inline void dma_free_nonconsistent(struct device *dev, size_t size,
+ void *cpu_addr, dma_addr_t dma_handle)
+{
+ DEFINE_DMA_ATTRS(attrs);
+ dma_set_attr(DMA_ATTR_NON_CONSISTENT, &attrs);
+ return dma_free_attrs(dev, size, cpu_addr, dma_handle, &attrs);
+}
+
+static inline int dma_mmap_nonconsistent(struct device *dev,
+ struct vm_area_struct *vma, void *cpu_addr,
+ dma_addr_t dma_addr, size_t size)
+{
+ return -ENODEV;
+}
+
#ifndef HAVE_ARCH_DMA_SUPPORTED
static inline int dma_supported(struct device *dev, u64 mask)
{