mtk-mipicsi: add function to get the format
This patch add function to get the format
This function can get the subdev format and host format.
Calculate the number of format which intersection of subdev and host.
Signed-off-by: Stu Hsieh <stu.hsieh@mediatek.com>
diff --git a/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c b/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c
index 9e45786..aaaea5c 100644
--- a/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c
+++ b/drivers/media/platform/mtk-mipicsi/mtk_mipicsi.c
@@ -52,6 +52,7 @@
#define MTK_MIPICSI_DRV_NAME "mtk-mipicsi"
#define MTK_PLATFORM_STR "platform:mt2712"
+#define MTK_DATAWIDTH_8 (0x01U << 7U)
#define MAX_SUPPORT_WIDTH 4096U
#define MAX_SUPPORT_HEIGHT 4096U
#define MAX_BUFFER_NUM 32U
@@ -158,6 +159,7 @@
unsigned int num_user_formats;
const struct mtk_format **user_formats;
const struct mtk_format *current_fmt;
+ u16 width_flags; /* max 12 bits */
struct mtk_mipicsi_buf cam_buf[MAX_BUFFER_NUM];
struct list_head fb_list;
@@ -1522,6 +1524,7 @@
goto err_vb2_queue;
}
+ mipicsi->width_flags = MTK_DATAWIDTH_8;
mipicsi->streamon = false;
ret = mtk_mipicsi_subdev_init(mipicsi);