@@ -274,6 +274,8 @@ DMA
PCI
pcim_enable_device() : after success, all PCI ops become managed
pcim_pin_device() : keep PCI device enabled after release
+ pcim_map_single()
+ pcim_unmap_single()
IOMAP
devm_ioport_map()
@@ -113,4 +113,22 @@ static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
}
#endif
+/*
+ * Managed DMA API
+ */
+
+static inline int
+pcim_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction,
+ dma_addr_t *ret_dma_handle)
+{
+ return dmam_map_single(hwdev == NULL ? NULL : &hwdev->dev, ptr, size, (enum dma_data_direction)direction, ret_dma_handle);
+}
+
+static inline void
+pcim_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
+ size_t size, int direction)
+{
+ dmam_unmap_single(hwdev == NULL ? NULL : &hwdev->dev, dma_addr, size, (enum dma_data_direction)direction);
+}
+
#endif
Signed-off-by: Eli Billauer <eli.billauer@gmail.com> --- Documentation/driver-model/devres.txt | 2 ++ include/asm-generic/pci-dma-compat.h | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-)