linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rui Miguel Silva <rmfrfs@gmail.com>
To: "Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	<linux-media@vger.kernel.org>
Cc: "Rui Miguel Silva" <rmfrfs@gmail.com>,
	"Martin Kepplinger" <martink@posteo.de>,
	"Purism Kernel Team" <kernel@puri.sm>,
	"Stefan Klug" <stefan.klug@ideasonboard.com>,
	<imx@lists.linux.dev>
Subject: Re: [PATCH] media: imx-mipi-csis: Use CSI-2 data type macros from mipi-csi2.h
Date: Fri, 06 Jun 2025 10:28:25 +0100	[thread overview]
Message-ID: <DAFCE9SLVTFF.2T9D30I3PYO02@linaro.com> (raw)
In-Reply-To: <20250606090533.10711-1-laurent.pinchart@ideasonboard.com>

Hey Laurent,
On Fri Jun 6, 2025 at 10:05 AM WEST, Laurent Pinchart wrote:

> The imx-mipi-csis defines custom macros for the CSI-2 data types,
> duplicating the centralized macros defines in mipi-csi2.h. Replace them
> with the latter.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

All looks good.
Thanks.

Reviewed-by: Rui Miguel Silva <rui.silva@linaro.org>

Cheers,
   Rui
> ---
>  drivers/media/platform/nxp/imx-mipi-csis.c | 68 ++++++++--------------
>  1 file changed, 25 insertions(+), 43 deletions(-)
>
> diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c
> index d060eadebc7a..2beb5f43c2c0 100644
> --- a/drivers/media/platform/nxp/imx-mipi-csis.c
> +++ b/drivers/media/platform/nxp/imx-mipi-csis.c
> @@ -28,6 +28,7 @@
>  #include <linux/reset.h>
>  #include <linux/spinlock.h>
>  
> +#include <media/mipi-csi2.h>
>  #include <media/v4l2-common.h>
>  #include <media/v4l2-device.h>
>  #include <media/v4l2-event.h>
> @@ -229,25 +230,6 @@
>  
>  #define DEFAULT_SCLK_CSIS_FREQ			166000000UL
>  
> -/* MIPI CSI-2 Data Types */
> -#define MIPI_CSI2_DATA_TYPE_YUV420_8		0x18
> -#define MIPI_CSI2_DATA_TYPE_YUV420_10		0x19
> -#define MIPI_CSI2_DATA_TYPE_LE_YUV420_8		0x1a
> -#define MIPI_CSI2_DATA_TYPE_CS_YUV420_8		0x1c
> -#define MIPI_CSI2_DATA_TYPE_CS_YUV420_10	0x1d
> -#define MIPI_CSI2_DATA_TYPE_YUV422_8		0x1e
> -#define MIPI_CSI2_DATA_TYPE_YUV422_10		0x1f
> -#define MIPI_CSI2_DATA_TYPE_RGB565		0x22
> -#define MIPI_CSI2_DATA_TYPE_RGB666		0x23
> -#define MIPI_CSI2_DATA_TYPE_RGB888		0x24
> -#define MIPI_CSI2_DATA_TYPE_RAW6		0x28
> -#define MIPI_CSI2_DATA_TYPE_RAW7		0x29
> -#define MIPI_CSI2_DATA_TYPE_RAW8		0x2a
> -#define MIPI_CSI2_DATA_TYPE_RAW10		0x2b
> -#define MIPI_CSI2_DATA_TYPE_RAW12		0x2c
> -#define MIPI_CSI2_DATA_TYPE_RAW14		0x2d
> -#define MIPI_CSI2_DATA_TYPE_USER(x)		(0x30 + (x))
> -
>  struct mipi_csis_event {
>  	bool debug;
>  	u32 mask;
> @@ -357,116 +339,116 @@ static const struct csis_pix_format mipi_csis_formats[] = {
>  	{
>  		.code = MEDIA_BUS_FMT_UYVY8_1X16,
>  		.output = MEDIA_BUS_FMT_UYVY8_1X16,
> -		.data_type = MIPI_CSI2_DATA_TYPE_YUV422_8,
> +		.data_type = MIPI_CSI2_DT_YUV422_8B,
>  		.width = 16,
>  	},
>  	/* RGB formats. */
>  	{
>  		.code = MEDIA_BUS_FMT_RGB565_1X16,
>  		.output = MEDIA_BUS_FMT_RGB565_1X16,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RGB565,
> +		.data_type = MIPI_CSI2_DT_RGB565,
>  		.width = 16,
>  	}, {
>  		.code = MEDIA_BUS_FMT_BGR888_1X24,
>  		.output = MEDIA_BUS_FMT_RGB888_1X24,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RGB888,
> +		.data_type = MIPI_CSI2_DT_RGB888,
>  		.width = 24,
>  	},
>  	/* RAW (Bayer and greyscale) formats. */
>  	{
>  		.code = MEDIA_BUS_FMT_SBGGR8_1X8,
>  		.output = MEDIA_BUS_FMT_SBGGR8_1X8,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW8,
> +		.data_type = MIPI_CSI2_DT_RAW8,
>  		.width = 8,
>  	}, {
>  		.code = MEDIA_BUS_FMT_SGBRG8_1X8,
>  		.output = MEDIA_BUS_FMT_SGBRG8_1X8,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW8,
> +		.data_type = MIPI_CSI2_DT_RAW8,
>  		.width = 8,
>  	}, {
>  		.code = MEDIA_BUS_FMT_SGRBG8_1X8,
>  		.output = MEDIA_BUS_FMT_SGRBG8_1X8,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW8,
> +		.data_type = MIPI_CSI2_DT_RAW8,
>  		.width = 8,
>  	}, {
>  		.code = MEDIA_BUS_FMT_SRGGB8_1X8,
>  		.output = MEDIA_BUS_FMT_SRGGB8_1X8,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW8,
> +		.data_type = MIPI_CSI2_DT_RAW8,
>  		.width = 8,
>  	}, {
>  		.code = MEDIA_BUS_FMT_Y8_1X8,
>  		.output = MEDIA_BUS_FMT_Y8_1X8,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW8,
> +		.data_type = MIPI_CSI2_DT_RAW8,
>  		.width = 8,
>  	}, {
>  		.code = MEDIA_BUS_FMT_SBGGR10_1X10,
>  		.output = MEDIA_BUS_FMT_SBGGR10_1X10,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW10,
> +		.data_type = MIPI_CSI2_DT_RAW10,
>  		.width = 10,
>  	}, {
>  		.code = MEDIA_BUS_FMT_SGBRG10_1X10,
>  		.output = MEDIA_BUS_FMT_SGBRG10_1X10,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW10,
> +		.data_type = MIPI_CSI2_DT_RAW10,
>  		.width = 10,
>  	}, {
>  		.code = MEDIA_BUS_FMT_SGRBG10_1X10,
>  		.output = MEDIA_BUS_FMT_SGRBG10_1X10,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW10,
> +		.data_type = MIPI_CSI2_DT_RAW10,
>  		.width = 10,
>  	}, {
>  		.code = MEDIA_BUS_FMT_SRGGB10_1X10,
>  		.output = MEDIA_BUS_FMT_SRGGB10_1X10,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW10,
> +		.data_type = MIPI_CSI2_DT_RAW10,
>  		.width = 10,
>  	}, {
>  		.code = MEDIA_BUS_FMT_Y10_1X10,
>  		.output = MEDIA_BUS_FMT_Y10_1X10,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW10,
> +		.data_type = MIPI_CSI2_DT_RAW10,
>  		.width = 10,
>  	}, {
>  		.code = MEDIA_BUS_FMT_SBGGR12_1X12,
>  		.output = MEDIA_BUS_FMT_SBGGR12_1X12,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW12,
> +		.data_type = MIPI_CSI2_DT_RAW12,
>  		.width = 12,
>  	}, {
>  		.code = MEDIA_BUS_FMT_SGBRG12_1X12,
>  		.output = MEDIA_BUS_FMT_SGBRG12_1X12,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW12,
> +		.data_type = MIPI_CSI2_DT_RAW12,
>  		.width = 12,
>  	}, {
>  		.code = MEDIA_BUS_FMT_SGRBG12_1X12,
>  		.output = MEDIA_BUS_FMT_SGRBG12_1X12,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW12,
> +		.data_type = MIPI_CSI2_DT_RAW12,
>  		.width = 12,
>  	}, {
>  		.code = MEDIA_BUS_FMT_SRGGB12_1X12,
>  		.output = MEDIA_BUS_FMT_SRGGB12_1X12,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW12,
> +		.data_type = MIPI_CSI2_DT_RAW12,
>  		.width = 12,
>  	}, {
>  		.code = MEDIA_BUS_FMT_Y12_1X12,
>  		.output = MEDIA_BUS_FMT_Y12_1X12,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW12,
> +		.data_type = MIPI_CSI2_DT_RAW12,
>  		.width = 12,
>  	}, {
>  		.code = MEDIA_BUS_FMT_SBGGR14_1X14,
>  		.output = MEDIA_BUS_FMT_SBGGR14_1X14,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW14,
> +		.data_type = MIPI_CSI2_DT_RAW14,
>  		.width = 14,
>  	}, {
>  		.code = MEDIA_BUS_FMT_SGBRG14_1X14,
>  		.output = MEDIA_BUS_FMT_SGBRG14_1X14,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW14,
> +		.data_type = MIPI_CSI2_DT_RAW14,
>  		.width = 14,
>  	}, {
>  		.code = MEDIA_BUS_FMT_SGRBG14_1X14,
>  		.output = MEDIA_BUS_FMT_SGRBG14_1X14,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW14,
> +		.data_type = MIPI_CSI2_DT_RAW14,
>  		.width = 14,
>  	}, {
>  		.code = MEDIA_BUS_FMT_SRGGB14_1X14,
>  		.output = MEDIA_BUS_FMT_SRGGB14_1X14,
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW14,
> +		.data_type = MIPI_CSI2_DT_RAW14,
>  		.width = 14,
>  	},
>  	/* JPEG */
> @@ -494,7 +476,7 @@ static const struct csis_pix_format mipi_csis_formats[] = {
>  		 * SoC that can support quad pixel mode, this will have to be
>  		 * revisited.
>  		 */
> -		.data_type = MIPI_CSI2_DATA_TYPE_RAW8,
> +		.data_type = MIPI_CSI2_DT_RAW8,
>  		.width = 8,
>  	}
>  };
> @@ -583,7 +565,7 @@ static void __mipi_csis_set_format(struct mipi_csis_device *csis,
>  	 *
>  	 * TODO: Verify which other formats require DUAL (or QUAD) modes.
>  	 */
> -	if (csis_fmt->data_type == MIPI_CSI2_DATA_TYPE_YUV422_8)
> +	if (csis_fmt->data_type == MIPI_CSI2_DT_YUV422_8B)
>  		val |= MIPI_CSIS_ISPCFG_PIXEL_MODE_DUAL;
>  
>  	val |= MIPI_CSIS_ISPCFG_FMT(csis_fmt->data_type);
>
> base-commit: 0ff41df1cb268fc69e703a08a57ee14ae967d0ca
> -- 
> Regards,
>
> Laurent Pinchart




  parent reply	other threads:[~2025-06-06  9:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-06  9:05 [PATCH] media: imx-mipi-csis: Use CSI-2 data type macros from mipi-csi2.h Laurent Pinchart
2025-06-06  9:11 ` Stefan Klug
2025-06-06  9:28 ` Rui Miguel Silva [this message]
2025-06-06 15:42 ` Frank Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DAFCE9SLVTFF.2T9D30I3PYO02@linaro.com \
    --to=rmfrfs@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@puri.sm \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=martink@posteo.de \
    --cc=stefan.klug@ideasonboard.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).