Lines Matching refs:dev
12 int dma_direct_get_sgtable(struct device *dev, struct sg_table *sgt,
15 bool dma_direct_can_mmap(struct device *dev);
16 int dma_direct_mmap(struct device *dev, struct vm_area_struct *vma,
19 bool dma_direct_need_sync(struct device *dev, dma_addr_t dma_addr);
20 int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl, int nents,
22 size_t dma_direct_max_mapping_size(struct device *dev);
26 void dma_direct_sync_sg_for_device(struct device *dev, struct scatterlist *sgl,
29 static inline void dma_direct_sync_sg_for_device(struct device *dev, in dma_direct_sync_sg_for_device() argument
38 void dma_direct_unmap_sg(struct device *dev, struct scatterlist *sgl,
40 void dma_direct_sync_sg_for_cpu(struct device *dev,
43 static inline void dma_direct_unmap_sg(struct device *dev, in dma_direct_unmap_sg() argument
48 static inline void dma_direct_sync_sg_for_cpu(struct device *dev, in dma_direct_sync_sg_for_cpu() argument
54 static inline void dma_direct_sync_single_for_device(struct device *dev, in dma_direct_sync_single_for_device() argument
57 phys_addr_t paddr = dma_to_phys(dev, addr); in dma_direct_sync_single_for_device()
60 swiotlb_tbl_sync_single(dev, paddr, size, dir, SYNC_FOR_DEVICE); in dma_direct_sync_single_for_device()
62 if (!dev_is_dma_coherent(dev)) in dma_direct_sync_single_for_device()
66 static inline void dma_direct_sync_single_for_cpu(struct device *dev, in dma_direct_sync_single_for_cpu() argument
69 phys_addr_t paddr = dma_to_phys(dev, addr); in dma_direct_sync_single_for_cpu()
71 if (!dev_is_dma_coherent(dev)) { in dma_direct_sync_single_for_cpu()
77 swiotlb_tbl_sync_single(dev, paddr, size, dir, SYNC_FOR_CPU); in dma_direct_sync_single_for_cpu()
83 static inline dma_addr_t dma_direct_map_page(struct device *dev, in dma_direct_map_page() argument
88 dma_addr_t dma_addr = phys_to_dma(dev, phys); in dma_direct_map_page()
91 return swiotlb_map(dev, phys, size, dir, attrs); in dma_direct_map_page()
93 if (unlikely(!dma_capable(dev, dma_addr, size, true))) { in dma_direct_map_page()
95 return swiotlb_map(dev, phys, size, dir, attrs); in dma_direct_map_page()
97 dev_WARN_ONCE(dev, 1, in dma_direct_map_page()
99 &dma_addr, size, *dev->dma_mask, dev->bus_dma_limit); in dma_direct_map_page()
103 if (!dev_is_dma_coherent(dev) && !(attrs & DMA_ATTR_SKIP_CPU_SYNC)) in dma_direct_map_page()
108 static inline void dma_direct_unmap_page(struct device *dev, dma_addr_t addr, in dma_direct_unmap_page() argument
111 phys_addr_t phys = dma_to_phys(dev, addr); in dma_direct_unmap_page()
114 dma_direct_sync_single_for_cpu(dev, addr, size, dir); in dma_direct_unmap_page()
117 swiotlb_tbl_unmap_single(dev, phys, size, size, dir, in dma_direct_unmap_page()