]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/mips/include/asm/mach-generic/dma-coherence.h
MIPS: Support per-device DMA coherence
[linux.git] / arch / mips / include / asm / mach-generic / dma-coherence.h
index 8484f82fc7941f9cee73050726eb316c3f90a7b6..61addb1677e950c75936cce24905f850e23e7a04 100644 (file)
@@ -49,6 +49,9 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
 
 static inline int plat_device_is_coherent(struct device *dev)
 {
+#ifdef CONFIG_DMA_PERDEV_COHERENT
+       return dev->archdata.dma_coherent;
+#else
        switch (coherentio) {
        default:
        case IO_COHERENCE_DEFAULT:
@@ -58,6 +61,7 @@ static inline int plat_device_is_coherent(struct device *dev)
        case IO_COHERENCE_DISABLED:
                return 0;
        }
+#endif
 }
 
 #ifndef plat_post_dma_flush