1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2021-2023 Digiteq Automotive
4 * author: Martin Tuma <martin.tuma@digiteqautomotive.com>
7 #ifndef __MGB4_VOUT_H__
8 #define __MGB4_VOUT_H__
10 #include <media/v4l2-device.h>
11 #include <media/v4l2-dev.h>
12 #include <media/v4l2-ctrls.h>
13 #include <media/videobuf2-core.h>
14 #include <linux/debugfs.h>
17 struct mgb4_vout_regs
{
29 struct mgb4_vout_config
{
33 struct mgb4_vout_regs regs
;
36 struct mgb4_vout_dev
{
37 struct mgb4_dev
*mgbdev
;
38 struct v4l2_device v4l2dev
;
39 struct video_device vdev
;
40 struct vb2_queue queue
;
41 struct mutex lock
; /* vdev lock */
43 spinlock_t qlock
; /* buffer queue lock */
44 struct list_head buf_list
;
45 struct work_struct dma_work
;
52 struct mgb4_i2c_client ser
;
54 const struct mgb4_vout_config
*config
;
56 #ifdef CONFIG_DEBUG_FS
57 struct debugfs_regset32 regset
;
58 struct debugfs_reg32 regs
[sizeof(struct mgb4_vout_regs
) / 4];
62 struct mgb4_vout_dev
*mgb4_vout_create(struct mgb4_dev
*mgbdev
, int id
);
63 void mgb4_vout_free(struct mgb4_vout_dev
*voutdev
);