ivtv-udma.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. Copyright (C) 2003-2004 Kevin Thayer <nufan_wfk at yahoo.com>
  4. Copyright (C) 2004 Chris Kennedy <[email protected]>
  5. Copyright (C) 2006-2007 Hans Verkuil <[email protected]>
  6. */
  7. #ifndef IVTV_UDMA_H
  8. #define IVTV_UDMA_H
  9. /* User DMA functions */
  10. void ivtv_udma_get_page_info(struct ivtv_dma_page_info *dma_page, unsigned long first, unsigned long size);
  11. int ivtv_udma_fill_sg_list(struct ivtv_user_dma *dma, struct ivtv_dma_page_info *dma_page, int map_offset);
  12. void ivtv_udma_fill_sg_array(struct ivtv_user_dma *dma, u32 buffer_offset, u32 buffer_offset_2, u32 split);
  13. int ivtv_udma_setup(struct ivtv *itv, unsigned long ivtv_dest_addr,
  14. void __user *userbuf, int size_in_bytes);
  15. void ivtv_udma_unmap(struct ivtv *itv);
  16. void ivtv_udma_free(struct ivtv *itv);
  17. void ivtv_udma_alloc(struct ivtv *itv);
  18. void ivtv_udma_prepare(struct ivtv *itv);
  19. void ivtv_udma_start(struct ivtv *itv);
  20. static inline void ivtv_udma_sync_for_device(struct ivtv *itv)
  21. {
  22. dma_sync_single_for_device(&itv->pdev->dev, itv->udma.SG_handle,
  23. sizeof(itv->udma.SGarray), DMA_TO_DEVICE);
  24. }
  25. static inline void ivtv_udma_sync_for_cpu(struct ivtv *itv)
  26. {
  27. dma_sync_single_for_cpu(&itv->pdev->dev, itv->udma.SG_handle,
  28. sizeof(itv->udma.SGarray), DMA_TO_DEVICE);
  29. }
  30. #endif