Commit 742636f5bfd92ad67f4a48f4b7a2ac655797e0f3

Authored by Roman Zippel
Committed by Linus Torvalds
1 parent b035c96b2d

[PATCH] m68k: dma API addition

Additions to dma API with some small cleanups.

Signed-off-by: Richard Hirst <rhirst@levanta.com>
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 28 additions and 0 deletions Side-by-side Diff

include/asm-m68k/dma-mapping.h
1 1 #ifndef _M68K_DMA_MAPPING_H
2 2 #define _M68K_DMA_MAPPING_H
3 3  
  4 +#include <asm/cache.h>
  5 +
4 6 struct scatterlist;
5 7  
6 8 static inline int dma_supported(struct device *dev, u64 mask)
7 9  
... ... @@ -13,10 +15,36 @@
13 15 return 0;
14 16 }
15 17  
  18 +static inline int dma_get_cache_alignment(void)
  19 +{
  20 + return 1 << L1_CACHE_SHIFT;
  21 +}
  22 +
  23 +static inline int dma_is_consistent(dma_addr_t dma_addr)
  24 +{
  25 + return 0;
  26 +}
  27 +
16 28 extern void *dma_alloc_coherent(struct device *, size_t,
17 29 dma_addr_t *, int);
18 30 extern void dma_free_coherent(struct device *, size_t,
19 31 void *, dma_addr_t);
  32 +
  33 +static inline void *dma_alloc_noncoherent(struct device *dev, size_t size,
  34 + dma_addr_t *handle, int flag)
  35 +{
  36 + return dma_alloc_coherent(dev, size, handle, flag);
  37 +}
  38 +static inline void dma_free_noncoherent(struct device *dev, size_t size,
  39 + void *addr, dma_addr_t handle)
  40 +{
  41 + dma_free_coherent(dev, size, addr, handle);
  42 +}
  43 +static inline void dma_cache_sync(void *vaddr, size_t size,
  44 + enum dma_data_direction dir)
  45 +{
  46 + /* we use coherent allocation, so not much to do here. */
  47 +}
20 48  
21 49 extern dma_addr_t dma_map_single(struct device *, void *, size_t,
22 50 enum dma_data_direction);