2018-01-10 23:21:13 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef ASM_POWERPC_DMA_DIRECT_H
|
|
|
|
#define ASM_POWERPC_DMA_DIRECT_H 1
|
|
|
|
|
2020-08-17 23:34:03 +08:00
|
|
|
static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
|
2018-01-10 23:21:13 +08:00
|
|
|
{
|
2019-02-13 15:01:31 +08:00
|
|
|
return paddr + dev->archdata.dma_offset;
|
2018-01-10 23:21:13 +08:00
|
|
|
}
|
|
|
|
|
2020-09-08 23:56:22 +08:00
|
|
|
static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)
|
2018-01-10 23:21:13 +08:00
|
|
|
{
|
2019-02-13 15:01:31 +08:00
|
|
|
return daddr - dev->archdata.dma_offset;
|
2018-01-10 23:21:13 +08:00
|
|
|
}
|
|
|
|
#endif /* ASM_POWERPC_DMA_DIRECT_H */
|