Commit b23096af authored by Dafna Hirschfeld's avatar Dafna Hirschfeld Committed by Mauro Carvalho Chehab

media: staging: rkisp1: cap: remove field fmt_type from struct rkisp1_capture_fmt_cfg

The pixel encoding can be retrieved from the cap->pix.info.
Therefore the field fmt_type can be removed from the
struct rkisp1_capture_fmt_cfg.
Signed-off-by: default avatarDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: default avatarHelen Koike <helen.koike@collabora.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 2990e3db
...@@ -52,7 +52,6 @@ enum rkisp1_plane { ...@@ -52,7 +52,6 @@ enum rkisp1_plane {
*/ */
struct rkisp1_capture_fmt_cfg { struct rkisp1_capture_fmt_cfg {
u32 fourcc; u32 fourcc;
u8 fmt_type;
u8 uv_swap; u8 uv_swap;
u32 write_format; u32 write_format;
u32 output_format; u32 output_format;
...@@ -87,133 +86,106 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_mp_fmts[] = { ...@@ -87,133 +86,106 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_mp_fmts[] = {
/* yuv422 */ /* yuv422 */
{ {
.fourcc = V4L2_PIX_FMT_YUYV, .fourcc = V4L2_PIX_FMT_YUYV,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT,
}, { }, {
.fourcc = V4L2_PIX_FMT_YVYU, .fourcc = V4L2_PIX_FMT_YVYU,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT,
}, { }, {
.fourcc = V4L2_PIX_FMT_VYUY, .fourcc = V4L2_PIX_FMT_VYUY,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT,
}, { }, {
.fourcc = V4L2_PIX_FMT_YUV422P, .fourcc = V4L2_PIX_FMT_YUV422P,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV16, .fourcc = V4L2_PIX_FMT_NV16,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV61, .fourcc = V4L2_PIX_FMT_NV61,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
}, { }, {
.fourcc = V4L2_PIX_FMT_YVU422M, .fourcc = V4L2_PIX_FMT_YVU422M,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, },
/* yuv420 */ /* yuv420 */
{ {
.fourcc = V4L2_PIX_FMT_NV21, .fourcc = V4L2_PIX_FMT_NV21,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV12, .fourcc = V4L2_PIX_FMT_NV12,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV21M, .fourcc = V4L2_PIX_FMT_NV21M,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV12M, .fourcc = V4L2_PIX_FMT_NV12M,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
}, { }, {
.fourcc = V4L2_PIX_FMT_YUV420, .fourcc = V4L2_PIX_FMT_YUV420,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, { }, {
.fourcc = V4L2_PIX_FMT_YVU420, .fourcc = V4L2_PIX_FMT_YVU420,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, },
/* yuv444 */ /* yuv444 */
{ {
.fourcc = V4L2_PIX_FMT_YUV444M, .fourcc = V4L2_PIX_FMT_YUV444M,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, },
/* yuv400 */ /* yuv400 */
{ {
.fourcc = V4L2_PIX_FMT_GREY, .fourcc = V4L2_PIX_FMT_GREY,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUVINT,
}, },
/* raw */ /* raw */
{ {
.fourcc = V4L2_PIX_FMT_SRGGB8, .fourcc = V4L2_PIX_FMT_SRGGB8,
.fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, { }, {
.fourcc = V4L2_PIX_FMT_SGRBG8, .fourcc = V4L2_PIX_FMT_SGRBG8,
.fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, { }, {
.fourcc = V4L2_PIX_FMT_SGBRG8, .fourcc = V4L2_PIX_FMT_SGBRG8,
.fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, { }, {
.fourcc = V4L2_PIX_FMT_SBGGR8, .fourcc = V4L2_PIX_FMT_SBGGR8,
.fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8, .write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_PLA_OR_RAW8,
}, { }, {
.fourcc = V4L2_PIX_FMT_SRGGB10, .fourcc = V4L2_PIX_FMT_SRGGB10,
.fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12, .write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12,
}, { }, {
.fourcc = V4L2_PIX_FMT_SGRBG10, .fourcc = V4L2_PIX_FMT_SGRBG10,
.fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12, .write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12,
}, { }, {
.fourcc = V4L2_PIX_FMT_SGBRG10, .fourcc = V4L2_PIX_FMT_SGBRG10,
.fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12, .write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12,
}, { }, {
.fourcc = V4L2_PIX_FMT_SBGGR10, .fourcc = V4L2_PIX_FMT_SBGGR10,
.fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12, .write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12,
}, { }, {
.fourcc = V4L2_PIX_FMT_SRGGB12, .fourcc = V4L2_PIX_FMT_SRGGB12,
.fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12, .write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12,
}, { }, {
.fourcc = V4L2_PIX_FMT_SGRBG12, .fourcc = V4L2_PIX_FMT_SGRBG12,
.fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12, .write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12,
}, { }, {
.fourcc = V4L2_PIX_FMT_SGBRG12, .fourcc = V4L2_PIX_FMT_SGBRG12,
.fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12, .write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12,
}, { }, {
.fourcc = V4L2_PIX_FMT_SBGGR12, .fourcc = V4L2_PIX_FMT_SBGGR12,
.fmt_type = V4L2_PIXEL_ENC_BAYER,
.write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12, .write_format = RKISP1_MI_CTRL_MP_WRITE_RAW12,
}, },
}; };
...@@ -222,43 +194,36 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = { ...@@ -222,43 +194,36 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
/* yuv422 */ /* yuv422 */
{ {
.fourcc = V4L2_PIX_FMT_YUYV, .fourcc = V4L2_PIX_FMT_YUYV,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_INT, .write_format = RKISP1_MI_CTRL_SP_WRITE_INT,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
}, { }, {
.fourcc = V4L2_PIX_FMT_YVYU, .fourcc = V4L2_PIX_FMT_YVYU,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_SP_WRITE_INT, .write_format = RKISP1_MI_CTRL_SP_WRITE_INT,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
}, { }, {
.fourcc = V4L2_PIX_FMT_VYUY, .fourcc = V4L2_PIX_FMT_VYUY,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_SP_WRITE_INT, .write_format = RKISP1_MI_CTRL_SP_WRITE_INT,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
}, { }, {
.fourcc = V4L2_PIX_FMT_YUV422P, .fourcc = V4L2_PIX_FMT_YUV422P,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV16, .fourcc = V4L2_PIX_FMT_NV16,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV61, .fourcc = V4L2_PIX_FMT_NV61,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
}, { }, {
.fourcc = V4L2_PIX_FMT_YVU422M, .fourcc = V4L2_PIX_FMT_YVU422M,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
...@@ -266,37 +231,31 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = { ...@@ -266,37 +231,31 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
/* yuv420 */ /* yuv420 */
{ {
.fourcc = V4L2_PIX_FMT_NV21, .fourcc = V4L2_PIX_FMT_NV21,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV12, .fourcc = V4L2_PIX_FMT_NV12,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV21M, .fourcc = V4L2_PIX_FMT_NV21M,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420,
}, { }, {
.fourcc = V4L2_PIX_FMT_NV12M, .fourcc = V4L2_PIX_FMT_NV12M,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420,
}, { }, {
.fourcc = V4L2_PIX_FMT_YUV420, .fourcc = V4L2_PIX_FMT_YUV420,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420,
}, { }, {
.fourcc = V4L2_PIX_FMT_YVU420, .fourcc = V4L2_PIX_FMT_YVU420,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 1, .uv_swap = 1,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV420,
...@@ -304,7 +263,6 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = { ...@@ -304,7 +263,6 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
/* yuv444 */ /* yuv444 */
{ {
.fourcc = V4L2_PIX_FMT_YUV444M, .fourcc = V4L2_PIX_FMT_YUV444M,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV444, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV444,
...@@ -312,7 +270,6 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = { ...@@ -312,7 +270,6 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
/* yuv400 */ /* yuv400 */
{ {
.fourcc = V4L2_PIX_FMT_GREY, .fourcc = V4L2_PIX_FMT_GREY,
.fmt_type = V4L2_PIXEL_ENC_YUV,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_INT, .write_format = RKISP1_MI_CTRL_SP_WRITE_INT,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV400, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV400,
...@@ -320,17 +277,14 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = { ...@@ -320,17 +277,14 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
/* rgb */ /* rgb */
{ {
.fourcc = V4L2_PIX_FMT_RGB24, .fourcc = V4L2_PIX_FMT_RGB24,
.fmt_type = V4L2_PIXEL_ENC_RGB,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_RGB888, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_RGB888,
}, { }, {
.fourcc = V4L2_PIX_FMT_RGB565, .fourcc = V4L2_PIX_FMT_RGB565,
.fmt_type = V4L2_PIXEL_ENC_RGB,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_RGB565, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_RGB565,
}, { }, {
.fourcc = V4L2_PIX_FMT_BGR666, .fourcc = V4L2_PIX_FMT_BGR666,
.fmt_type = V4L2_PIXEL_ENC_RGB,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_RGB666, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_RGB666,
}, },
...@@ -504,13 +458,12 @@ static void rkisp1_sp_disable(struct rkisp1_capture *cap) ...@@ -504,13 +458,12 @@ static void rkisp1_sp_disable(struct rkisp1_capture *cap)
static void rkisp1_mp_enable(struct rkisp1_capture *cap) static void rkisp1_mp_enable(struct rkisp1_capture *cap)
{ {
const struct rkisp1_capture_fmt_cfg *isp_fmt = cap->pix.cfg;
u32 mi_ctrl; u32 mi_ctrl;
rkisp1_mp_disable(cap); rkisp1_mp_disable(cap);
mi_ctrl = rkisp1_read(cap->rkisp1, RKISP1_CIF_MI_CTRL); mi_ctrl = rkisp1_read(cap->rkisp1, RKISP1_CIF_MI_CTRL);
if (isp_fmt->fmt_type == V4L2_PIXEL_ENC_BAYER) if (v4l2_is_format_bayer(cap->pix.info))
mi_ctrl |= RKISP1_CIF_MI_CTRL_RAW_ENABLE; mi_ctrl |= RKISP1_CIF_MI_CTRL_RAW_ENABLE;
/* YUV */ /* YUV */
else else
...@@ -1260,7 +1213,7 @@ static int rkisp1_capture_link_validate(struct media_link *link) ...@@ -1260,7 +1213,7 @@ static int rkisp1_capture_link_validate(struct media_link *link)
return -EPIPE; return -EPIPE;
} }
if (cap->pix.cfg->fmt_type != isp->src_fmt->fmt_type) { if (cap->pix.info->pixel_enc != isp->src_fmt->fmt_type) {
dev_err(cap->rkisp1->dev, dev_err(cap->rkisp1->dev,
"format type mismatch in link '%s:%d->%s:%d'\n", "format type mismatch in link '%s:%d->%s:%d'\n",
link->source->entity->name, link->source->index, link->source->entity->name, link->source->index,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment