Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux...
[linux/fpc-iii.git] / drivers / media / platform / vsp1 / vsp1_video.h
blob64abd39ee1e75c5998115afcf6b33a73aa7f89d8
1 /*
2 * vsp1_video.h -- R-Car VSP1 Video Node
4 * Copyright (C) 2013-2015 Renesas Electronics Corporation
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 #ifndef __VSP1_VIDEO_H__
14 #define __VSP1_VIDEO_H__
16 #include <linux/list.h>
17 #include <linux/spinlock.h>
19 #include <media/videobuf2-v4l2.h>
21 #include "vsp1_pipe.h"
22 #include "vsp1_rwpf.h"
24 struct vsp1_vb2_buffer {
25 struct vb2_v4l2_buffer buf;
26 struct list_head queue;
27 struct vsp1_rwpf_memory mem;
30 static inline struct vsp1_vb2_buffer *
31 to_vsp1_vb2_buffer(struct vb2_v4l2_buffer *vbuf)
33 return container_of(vbuf, struct vsp1_vb2_buffer, buf);
36 struct vsp1_video {
37 struct list_head list;
38 struct vsp1_device *vsp1;
39 struct vsp1_rwpf *rwpf;
41 struct video_device video;
42 enum v4l2_buf_type type;
43 struct media_pad pad;
45 struct mutex lock;
47 struct vsp1_pipeline pipe;
48 unsigned int pipe_index;
50 struct vb2_queue queue;
51 void *alloc_ctx;
52 spinlock_t irqlock;
53 struct list_head irqqueue;
54 unsigned int sequence;
57 static inline struct vsp1_video *to_vsp1_video(struct video_device *vdev)
59 return container_of(vdev, struct vsp1_video, video);
62 struct vsp1_video *vsp1_video_create(struct vsp1_device *vsp1,
63 struct vsp1_rwpf *rwpf);
64 void vsp1_video_cleanup(struct vsp1_video *video);
66 #endif /* __VSP1_VIDEO_H__ */