dma-mapping: add {map,unmap}_resource to dma_map_ops
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Wed, 10 Aug 2016 11:22:14 +0000 (13:22 +0200)
committerVinod Koul <vinod.koul@intel.com>
Mon, 26 Sep 2016 16:46:41 +0000 (22:16 +0530)
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 <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
include/linux/dma-mapping.h

index 66533e18276cf00e86de1fa8f9251c30f921fcf7..673b7be85f7a81cc90267ebf53d1a574817305db 100644 (file)
@@ -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);