From 3ee396ed91c7d4ae7fbc9a391525c2e610014295 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 10 May 2022 03:06:45 +0100 Subject: [PATCH] media: staging: media: imx: imx7-media-csi: Drop unneeded imx7_csi_pixfmt fields The imx7_csi_pixfmt cycles field is never used nor set, the bayer field is never used, and the planar field is never set. Drop them. Signed-off-by: Laurent Pinchart Acked-by: Rui Miguel Silva Tested-by: Alexander Stein Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/imx/imx7-media-csi.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index 4eeece8..e564686 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -185,11 +185,7 @@ struct imx7_csi_pixfmt { */ const u32 *codes; int bpp; /* total bpp */ - /* cycles per pixel for generic (bayer) formats for the parallel bus */ - int cycles; bool yuv; - bool planar; /* is a planar format */ - bool bayer; /* is a raw bayer format */ }; struct imx7_csi_vb2_buffer { @@ -837,22 +833,18 @@ static const struct imx7_csi_pixfmt pixel_formats[] = { .fourcc = V4L2_PIX_FMT_SBGGR8, .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SBGGR8_1X8), .bpp = 8, - .bayer = true, }, { .fourcc = V4L2_PIX_FMT_SGBRG8, .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SGBRG8_1X8), .bpp = 8, - .bayer = true, }, { .fourcc = V4L2_PIX_FMT_SGRBG8, .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SGRBG8_1X8), .bpp = 8, - .bayer = true, }, { .fourcc = V4L2_PIX_FMT_SRGGB8, .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SRGGB8_1X8), .bpp = 8, - .bayer = true, }, { .fourcc = V4L2_PIX_FMT_SBGGR16, .codes = IMX_BUS_FMTS( @@ -862,7 +854,6 @@ static const struct imx7_csi_pixfmt pixel_formats[] = { MEDIA_BUS_FMT_SBGGR16_1X16 ), .bpp = 16, - .bayer = true, }, { .fourcc = V4L2_PIX_FMT_SGBRG16, .codes = IMX_BUS_FMTS( @@ -872,7 +863,6 @@ static const struct imx7_csi_pixfmt pixel_formats[] = { MEDIA_BUS_FMT_SGBRG16_1X16 ), .bpp = 16, - .bayer = true, }, { .fourcc = V4L2_PIX_FMT_SGRBG16, .codes = IMX_BUS_FMTS( @@ -882,7 +872,6 @@ static const struct imx7_csi_pixfmt pixel_formats[] = { MEDIA_BUS_FMT_SGRBG16_1X16 ), .bpp = 16, - .bayer = true, }, { .fourcc = V4L2_PIX_FMT_SRGGB16, .codes = IMX_BUS_FMTS( @@ -892,7 +881,6 @@ static const struct imx7_csi_pixfmt pixel_formats[] = { MEDIA_BUS_FMT_SRGGB16_1X16 ), .bpp = 16, - .bayer = true, }, { .fourcc = V4L2_PIX_FMT_GREY, .codes = IMX_BUS_FMTS( @@ -901,17 +889,14 @@ static const struct imx7_csi_pixfmt pixel_formats[] = { MEDIA_BUS_FMT_Y12_1X12 ), .bpp = 8, - .bayer = true, }, { .fourcc = V4L2_PIX_FMT_Y10, .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_Y10_1X10), .bpp = 16, - .bayer = true, }, { .fourcc = V4L2_PIX_FMT_Y12, .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_Y12_1X12), .bpp = 16, - .bayer = true, }, }; @@ -1088,10 +1073,7 @@ static int imx7_csi_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix, width = round_up(mbus->width, 8); /* Round up stride for IDMAC line start address alignment */ - if (cc->planar) - stride = round_up(width, 16); - else - stride = round_up((width * cc->bpp) >> 3, 8); + stride = round_up((width * cc->bpp) >> 3, 8); pix->width = width; pix->height = mbus->height; @@ -1102,8 +1084,7 @@ static int imx7_csi_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix, pix->quantization = mbus->quantization; pix->field = mbus->field; pix->bytesperline = stride; - pix->sizeimage = cc->planar ? ((stride * pix->height * cc->bpp) >> 3) : - stride * pix->height; + pix->sizeimage = stride * pix->height; return 0; } -- 2.7.4