xref: /openbmc/linux/include/media/videobuf2-dma-contig.h (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
11a758d4eSPawel Osciak /*
286b09055SAlbert Wang  * videobuf2-dma-contig.h - DMA contig memory allocator for videobuf2
31a758d4eSPawel Osciak  *
41a758d4eSPawel Osciak  * Copyright (C) 2010 Samsung Electronics
51a758d4eSPawel Osciak  *
695072084SPawel Osciak  * Author: Pawel Osciak <pawel@osciak.com>
71a758d4eSPawel Osciak  *
81a758d4eSPawel Osciak  * This program is free software; you can redistribute it and/or modify
91a758d4eSPawel Osciak  * it under the terms of the GNU General Public License as published by
101a758d4eSPawel Osciak  * the Free Software Foundation.
111a758d4eSPawel Osciak  */
121a758d4eSPawel Osciak 
1386b09055SAlbert Wang #ifndef _MEDIA_VIDEOBUF2_DMA_CONTIG_H
1486b09055SAlbert Wang #define _MEDIA_VIDEOBUF2_DMA_CONTIG_H
151a758d4eSPawel Osciak 
16c139990eSJunghak Sung #include <media/videobuf2-v4l2.h>
17472af2b0SPawel Osciak #include <linux/dma-mapping.h>
181a758d4eSPawel Osciak 
19472af2b0SPawel Osciak static inline dma_addr_t
vb2_dma_contig_plane_dma_addr(struct vb2_buffer * vb,unsigned int plane_no)20ba7fcb0cSMarek Szyprowski vb2_dma_contig_plane_dma_addr(struct vb2_buffer *vb, unsigned int plane_no)
211a758d4eSPawel Osciak {
22ba7fcb0cSMarek Szyprowski 	dma_addr_t *addr = vb2_plane_cookie(vb, plane_no);
23472af2b0SPawel Osciak 
24ba7fcb0cSMarek Szyprowski 	return *addr;
251a758d4eSPawel Osciak }
261a758d4eSPawel Osciak 
273f033969SMarek Szyprowski int vb2_dma_contig_set_max_seg_size(struct device *dev, unsigned int size);
vb2_dma_contig_clear_max_seg_size(struct device * dev)28*0d966872STomi Valkeinen static inline void vb2_dma_contig_clear_max_seg_size(struct device *dev) { }
291a758d4eSPawel Osciak 
301a758d4eSPawel Osciak extern const struct vb2_mem_ops vb2_dma_contig_memops;
311a758d4eSPawel Osciak 
321a758d4eSPawel Osciak #endif
33