Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003     Copyright (C) 2003-2004  Kevin Thayer <nufan_wfk at yahoo.com>
0004     Copyright (C) 2004  Chris Kennedy <c@groovy.org>
0005     Copyright (C) 2006-2007  Hans Verkuil <hverkuil@xs4all.nl>
0006 
0007  */
0008 
0009 #ifndef IVTV_UDMA_H
0010 #define IVTV_UDMA_H
0011 
0012 /* User DMA functions */
0013 void ivtv_udma_get_page_info(struct ivtv_dma_page_info *dma_page, unsigned long first, unsigned long size);
0014 int ivtv_udma_fill_sg_list(struct ivtv_user_dma *dma, struct ivtv_dma_page_info *dma_page, int map_offset);
0015 void ivtv_udma_fill_sg_array(struct ivtv_user_dma *dma, u32 buffer_offset, u32 buffer_offset_2, u32 split);
0016 int ivtv_udma_setup(struct ivtv *itv, unsigned long ivtv_dest_addr,
0017                void __user *userbuf, int size_in_bytes);
0018 void ivtv_udma_unmap(struct ivtv *itv);
0019 void ivtv_udma_free(struct ivtv *itv);
0020 void ivtv_udma_alloc(struct ivtv *itv);
0021 void ivtv_udma_prepare(struct ivtv *itv);
0022 void ivtv_udma_start(struct ivtv *itv);
0023 
0024 static inline void ivtv_udma_sync_for_device(struct ivtv *itv)
0025 {
0026     dma_sync_single_for_device(&itv->pdev->dev, itv->udma.SG_handle,
0027                    sizeof(itv->udma.SGarray), DMA_TO_DEVICE);
0028 }
0029 
0030 static inline void ivtv_udma_sync_for_cpu(struct ivtv *itv)
0031 {
0032     dma_sync_single_for_cpu(&itv->pdev->dev, itv->udma.SG_handle,
0033                 sizeof(itv->udma.SGarray), DMA_TO_DEVICE);
0034 }
0035 
0036 #endif