Merge "dma-mapping: add the missing functions to dma_map_ops"
This commit is contained in:
commit
4c9126a7a2
1 changed files with 21 additions and 0 deletions
|
@ -2085,6 +2085,25 @@ static void arm_iommu_sync_single_for_device(struct device *dev,
|
|||
__dma_page_cpu_to_dev(page, offset, size, dir);
|
||||
}
|
||||
|
||||
static int arm_iommu_dma_supported(struct device *dev, u64 mask)
|
||||
{
|
||||
struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev);
|
||||
|
||||
if (!mapping) {
|
||||
dev_warn(dev, "No IOMMU mapping for device\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return iommu_dma_supported(mapping->domain, dev, mask);
|
||||
}
|
||||
|
||||
static int arm_iommu_mapping_error(struct device *dev,
|
||||
dma_addr_t dma_addr)
|
||||
{
|
||||
return dma_addr == DMA_ERROR_CODE;
|
||||
}
|
||||
|
||||
|
||||
const struct dma_map_ops iommu_ops = {
|
||||
.alloc = arm_iommu_alloc_attrs,
|
||||
.free = arm_iommu_free_attrs,
|
||||
|
@ -2102,6 +2121,8 @@ const struct dma_map_ops iommu_ops = {
|
|||
.sync_sg_for_device = arm_iommu_sync_sg_for_device,
|
||||
|
||||
.set_dma_mask = arm_dma_set_mask,
|
||||
.dma_supported = arm_iommu_dma_supported,
|
||||
.mapping_error = arm_iommu_mapping_error,
|
||||
};
|
||||
|
||||
const struct dma_map_ops iommu_coherent_ops = {
|
||||
|
|
Loading…
Add table
Reference in a new issue