1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * vsp1_video.h -- R-Car VSP1 Video Node
5 * Copyright (C) 2013-2015 Renesas Electronics Corporation
7 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
9 #ifndef __VSP1_VIDEO_H__
10 #define __VSP1_VIDEO_H__
12 #include <linux/list.h>
13 #include <linux/spinlock.h>
15 #include <media/videobuf2-v4l2.h>
17 #include "vsp1_rwpf.h"
19 struct vsp1_vb2_buffer
{
20 struct vb2_v4l2_buffer buf
;
21 struct list_head queue
;
22 struct vsp1_rwpf_memory mem
;
25 static inline struct vsp1_vb2_buffer
*
26 to_vsp1_vb2_buffer(struct vb2_v4l2_buffer
*vbuf
)
28 return container_of(vbuf
, struct vsp1_vb2_buffer
, buf
);
32 struct list_head list
;
33 struct vsp1_device
*vsp1
;
34 struct vsp1_rwpf
*rwpf
;
36 struct video_device video
;
37 enum v4l2_buf_type type
;
42 unsigned int pipe_index
;
44 struct vb2_queue queue
;
46 struct list_head irqqueue
;
49 static inline struct vsp1_video
*to_vsp1_video(struct video_device
*vdev
)
51 return container_of(vdev
, struct vsp1_video
, video
);
54 void vsp1_video_suspend(struct vsp1_device
*vsp1
);
55 void vsp1_video_resume(struct vsp1_device
*vsp1
);
57 struct vsp1_video
*vsp1_video_create(struct vsp1_device
*vsp1
,
58 struct vsp1_rwpf
*rwpf
);
59 void vsp1_video_cleanup(struct vsp1_video
*video
);
61 #endif /* __VSP1_VIDEO_H__ */