Merge remote-tracking branch 'h8300/h8300-next'
[deliverable/linux.git] / drivers / media / platform / vsp1 / vsp1_video.h
CommitLineData
26e0ca22
LP
1/*
2 * vsp1_video.h -- R-Car VSP1 Video Node
3 *
139c9286 4 * Copyright (C) 2013-2015 Renesas Electronics Corporation
26e0ca22
LP
5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 *
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.
12 */
13#ifndef __VSP1_VIDEO_H__
14#define __VSP1_VIDEO_H__
15
16#include <linux/list.h>
17#include <linux/spinlock.h>
26e0ca22 18
c139990e 19#include <media/videobuf2-v4l2.h>
26e0ca22 20
b58faa95
LP
21#include "vsp1_rwpf.h"
22
f7ebf3ca 23struct vsp1_vb2_buffer {
2d700715 24 struct vb2_v4l2_buffer buf;
26e0ca22 25 struct list_head queue;
b58faa95 26 struct vsp1_rwpf_memory mem;
26e0ca22
LP
27};
28
f7ebf3ca
LP
29static inline struct vsp1_vb2_buffer *
30to_vsp1_vb2_buffer(struct vb2_v4l2_buffer *vbuf)
26e0ca22 31{
f7ebf3ca 32 return container_of(vbuf, struct vsp1_vb2_buffer, buf);
26e0ca22
LP
33}
34
26e0ca22 35struct vsp1_video {
9d40637a 36 struct list_head list;
26e0ca22 37 struct vsp1_device *vsp1;
8b4a0563 38 struct vsp1_rwpf *rwpf;
26e0ca22 39
26e0ca22
LP
40 struct video_device video;
41 enum v4l2_buf_type type;
42 struct media_pad pad;
43
44 struct mutex lock;
26e0ca22 45
26e0ca22
LP
46 unsigned int pipe_index;
47
48 struct vb2_queue queue;
26e0ca22
LP
49 spinlock_t irqlock;
50 struct list_head irqqueue;
26e0ca22
LP
51};
52
53static inline struct vsp1_video *to_vsp1_video(struct video_device *vdev)
54{
55 return container_of(vdev, struct vsp1_video, video);
56}
57
9d40637a
LP
58struct vsp1_video *vsp1_video_create(struct vsp1_device *vsp1,
59 struct vsp1_rwpf *rwpf);
26e0ca22
LP
60void vsp1_video_cleanup(struct vsp1_video *video);
61
26e0ca22 62#endif /* __VSP1_VIDEO_H__ */
This page took 0.190575 seconds and 5 git commands to generate.