summaryrefslogtreecommitdiff
path: root/drivers/staging/android/ion/ion_priv.h
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2013-12-14 02:25:01 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-14 20:57:18 +0400
commite946b209c2ed15b1f7917def8fe6602747c3f771 (patch)
tree8860214869fc38f01dbd05f821487596aafccbc4 /drivers/staging/android/ion/ion_priv.h
parenta14baf71b91845a7f68438d48f462cb754699ae2 (diff)
downloadlinux-e946b209c2ed15b1f7917def8fe6602747c3f771.tar.xz
ion: fix dma APIs
__dma_page_cpu_to_dev is a private ARM api that is not available on 3.10 and was never available on other architectures. We can get the same behavior by calling dma_sync_sg_for_device with a scatterlist containing a single page. It's still not quite a kosher use of the dma apis, we still conflate physical addresses with bus addresses, but it should at least compile on all platforms, and work on any platform that doesn't have a physical to bus address translation. Signed-off-by: Colin Cross <ccross@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android/ion/ion_priv.h')
-rw-r--r--drivers/staging/android/ion/ion_priv.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/staging/android/ion/ion_priv.h b/drivers/staging/android/ion/ion_priv.h
index f2635631e9be..d1fa7719b240 100644
--- a/drivers/staging/android/ion/ion_priv.h
+++ b/drivers/staging/android/ion/ion_priv.h
@@ -17,6 +17,7 @@
#ifndef _ION_PRIV_H
#define _ION_PRIV_H
+#include <linux/dma-direction.h>
#include <linux/kref.h>
#include <linux/mm_types.h>
#include <linux/mutex.h>
@@ -357,4 +358,15 @@ void ion_page_pool_free(struct ion_page_pool *, struct page *);
int ion_page_pool_shrink(struct ion_page_pool *pool, gfp_t gfp_mask,
int nr_to_scan);
+/**
+ * ion_pages_sync_for_device - cache flush pages for use with the specified
+ * device
+ * @dev: the device the pages will be used with
+ * @page: the first page to be flushed
+ * @size: size in bytes of region to be flushed
+ * @dir: direction of dma transfer
+ */
+void ion_pages_sync_for_device(struct device *dev, struct page *page,
+ size_t size, enum dma_data_direction dir);
+
#endif /* _ION_PRIV_H */