From f0a6ed49af3196e420b19acabea0b96a99ec3892 Mon Sep 17 00:00:00 2001 From: Jianqun xu Date: Mon, 30 Nov 2015 20:09:03 +0800 Subject: [PATCH] staging: ion: export ion map/ummap iommu APIs Add these two functions to ion.h: - ion_map_iommu - ion_unmap_iommu Change-Id: Ide5aec58cdf43862b1f135fd2cd224d044375793 Signed-off-by: Jianqun xu --- drivers/staging/android/ion/ion.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/staging/android/ion/ion.h b/drivers/staging/android/ion/ion.h index 86575525db34..bd35c9c259d4 100644 --- a/drivers/staging/android/ion/ion.h +++ b/drivers/staging/android/ion/ion.h @@ -202,6 +202,30 @@ int ion_share_dma_buf_fd(struct ion_client *client, struct ion_handle *handle); */ struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd); +struct device; + +#ifdef CONFIG_RK_IOMMU +int ion_map_iommu(struct device *iommu_dev, struct ion_client *client, + struct ion_handle *handle, unsigned long *iova, + unsigned long *size); + +void ion_unmap_iommu(struct device *iommu_dev, struct ion_client *client, + struct ion_handle *handle); + +#else +static inline int ion_map_iommu(struct device *iommu_dev, struct ion_client *client, + struct ion_handle *handle, unsigned long *iova, + unsigned long *size) +{ + return 0; +} + +static inline void ion_unmap_iommu(struct device *iommu_dev, struct ion_client *client, + struct ion_handle *handle) +{ +} +#endif + void ion_handle_get(struct ion_handle *handle); int ion_handle_put(struct ion_handle *handle); -- 2.34.1