Marek Szyprowski | c64be2b | 2011-12-29 13:09:51 +0100 | [diff] [blame] | 1 | #ifndef ASM_DMA_CONTIGUOUS_H |
| 2 | #define ASM_DMA_CONTIGUOUS_H |
| 3 | |
| 4 | #ifdef __KERNEL__ |
| 5 | #ifdef CONFIG_CMA |
| 6 | |
| 7 | #include <linux/device.h> |
| 8 | #include <linux/dma-contiguous.h> |
| 9 | |
| 10 | static inline struct cma *dev_get_cma_area(struct device *dev) |
| 11 | { |
| 12 | if (dev && dev->cma_area) |
| 13 | return dev->cma_area; |
| 14 | return dma_contiguous_default_area; |
| 15 | } |
| 16 | |
| 17 | static inline void dev_set_cma_area(struct device *dev, struct cma *cma) |
| 18 | { |
| 19 | if (dev) |
| 20 | dev->cma_area = cma; |
Marek Szyprowski | cc2caea | 2012-07-06 12:02:04 +0200 | [diff] [blame] | 21 | if (!dev && !dma_contiguous_default_area) |
Marek Szyprowski | c64be2b | 2011-12-29 13:09:51 +0100 | [diff] [blame] | 22 | dma_contiguous_default_area = cma; |
| 23 | } |
| 24 | |
| 25 | #endif |
| 26 | #endif |
| 27 | |
| 28 | #endif |