blob: 41167931e5d9f6596d6f304ee7aca1395d8ab6a2 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef __ASM_SH_DMA_MAPPING_H
3#define __ASM_SH_DMA_MAPPING_H
4
Bart Van Assche52997092017-01-20 13:04:01 -08005extern const struct dma_map_ops *dma_ops;
Paul Mundt73c926b2009-10-20 12:55:56 +09006extern void no_iommu_init(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
Bart Van Assche815dd182017-01-20 13:04:04 -08008static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
Paul Mundt73c926b2009-10-20 12:55:56 +09009{
10 return dma_ops;
11}
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
Paul Mundtf32154c92009-10-26 09:50:51 +090013extern void *dma_generic_alloc_coherent(struct device *dev, size_t size,
Andrzej Pietrasiewicz552c0d32011-12-14 12:11:13 +010014 dma_addr_t *dma_addr, gfp_t flag,
Krzysztof Kozlowski00085f12016-08-03 13:46:00 -070015 unsigned long attrs);
Paul Mundtf32154c92009-10-26 09:50:51 +090016extern void dma_generic_free_coherent(struct device *dev, size_t size,
Andrzej Pietrasiewicz552c0d32011-12-14 12:11:13 +010017 void *vaddr, dma_addr_t dma_handle,
Krzysztof Kozlowski00085f12016-08-03 13:46:00 -070018 unsigned long attrs);
Magnus Dammf93e97e2008-01-24 18:35:10 +090019
Christoph Hellwige0c65842017-08-27 10:35:40 +020020void sh_sync_dma_for_device(void *vaddr, size_t size,
21 enum dma_data_direction dir);
22
Linus Torvalds1da177e2005-04-16 15:20:36 -070023#endif /* __ASM_SH_DMA_MAPPING_H */