Commit | Line | Data |
---|---|---|
1a59d1b8 | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
1a0adaf3 HV |
2 | /* |
3 | Copyright (C) 2003-2004 Kevin Thayer <nufan_wfk at yahoo.com> | |
4 | Copyright (C) 2004 Chris Kennedy <c@groovy.org> | |
5 | Copyright (C) 2006-2007 Hans Verkuil <hverkuil@xs4all.nl> | |
6 | ||
1a0adaf3 HV |
7 | */ |
8 | ||
612570f2 HV |
9 | #ifndef IVTV_UDMA_H |
10 | #define IVTV_UDMA_H | |
11 | ||
1a0adaf3 HV |
12 | /* User DMA functions */ |
13 | void ivtv_udma_get_page_info(struct ivtv_dma_page_info *dma_page, unsigned long first, unsigned long size); | |
14 | int ivtv_udma_fill_sg_list(struct ivtv_user_dma *dma, struct ivtv_dma_page_info *dma_page, int map_offset); | |
15 | void ivtv_udma_fill_sg_array(struct ivtv_user_dma *dma, u32 buffer_offset, u32 buffer_offset_2, u32 split); | |
16 | int ivtv_udma_setup(struct ivtv *itv, unsigned long ivtv_dest_addr, | |
17 | void __user *userbuf, int size_in_bytes); | |
18 | void ivtv_udma_unmap(struct ivtv *itv); | |
19 | void ivtv_udma_free(struct ivtv *itv); | |
20 | void ivtv_udma_alloc(struct ivtv *itv); | |
21 | void ivtv_udma_prepare(struct ivtv *itv); | |
22 | void ivtv_udma_start(struct ivtv *itv); | |
23 | ||
24 | static inline void ivtv_udma_sync_for_device(struct ivtv *itv) | |
25 | { | |
8ac05ae3 | 26 | pci_dma_sync_single_for_device(itv->pdev, itv->udma.SG_handle, |
1a0adaf3 HV |
27 | sizeof(itv->udma.SGarray), PCI_DMA_TODEVICE); |
28 | } | |
29 | ||
30 | static inline void ivtv_udma_sync_for_cpu(struct ivtv *itv) | |
31 | { | |
8ac05ae3 | 32 | pci_dma_sync_single_for_cpu(itv->pdev, itv->udma.SG_handle, |
1a0adaf3 HV |
33 | sizeof(itv->udma.SGarray), PCI_DMA_TODEVICE); |
34 | } | |
612570f2 HV |
35 | |
36 | #endif |