2017-12-23 17:56:51 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef _ASM_GENERIC_DMA_MAPPING_H
|
|
|
|
#define _ASM_GENERIC_DMA_MAPPING_H
|
|
|
|
|
|
|
|
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
|
|
|
|
{
|
2018-04-16 21:24:51 +08:00
|
|
|
/*
|
|
|
|
* Use the non-coherent ops if available. If an architecture wants a
|
|
|
|
* more fine-grained selection of operations it will have to implement
|
|
|
|
* get_arch_dma_ops itself or use the per-device dma_ops.
|
|
|
|
*/
|
|
|
|
#ifdef CONFIG_DMA_NONCOHERENT_OPS
|
|
|
|
return &dma_noncoherent_ops;
|
|
|
|
#else
|
2018-01-09 23:30:23 +08:00
|
|
|
return &dma_direct_ops;
|
2018-04-16 21:24:51 +08:00
|
|
|
#endif
|
2017-12-23 17:56:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* _ASM_GENERIC_DMA_MAPPING_H */
|