aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/videobuf-dma-sg.h
diff options
context:
space:
mode:
authorPawel Osciak <p.osciak@samsung.com>2010-03-17 03:01:04 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-17 23:50:25 -0400
commit7a02264ca9ec5409e22b9d41f32b431d08eadbce (patch)
tree4c7cd63a863c10f0fbe8d8ec7927e203e9d7577f /include/media/videobuf-dma-sg.h
parent85e092190b5f7dfe9b78556440472c5590a32b4e (diff)
V4L/DVB: v4l: videobuf: code cleanup
Make videobuf pass checkpatch; minor code cleanups. Signed-off-by: Pawel Osciak <p.osciak@samsung.com> Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media/videobuf-dma-sg.h')
-rw-r--r--include/media/videobuf-dma-sg.h27
1 files changed, 15 insertions, 12 deletions
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h
index 53e72f787175..dbfd8cf7b7cb 100644
--- a/include/media/videobuf-dma-sg.h
+++ b/include/media/videobuf-dma-sg.h
@@ -17,6 +17,8 @@
17 * it under the terms of the GNU General Public License as published by 17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 18 * the Free Software Foundation; either version 2
19 */ 19 */
20#ifndef _VIDEOBUF_DMA_SG_H
21#define _VIDEOBUF_DMA_SG_H
20 22
21#include <media/videobuf-core.h> 23#include <media/videobuf-core.h>
22 24
@@ -27,14 +29,14 @@
27 * block (NULL on errors). Memory for the scatterlist is allocated 29 * block (NULL on errors). Memory for the scatterlist is allocated
28 * using kmalloc. The caller must free the memory. 30 * using kmalloc. The caller must free the memory.
29 */ 31 */
30struct scatterlist* videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages); 32struct scatterlist *videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages);
31 33
32/* 34/*
33 * Return a scatterlist for a an array of userpages (NULL on errors). 35 * Return a scatterlist for a an array of userpages (NULL on errors).
34 * Memory for the scatterlist is allocated using kmalloc. The caller 36 * Memory for the scatterlist is allocated using kmalloc. The caller
35 * must free the memory. 37 * must free the memory.
36 */ 38 */
37struct scatterlist* videobuf_pages_to_sg(struct page **pages, int nr_pages, 39struct scatterlist *videobuf_pages_to_sg(struct page **pages, int nr_pages,
38 int offset); 40 int offset);
39 41
40/* --------------------------------------------------------------------- */ 42/* --------------------------------------------------------------------- */
@@ -78,8 +80,7 @@ struct videobuf_dmabuf {
78 int direction; 80 int direction;
79}; 81};
80 82
81struct videobuf_dma_sg_memory 83struct videobuf_dma_sg_memory {
82{
83 u32 magic; 84 u32 magic;
84 85
85 /* for mmap'ed buffers */ 86 /* for mmap'ed buffers */
@@ -95,14 +96,14 @@ int videobuf_dma_init_overlay(struct videobuf_dmabuf *dma, int direction,
95 dma_addr_t addr, int nr_pages); 96 dma_addr_t addr, int nr_pages);
96int videobuf_dma_free(struct videobuf_dmabuf *dma); 97int videobuf_dma_free(struct videobuf_dmabuf *dma);
97 98
98int videobuf_dma_map(struct videobuf_queue* q,struct videobuf_dmabuf *dma); 99int videobuf_dma_map(struct videobuf_queue *q, struct videobuf_dmabuf *dma);
99int videobuf_dma_sync(struct videobuf_queue* q,struct videobuf_dmabuf *dma); 100int videobuf_dma_sync(struct videobuf_queue *q, struct videobuf_dmabuf *dma);
100int videobuf_dma_unmap(struct videobuf_queue* q,struct videobuf_dmabuf *dma); 101int videobuf_dma_unmap(struct videobuf_queue *q, struct videobuf_dmabuf *dma);
101struct videobuf_dmabuf *videobuf_to_dma (struct videobuf_buffer *buf); 102struct videobuf_dmabuf *videobuf_to_dma(struct videobuf_buffer *buf);
102 103
103void *videobuf_sg_alloc(size_t size); 104void *videobuf_sg_alloc(size_t size);
104 105
105void videobuf_queue_sg_init(struct videobuf_queue* q, 106void videobuf_queue_sg_init(struct videobuf_queue *q,
106 const struct videobuf_queue_ops *ops, 107 const struct videobuf_queue_ops *ops,
107 struct device *dev, 108 struct device *dev,
108 spinlock_t *irqlock, 109 spinlock_t *irqlock,
@@ -111,9 +112,11 @@ void videobuf_queue_sg_init(struct videobuf_queue* q,
111 unsigned int msize, 112 unsigned int msize,
112 void *priv); 113 void *priv);
113 114
114 /*FIXME: these variants are used only on *-alsa code, where videobuf is 115/*FIXME: these variants are used only on *-alsa code, where videobuf is
115 * used without queue 116 * used without queue
116 */ 117 */
117int videobuf_sg_dma_map(struct device *dev, struct videobuf_dmabuf *dma); 118int videobuf_sg_dma_map(struct device *dev, struct videobuf_dmabuf *dma);
118int videobuf_sg_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma); 119int videobuf_sg_dma_unmap(struct device *dev, struct videobuf_dmabuf *dma);
119 120
121#endif /* _VIDEOBUF_DMA_SG_H */
122