mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-14 17:46:54 +07:00
e1c7e32453
Move the generic implementation to <linux/dma-mapping.h> now that all architectures support it and remove the HAVE_DMA_ATTR Kconfig symbol now that everyone supports them. [valentinrothberg@gmail.com: remove leftovers in Kconfig] Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: "David S. Miller" <davem@davemloft.net> Cc: Aurelien Jacquiot <a-jacquiot@ti.com> Cc: Chris Metcalf <cmetcalf@ezchip.com> Cc: David Howells <dhowells@redhat.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Haavard Skinnemoen <hskinnemoen@gmail.com> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no> Cc: Helge Deller <deller@gmx.de> Cc: James Hogan <james.hogan@imgtec.com> Cc: Jesper Nilsson <jesper.nilsson@axis.com> Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com> Cc: Ley Foon Tan <lftan@altera.com> Cc: Mark Salter <msalter@redhat.com> Cc: Mikael Starvik <starvik@axis.com> Cc: Steven Miao <realmz6@gmail.com> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Christian Borntraeger <borntraeger@de.ibm.com> Cc: Joerg Roedel <jroedel@suse.de> Cc: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
47 lines
1.1 KiB
C
47 lines
1.1 KiB
C
/*
|
|
* Copyright 2004-2009 Analog Devices Inc.
|
|
*
|
|
* Licensed under the GPL-2 or later.
|
|
*/
|
|
|
|
#ifndef _BLACKFIN_DMA_MAPPING_H
|
|
#define _BLACKFIN_DMA_MAPPING_H
|
|
|
|
#include <asm/cacheflush.h>
|
|
|
|
extern void
|
|
__dma_sync(dma_addr_t addr, size_t size, enum dma_data_direction dir);
|
|
static inline void
|
|
__dma_sync_inline(dma_addr_t addr, size_t size, enum dma_data_direction dir)
|
|
{
|
|
switch (dir) {
|
|
case DMA_NONE:
|
|
BUG();
|
|
case DMA_TO_DEVICE: /* writeback only */
|
|
flush_dcache_range(addr, addr + size);
|
|
break;
|
|
case DMA_FROM_DEVICE: /* invalidate only */
|
|
case DMA_BIDIRECTIONAL: /* flush and invalidate */
|
|
/* Blackfin has no dedicated invalidate (it includes a flush) */
|
|
invalidate_dcache_range(addr, addr + size);
|
|
break;
|
|
}
|
|
}
|
|
static inline void
|
|
_dma_sync(dma_addr_t addr, size_t size, enum dma_data_direction dir)
|
|
{
|
|
if (__builtin_constant_p(dir))
|
|
__dma_sync_inline(addr, size, dir);
|
|
else
|
|
__dma_sync(addr, size, dir);
|
|
}
|
|
|
|
extern struct dma_map_ops bfin_dma_ops;
|
|
|
|
static inline struct dma_map_ops *get_dma_ops(struct device *dev)
|
|
{
|
|
return &bfin_dma_ops;
|
|
}
|
|
|
|
#endif /* _BLACKFIN_DMA_MAPPING_H */
|