summaryrefslogtreecommitdiff
path: root/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.h
blob: a917d2da6debb42a932cca0f75eb42f0e1ee069e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * Copyright (c) 2011-2018 Magewell Electronics Co., Ltd. (Nanjing)
 * All rights reserved.
 * Author: Yong Deng <yong.deng@magewell.com>
 */

#ifndef __SUN6I_VIDEO_H__
#define __SUN6I_VIDEO_H__

#include <media/v4l2-dev.h>
#include <media/videobuf2-core.h>

struct sun6i_csi_device;

struct sun6i_video {
	struct video_device		video_dev;
	struct vb2_queue		queue;
	struct mutex			lock; /* Queue lock. */
	struct media_pad		pad;

	struct list_head		dma_queue;
	spinlock_t			dma_queue_lock; /* DMA queue lock. */

	struct v4l2_format		format;
	u32				mbus_code;
	unsigned int			sequence;
};

int sun6i_video_setup(struct sun6i_csi_device *csi_dev);
void sun6i_video_cleanup(struct sun6i_csi_device *csi_dev);

void sun6i_video_frame_done(struct sun6i_csi_device *csi_dev);

#endif /* __SUN6I_VIDEO_H__ */