.. | .. |
---|
2 | 2 | #ifndef ASM_POWERPC_DMA_DIRECT_H |
---|
3 | 3 | #define ASM_POWERPC_DMA_DIRECT_H 1 |
---|
4 | 4 | |
---|
5 | | -static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) |
---|
| 5 | +static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) |
---|
6 | 6 | { |
---|
7 | | -#ifdef CONFIG_SWIOTLB |
---|
8 | | - struct dev_archdata *sd = &dev->archdata; |
---|
9 | | - |
---|
10 | | - if (sd->max_direct_dma_addr && addr + size > sd->max_direct_dma_addr) |
---|
11 | | - return false; |
---|
12 | | -#endif |
---|
13 | | - |
---|
14 | | - if (!dev->dma_mask) |
---|
15 | | - return false; |
---|
16 | | - |
---|
17 | | - return addr + size - 1 <= *dev->dma_mask; |
---|
| 7 | + return paddr + dev->archdata.dma_offset; |
---|
18 | 8 | } |
---|
19 | 9 | |
---|
20 | | -static inline dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr) |
---|
| 10 | +static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr) |
---|
21 | 11 | { |
---|
22 | | - return paddr + get_dma_offset(dev); |
---|
23 | | -} |
---|
24 | | - |
---|
25 | | -static inline phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t daddr) |
---|
26 | | -{ |
---|
27 | | - return daddr - get_dma_offset(dev); |
---|
| 12 | + return daddr - dev->archdata.dma_offset; |
---|
28 | 13 | } |
---|
29 | 14 | #endif /* ASM_POWERPC_DMA_DIRECT_H */ |
---|