mirror of
https://github.com/torvalds/linux.git
synced 2026-11-26 16:33:17 +00:00
Octeon and Loongson share exactly the same code, move it into a common implementation, and use that implementation directly from get_arch_dma_ops. Also provide the expected dma-direct.h helpers directly instead of delegating to platform dma-coherence.h headers. Signed-off-by: Christoph Hellwig <[email protected]> Patchwork: https://patchwork.linux-mips.org/patch/19534/ Signed-off-by: Paul Burton <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: David Daney <[email protected]> Cc: Kevin Cernekee <[email protected]> Cc: Jiaxun Yang <[email protected]> Cc: Tom Bogendoerfer <[email protected]> Cc: Huacai Chen <[email protected]> Cc: [email protected] Cc: [email protected]
17 lines
426 B
C
17 lines
426 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _MIPS_DMA_DIRECT_H
|
|
#define _MIPS_DMA_DIRECT_H 1
|
|
|
|
static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
|
|
{
|
|
if (!dev->dma_mask)
|
|
return false;
|
|
|
|
return addr + size - 1 <= *dev->dma_mask;
|
|
}
|
|
|
|
dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr);
|
|
phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t daddr);
|
|
|
|
#endif /* _MIPS_DMA_DIRECT_H */
|