mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
ANDROID: Export functions to be used with dma_map_ops in modules
For modules to reuse default dma_map_ops implementations they need to be exported. Export the following functions: dma_direct_alloc dma_direct_free dma_common_mmap dma_common_get_sgtable dma_direct_get_required_mask Bug: 151050914 Signed-off-by: Suren Baghdasaryan <surenb@google.com> Change-Id: Ia77b797fcd909fce01da7431bfbde282dc70b3b3 (cherry picked from commit fd31496dae939c7bf2ef874e08d4bf8c6ab738b3)
This commit is contained in:
@@ -43,6 +43,7 @@ u64 dma_direct_get_required_mask(struct device *dev)
|
||||
|
||||
return (1ULL << (fls64(max_dma) - 1)) * 2 - 1;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dma_direct_get_required_mask);
|
||||
|
||||
static gfp_t __dma_direct_optimal_gfp_mask(struct device *dev, u64 dma_mask,
|
||||
u64 *phys_limit)
|
||||
@@ -231,6 +232,7 @@ void *dma_direct_alloc(struct device *dev, size_t size,
|
||||
return arch_dma_alloc(dev, size, dma_handle, gfp, attrs);
|
||||
return dma_direct_alloc_pages(dev, size, dma_handle, gfp, attrs);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dma_direct_alloc);
|
||||
|
||||
void dma_direct_free(struct device *dev, size_t size,
|
||||
void *cpu_addr, dma_addr_t dma_addr, unsigned long attrs)
|
||||
@@ -242,6 +244,7 @@ void dma_direct_free(struct device *dev, size_t size,
|
||||
else
|
||||
dma_direct_free_pages(dev, size, cpu_addr, dma_addr, attrs);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dma_direct_free);
|
||||
|
||||
#if defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \
|
||||
defined(CONFIG_SWIOTLB)
|
||||
|
||||
@@ -120,6 +120,7 @@ int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
|
||||
sg_set_page(sgt->sgl, page, PAGE_ALIGN(size), 0);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dma_common_get_sgtable);
|
||||
|
||||
/*
|
||||
* The whole dma_get_sgtable() idea is fundamentally unsafe - it seems
|
||||
@@ -194,6 +195,7 @@ int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
|
||||
return -ENXIO;
|
||||
#endif /* CONFIG_MMU */
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dma_common_mmap);
|
||||
|
||||
/**
|
||||
* dma_can_mmap - check if a given device supports dma_mmap_*
|
||||
|
||||
Reference in New Issue
Block a user