]> 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 0f8a354fd4686dc49cbd6718ef565e9b73786386..61addb1677e950c75936cce24905f850e23e7a04 100644 (file)
@@ -49,7 +49,19 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
 
 static inline int plat_device_is_coherent(struct device *dev)
 {
-       return coherentio;
+#ifdef CONFIG_DMA_PERDEV_COHERENT
+       return dev->archdata.dma_coherent;
+#else
+       switch (coherentio) {
+       default:
+       case IO_COHERENCE_DEFAULT:
+               return hw_coherentio;
+       case IO_COHERENCE_ENABLED:
+               return 1;
+       case IO_COHERENCE_DISABLED:
+               return 0;
+       }
+#endif
 }
 
 #ifndef plat_post_dma_flush