28e01be71544bd227a0a24c35acc6d2d68e82a26
[platform/kernel/linux-rpi.git] / drivers / media / platform / raspberrypi / rp1_cfe / cfe.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * RP1 CFE driver.
4  * Copyright (c) 2021 Raspberry Pi Ltd.
5  *
6  */
7 #ifndef _RP1_CFE_
8 #define _RP1_CFE_
9
10 #include <linux/types.h>
11 #include <linux/media-bus-format.h>
12 #include <linux/videodev2.h>
13
14 extern bool cfe_debug_irq;
15
16 enum cfe_remap_types {
17         CFE_REMAP_16BIT,
18         CFE_REMAP_COMPRESSED,
19         CFE_NUM_REMAP,
20 };
21
22 #define CFE_FORMAT_FLAG_META_OUT        BIT(0)
23 #define CFE_FORMAT_FLAG_META_CAP        BIT(1)
24 #define CFE_FORMAT_FLAG_FE_OUT          BIT(2)
25
26 struct cfe_fmt {
27         u32 fourcc;
28         u32 code;
29         u8 depth;
30         u8 csi_dt;
31         u32 remap[CFE_NUM_REMAP];
32         u32 flags;
33 };
34
35 extern const struct v4l2_mbus_framefmt cfe_default_format;
36 extern const struct v4l2_mbus_framefmt cfe_default_meta_format;
37
38 const struct cfe_fmt *find_format_by_code(u32 code);
39
40 #endif