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