blob: e17566376934f5b5dc796083b4c11fcb36aa140f [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef ___ASM_SPARC_DMA_MAPPING_H
3#define ___ASM_SPARC_DMA_MAPPING_H
4
5#include <linux/scatterlist.h>
6#include <linux/mm.h>
7#include <linux/dma-debug.h>
8
9extern const struct dma_map_ops *dma_ops;
10
11extern struct bus_type pci_bus_type;
12
13static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
14{
15#ifdef CONFIG_SPARC_LEON
16 if (sparc_cpu_model == sparc_leon)
17 return &dma_noncoherent_ops;
18#endif
19#if defined(CONFIG_SPARC32) && defined(CONFIG_PCI)
20 if (bus == &pci_bus_type)
21 return &dma_noncoherent_ops;
22#endif
23 return dma_ops;
24}
25
26#endif