int sprd_iommu_mm_iova_map(struct sprd_iommu_dev *dev, unsigned long iova, size_t iova_length, struct ion_buffer *handle) { int err=-1; sprd_iommu_mm_enable(dev); err = sprd_iommu_iova_map(dev,iova,iova_length,handle); sprd_iommu_mm_disable(dev); return err; }
int sprd_iommu_mm_iova_map(struct sprd_iommu_dev *dev, unsigned long iova, size_t iova_length, struct ion_buffer *handle) { int err=-1; mutex_lock(&dev->mutex_clk_op); if (0 == dev->map_count) sprd_iommu_mm_enable(dev); dev->map_count++; mutex_unlock(&dev->mutex_clk_op); err = sprd_iommu_iova_map(dev,iova,iova_length,handle); return err; }
int sprd_iommu_gsp0_iova_map(struct sprd_iommu_dev *dev, unsigned long iova, size_t iova_length, struct sg_table *table) { int err = -1; mutex_lock(&dev->mutex_map); if (0 == dev->map_count) sprd_iommu_enable(dev); dev->map_count++; err = sprd_iommu_iova_map(dev, iova, iova_length, table); mutex_unlock(&dev->mutex_map); return err; }