staging: ion: export ion map/ummap iommu APIs
authorJianqun xu <jay.xu@rock-chips.com>
Mon, 30 Nov 2015 12:09:03 +0000 (20:09 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Tue, 1 Dec 2015 06:13:45 +0000 (14:13 +0800)
Add these two functions to ion.h:
- ion_map_iommu
- ion_unmap_iommu

Change-Id: Ide5aec58cdf43862b1f135fd2cd224d044375793
Signed-off-by: Jianqun xu <jay.xu@rock-chips.com>
drivers/staging/android/ion/ion.h

index 86575525db34717d05049323a69a2c0b5c180aec..bd35c9c259d41437160b415e2a43bc9596a2b85b 100644 (file)
@@ -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);