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
|
|
|
|
|
2018-03-19 18:38:24 +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
|
|
|
}
|
|
|
|
|
2018-03-19 18:38:24 +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 */
|