Merge tag 'mac80211-for-davem-2014-12-18' of git://git.kernel.org/pub/scm/linux/kerne...
[cascardo/linux.git] / arch / arm64 / include / asm / dma-mapping.h
index adeae3f..d34189b 100644 (file)
@@ -54,11 +54,18 @@ static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops)
 
 static inline int set_arch_dma_coherent_ops(struct device *dev)
 {
+       dev->archdata.dma_coherent = true;
        set_dma_ops(dev, &coherent_swiotlb_dma_ops);
        return 0;
 }
 #define set_arch_dma_coherent_ops      set_arch_dma_coherent_ops
 
+/* do not use this function in a driver */
+static inline bool is_device_dma_coherent(struct device *dev)
+{
+       return dev->archdata.dma_coherent;
+}
+
 #include <asm-generic/dma-mapping-common.h>
 
 static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)