Lines Matching refs:dev
9 static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr);
14 static inline dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr) in __phys_to_dma() argument
18 return dev_addr - ((dma_addr_t)dev->dma_pfn_offset << PAGE_SHIFT); in __phys_to_dma()
21 static inline phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t dev_addr) in __dma_to_phys() argument
25 return paddr + ((phys_addr_t)dev->dma_pfn_offset << PAGE_SHIFT); in __dma_to_phys()
28 static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) in dma_capable() argument
32 if (!dev->dma_mask) in dma_capable()
36 min(addr, end) < phys_to_dma(dev, PFN_PHYS(min_low_pfn))) in dma_capable()
39 return end <= min_not_zero(*dev->dma_mask, dev->bus_dma_mask); in dma_capable()
44 bool force_dma_unencrypted(struct device *dev);
46 static inline bool force_dma_unencrypted(struct device *dev) in force_dma_unencrypted() argument
58 static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) in phys_to_dma() argument
60 return __sme_set(__phys_to_dma(dev, paddr)); in phys_to_dma()
63 static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr) in dma_to_phys() argument
65 return __sme_clr(__dma_to_phys(dev, daddr)); in dma_to_phys()
68 u64 dma_direct_get_required_mask(struct device *dev);
69 void *dma_direct_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
71 void dma_direct_free(struct device *dev, size_t size, void *cpu_addr,
73 void *dma_direct_alloc_pages(struct device *dev, size_t size,
75 void dma_direct_free_pages(struct device *dev, size_t size, void *cpu_addr,
77 struct page *__dma_direct_alloc_pages(struct device *dev, size_t size,
79 void __dma_direct_free_pages(struct device *dev, size_t size, struct page *page);
80 int dma_direct_supported(struct device *dev, u64 mask);