|
@@ -437,6 +437,16 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
|
|
return addr + size <= *dev->dma_mask;
|
|
return addr + size <= *dev->dma_mask;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
|
|
|
|
+{
|
|
|
|
+ return paddr + get_dma_direct_offset(dev);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)
|
|
|
|
+{
|
|
|
|
+ return daddr - get_dma_direct_offset(dev);
|
|
|
|
+}
|
|
|
|
+
|
|
#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
|
|
#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
|
|
#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
|
|
#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
|
|
#ifdef CONFIG_NOT_COHERENT_CACHE
|
|
#ifdef CONFIG_NOT_COHERENT_CACHE
|