dma-mapping.c (3f61fd41f38328f0a585eaba2d72d339fe9aecda) dma-mapping.c (33dcb37cef741294b481f4d889a465b8091f11bf)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 * Author: Catalin Marinas <catalin.marinas@arm.com>
5 */
6
7#include <linux/gfp.h>
8#include <linux/cache.h>
9#include <linux/dma-noncoherent.h>
10#include <linux/dma-iommu.h>
11
12#include <asm/cacheflush.h>
13
14pgprot_t arch_dma_mmap_pgprot(struct device *dev, pgprot_t prot,
15 unsigned long attrs)
16{
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 * Author: Catalin Marinas <catalin.marinas@arm.com>
5 */
6
7#include <linux/gfp.h>
8#include <linux/cache.h>
9#include <linux/dma-noncoherent.h>
10#include <linux/dma-iommu.h>
11
12#include <asm/cacheflush.h>
13
14pgprot_t arch_dma_mmap_pgprot(struct device *dev, pgprot_t prot,
15 unsigned long attrs)
16{
17 if (!dev_is_dma_coherent(dev) || (attrs & DMA_ATTR_WRITE_COMBINE))
18 return pgprot_writecombine(prot);
19 return prot;
17 return pgprot_writecombine(prot);
20}
21
22void arch_sync_dma_for_device(struct device *dev, phys_addr_t paddr,
23 size_t size, enum dma_data_direction dir)
24{
25 __dma_map_area(phys_to_virt(paddr), size, dir);
26}
27

--- 44 unchanged lines hidden ---
18}
19
20void arch_sync_dma_for_device(struct device *dev, phys_addr_t paddr,
21 size_t size, enum dma_data_direction dir)
22{
23 __dma_map_area(phys_to_virt(paddr), size, dir);
24}
25

--- 44 unchanged lines hidden ---