1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2021-2022 Digiteq Automotive
10 #include <media/v4l2-dev.h>
12 #define MGB4_DEFAULT_WIDTH 1280
13 #define MGB4_DEFAULT_HEIGHT 640
14 #define MGB4_DEFAULT_PERIOD (125000000 / 60)
16 /* Register access error indication */
17 #define MGB4_ERR_NO_REG 0xFFFFFFFE
18 /* Frame buffer addresses greater than 0xFFFFFFFA indicate HW errors */
19 #define MGB4_ERR_QUEUE_TIMEOUT 0xFFFFFFFD
20 #define MGB4_ERR_QUEUE_EMPTY 0xFFFFFFFC
21 #define MGB4_ERR_QUEUE_FULL 0xFFFFFFFB
23 struct mgb4_frame_buffer {
24 struct vb2_v4l2_buffer vb;
25 struct list_head list;
28 static inline struct mgb4_frame_buffer *to_frame_buffer(struct vb2_v4l2_buffer *vbuf)
30 return container_of(vbuf, struct mgb4_frame_buffer, vb);