dma-mapping.h 856 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (c) 2018 Western Digital Corporation or its affiliates.
  4. *
  5. * Authors:
  6. * Anup Patel <anup.patel@wdc.com>
  7. */
  8. #ifndef __ASM_RISCV_DMA_MAPPING_H
  9. #define __ASM_RISCV_DMA_MAPPING_H
  10. #include <linux/dma-direction.h>
  11. #define dma_mapping_error(x, y) 0
  12. static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
  13. {
  14. *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, ROUND(len, ARCH_DMA_MINALIGN));
  15. return (void *)*handle;
  16. }
  17. static inline void dma_free_coherent(void *addr)
  18. {
  19. free(addr);
  20. }
  21. static inline unsigned long dma_map_single(volatile void *vaddr, size_t len,
  22. enum dma_data_direction dir)
  23. {
  24. return (unsigned long)vaddr;
  25. }
  26. static inline void dma_unmap_single(volatile void *vaddr, size_t len,
  27. unsigned long paddr)
  28. {
  29. }
  30. #endif /* __ASM_RISCV_DMA_MAPPING_H */