diff options
-rw-r--r-- | arch/arm/include/asm/device.h | 1 | ||||
-rw-r--r-- | arch/arm/include/asm/dma-mapping.h | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/include/asm/device.h b/arch/arm/include/asm/device.h index dc662fca9230..4111592f0130 100644 --- a/arch/arm/include/asm/device.h +++ b/arch/arm/include/asm/device.h | |||
@@ -17,6 +17,7 @@ struct dev_archdata { | |||
17 | #ifdef CONFIG_ARM_DMA_USE_IOMMU | 17 | #ifdef CONFIG_ARM_DMA_USE_IOMMU |
18 | struct dma_iommu_mapping *mapping; | 18 | struct dma_iommu_mapping *mapping; |
19 | #endif | 19 | #endif |
20 | bool dma_coherent; | ||
20 | }; | 21 | }; |
21 | 22 | ||
22 | struct omap_device; | 23 | struct omap_device; |
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index 85738b200023..e6e3446abdf6 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h | |||
@@ -123,11 +123,18 @@ static inline unsigned long dma_max_pfn(struct device *dev) | |||
123 | 123 | ||
124 | static inline int set_arch_dma_coherent_ops(struct device *dev) | 124 | static inline int set_arch_dma_coherent_ops(struct device *dev) |
125 | { | 125 | { |
126 | dev->archdata.dma_coherent = true; | ||
126 | set_dma_ops(dev, &arm_coherent_dma_ops); | 127 | set_dma_ops(dev, &arm_coherent_dma_ops); |
127 | return 0; | 128 | return 0; |
128 | } | 129 | } |
129 | #define set_arch_dma_coherent_ops(dev) set_arch_dma_coherent_ops(dev) | 130 | #define set_arch_dma_coherent_ops(dev) set_arch_dma_coherent_ops(dev) |
130 | 131 | ||
132 | /* do not use this function in a driver */ | ||
133 | static inline bool is_device_dma_coherent(struct device *dev) | ||
134 | { | ||
135 | return dev->archdata.dma_coherent; | ||
136 | } | ||
137 | |||
131 | static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) | 138 | static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) |
132 | { | 139 | { |
133 | unsigned int offset = paddr & ~PAGE_MASK; | 140 | unsigned int offset = paddr & ~PAGE_MASK; |