Lines Matching refs:dev
25 extern void *__dma_direct_alloc_coherent(struct device *dev, size_t size,
28 extern void __dma_direct_free_coherent(struct device *dev, size_t size,
31 extern int dma_direct_mmap_coherent(struct device *dev,
45 extern void *__dma_alloc_coherent(struct device *dev, size_t size,
58 #define __dma_alloc_coherent(dev, gfp, size, handle) NULL argument
65 static inline unsigned long device_to_mask(struct device *dev) in device_to_mask() argument
67 if (dev->dma_mask && *dev->dma_mask) in device_to_mask()
68 return *dev->dma_mask; in device_to_mask()
81 static inline struct dma_map_ops *get_dma_ops(struct device *dev) in get_dma_ops() argument
88 if (unlikely(dev == NULL)) in get_dma_ops()
91 return dev->archdata.dma_ops; in get_dma_ops()
94 static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops) in set_dma_ops() argument
96 dev->archdata.dma_ops = ops; in set_dma_ops()
107 static inline dma_addr_t get_dma_offset(struct device *dev) in get_dma_offset() argument
109 if (dev) in get_dma_offset()
110 return dev->archdata.dma_offset; in get_dma_offset()
115 static inline void set_dma_offset(struct device *dev, dma_addr_t off) in set_dma_offset() argument
117 if (dev) in set_dma_offset()
118 dev->archdata.dma_offset = off; in set_dma_offset()
125 extern int dma_set_mask(struct device *dev, u64 dma_mask);
127 extern int __dma_set_mask(struct device *dev, u64 dma_mask);
128 extern u64 __dma_get_required_mask(struct device *dev);
130 static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) in dma_capable() argument
133 struct dev_archdata *sd = &dev->archdata; in dma_capable()
139 if (!dev->dma_mask) in dma_capable()
142 return addr + size - 1 <= *dev->dma_mask; in dma_capable()
145 static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) in phys_to_dma() argument
147 return paddr + get_dma_offset(dev); in phys_to_dma()
150 static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr) in dma_to_phys() argument
152 return daddr - get_dma_offset(dev); in dma_to_phys()
157 static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, in dma_cache_sync() argument