treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156
[linux-block.git] / drivers / media / pci / ivtv / ivtv-udma.h
CommitLineData
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 */
13void ivtv_udma_get_page_info(struct ivtv_dma_page_info *dma_page, unsigned long first, unsigned long size);
14int ivtv_udma_fill_sg_list(struct ivtv_user_dma *dma, struct ivtv_dma_page_info *dma_page, int map_offset);
15void ivtv_udma_fill_sg_array(struct ivtv_user_dma *dma, u32 buffer_offset, u32 buffer_offset_2, u32 split);
16int ivtv_udma_setup(struct ivtv *itv, unsigned long ivtv_dest_addr,
17 void __user *userbuf, int size_in_bytes);
18void ivtv_udma_unmap(struct ivtv *itv);
19void ivtv_udma_free(struct ivtv *itv);
20void ivtv_udma_alloc(struct ivtv *itv);
21void ivtv_udma_prepare(struct ivtv *itv);
22void ivtv_udma_start(struct ivtv *itv);
23
24static 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
30static 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