1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (c) 2011-2018 Magewell Electronics Co., Ltd. (Nanjing)
4  * All rights reserved.
5  * Author: Yong Deng <yong.deng@magewell.com>
6  */
7 
8 #ifndef __SUN6I_VIDEO_H__
9 #define __SUN6I_VIDEO_H__
10 
11 #include <media/v4l2-dev.h>
12 #include <media/videobuf2-core.h>
13 
14 struct sun6i_csi_device;
15 
16 struct sun6i_video {
17 	struct video_device		video_dev;
18 	struct vb2_queue		queue;
19 	struct mutex			lock; /* Queue lock. */
20 	struct media_pad		pad;
21 
22 	struct list_head		dma_queue;
23 	spinlock_t			dma_queue_lock; /* DMA queue lock. */
24 
25 	struct v4l2_format		format;
26 	u32				mbus_code;
27 	unsigned int			sequence;
28 };
29 
30 int sun6i_video_setup(struct sun6i_csi_device *csi_dev);
31 void sun6i_video_cleanup(struct sun6i_csi_device *csi_dev);
32 
33 void sun6i_video_frame_done(struct sun6i_csi_device *csi_dev);
34 
35 #endif /* __SUN6I_VIDEO_H__ */
36