Linux Audio

Check our new training course

Loading...
v5.4
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef ___ASM_SPARC_DMA_MAPPING_H
 3#define ___ASM_SPARC_DMA_MAPPING_H
 4
 5#include <asm/cpu_type.h>
 
 
 6
 7extern const struct dma_map_ops *dma_ops;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 8
 9extern struct bus_type pci_bus_type;
10
11static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
12{
13#ifdef CONFIG_SPARC_LEON
14	if (sparc_cpu_model == sparc_leon)
15		return NULL;
16#endif
17#if defined(CONFIG_SPARC32) && defined(CONFIG_PCI)
18	if (bus == &pci_bus_type)
19		return NULL;
20#endif
21	return dma_ops;
22}
23
24#endif
v4.6
 
 1#ifndef ___ASM_SPARC_DMA_MAPPING_H
 2#define ___ASM_SPARC_DMA_MAPPING_H
 3
 4#include <linux/scatterlist.h>
 5#include <linux/mm.h>
 6#include <linux/dma-debug.h>
 7
 8#define DMA_ERROR_CODE	(~(dma_addr_t)0x0)
 9
10#define HAVE_ARCH_DMA_SUPPORTED 1
11int dma_supported(struct device *dev, u64 mask);
12
13static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
14				  enum dma_data_direction dir)
15{
16	/* Since dma_{alloc,free}_noncoherent() allocated coherent memory, this
17	 * routine can be a nop.
18	 */
19}
20
21extern struct dma_map_ops *dma_ops;
22extern struct dma_map_ops *leon_dma_ops;
23extern struct dma_map_ops pci32_dma_ops;
24
25extern struct bus_type pci_bus_type;
26
27static inline struct dma_map_ops *get_dma_ops(struct device *dev)
28{
29#ifdef CONFIG_SPARC_LEON
30	if (sparc_cpu_model == sparc_leon)
31		return leon_dma_ops;
32#endif
33#if defined(CONFIG_SPARC32) && defined(CONFIG_PCI)
34	if (dev->bus == &pci_bus_type)
35		return &pci32_dma_ops;
36#endif
37	return dma_ops;
38}
39
40#endif