drm/nouveau: consume the return of large GSP message
[drm/drm-misc.git] / drivers / media / pci / mgb4 / mgb4_vout.h
bloba07eeabdcf342bedcd78c591e1004d41cea12bd6
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Copyright (C) 2021-2023 Digiteq Automotive
4 * author: Martin Tuma <martin.tuma@digiteqautomotive.com>
5 */
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>
15 #include "mgb4_i2c.h"
17 struct mgb4_vout_regs {
18 u32 address;
19 u32 config;
20 u32 status;
21 u32 resolution;
22 u32 frame_limit;
23 u32 hsync;
24 u32 vsync;
25 u32 padding;
26 u32 timer;
29 struct mgb4_vout_config {
30 int id;
31 int dma_channel;
32 int irq;
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;
47 u32 width;
48 u32 height;
49 u32 freq;
50 u32 padding;
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];
59 #endif
62 struct mgb4_vout_dev *mgb4_vout_create(struct mgb4_dev *mgbdev, int id);
63 void mgb4_vout_free(struct mgb4_vout_dev *voutdev);
65 #endif