From: Niklas Söderlund Date: Wed, 10 Aug 2016 11:22:14 +0000 (+0200) Subject: dma-mapping: add {map,unmap}_resource to dma_map_ops X-Git-Tag: v4.9-rc1~102^2~9^2~8 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ba409b31b3d37b52dda4eefcde04f5837c7ee4aa;p=karo-tx-linux.git dma-mapping: add {map,unmap}_resource to dma_map_ops Add methods to handle mapping of device resources from a physical address. This is needed for example to be able to map MMIO FIFO registers to a IOMMU. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Acked-by: Arnd Bergmann Signed-off-by: Vinod Koul --- diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 66533e18276c..673b7be85f7a 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -95,6 +95,12 @@ struct dma_map_ops { struct scatterlist *sg, int nents, enum dma_data_direction dir, unsigned long attrs); + dma_addr_t (*map_resource)(struct device *dev, phys_addr_t phys_addr, + size_t size, enum dma_data_direction dir, + unsigned long attrs); + void (*unmap_resource)(struct device *dev, dma_addr_t dma_handle, + size_t size, enum dma_data_direction dir, + unsigned long attrs); void (*sync_single_for_cpu)(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction dir);