2005-04-16 22:20:36 +00:00
|
|
|
#ifndef _ASM_DMA_MAPPING_H
|
|
|
|
#define _ASM_DMA_MAPPING_H
|
|
|
|
|
2015-05-01 10:46:15 +00:00
|
|
|
#include <linux/scatterlist.h>
|
2013-03-25 18:47:29 +00:00
|
|
|
#include <asm/dma-coherence.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
#include <asm/cache.h>
|
|
|
|
|
2013-01-22 11:59:30 +00:00
|
|
|
#ifndef CONFIG_SGI_IP27 /* Kludge to fix 2.6.39 build for IP27 */
|
2010-10-01 20:27:32 +00:00
|
|
|
#include <dma-coherence.h>
|
2011-05-18 12:14:36 +00:00
|
|
|
#endif
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2010-10-01 20:27:32 +00:00
|
|
|
extern struct dma_map_ops *mips_dma_map_ops;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2010-10-01 20:27:32 +00:00
|
|
|
static inline struct dma_map_ops *get_dma_ops(struct device *dev)
|
|
|
|
{
|
|
|
|
if (dev && dev->archdata.dma_ops)
|
|
|
|
return dev->archdata.dma_ops;
|
|
|
|
else
|
|
|
|
return mips_dma_map_ops;
|
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2010-10-01 20:27:32 +00:00
|
|
|
static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
|
|
|
|
{
|
|
|
|
if (!dev->dma_mask)
|
2015-03-30 23:46:03 +00:00
|
|
|
return false;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2010-10-01 20:27:32 +00:00
|
|
|
return addr + size <= *dev->dma_mask;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void dma_mark_clean(void *addr, size_t size) {}
|
|
|
|
|
2006-12-07 04:38:56 +00:00
|
|
|
extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
|
2005-04-16 22:20:36 +00:00
|
|
|
enum dma_data_direction direction);
|
|
|
|
|
|
|
|
#endif /* _ASM_DMA_MAPPING_H */
|