1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2021-2023 Digiteq Automotive
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_vin_regs {
31 struct mgb4_vin_config {
36 struct mgb4_vin_regs regs;
40 struct mgb4_dev *mgbdev;
41 struct v4l2_device v4l2dev;
42 struct video_device vdev;
43 struct vb2_queue queue;
44 struct mutex lock; /* vdev lock */
46 spinlock_t qlock; /* video buffer queue lock */
47 struct list_head buf_list;
48 struct work_struct dma_work, err_work;
50 unsigned int sequence;
52 struct v4l2_dv_timings timings;
56 struct mgb4_i2c_client deser;
58 const struct mgb4_vin_config *config;
60 #ifdef CONFIG_DEBUG_FS
61 struct debugfs_regset32 regset;
62 struct debugfs_reg32 regs[sizeof(struct mgb4_vin_regs) / 4];
66 struct mgb4_vin_dev *mgb4_vin_create(struct mgb4_dev *mgbdev, int id);
67 void mgb4_vin_free(struct mgb4_vin_dev *vindev);