1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef ASM_POWERPC_DMA_DIRECT_H
3 #define ASM_POWERPC_DMA_DIRECT_H 1
5 static inline bool dma_capable(struct device
*dev
, dma_addr_t addr
, size_t size
)
8 struct dev_archdata
*sd
= &dev
->archdata
;
10 if (sd
->max_direct_dma_addr
&& addr
+ size
> sd
->max_direct_dma_addr
)
17 return addr
+ size
- 1 <= *dev
->dma_mask
;
20 static inline dma_addr_t
phys_to_dma(struct device
*dev
, phys_addr_t paddr
)
22 return paddr
+ get_dma_offset(dev
);
25 static inline phys_addr_t
dma_to_phys(struct device
*dev
, dma_addr_t daddr
)
27 return daddr
- get_dma_offset(dev
);
29 #endif /* ASM_POWERPC_DMA_DIRECT_H */