From: Jianqun xu Date: Mon, 30 Nov 2015 12:09:03 +0000 (+0800) Subject: staging: ion: export ion map/ummap iommu APIs X-Git-Tag: firefly_0821_release~3572 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=f0a6ed49af3196e420b19acabea0b96a99ec3892;p=firefly-linux-kernel-4.4.55.git 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 --- 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);