Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@nxp.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org, Rui Miguel Silva <rmfrfs@gmail.com>,
	Martin Kepplinger <martink@posteo.de>,
	Purism Kernel Team <kernel@puri.sm>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	imx@lists.linux.dev, Stefan Klug <stefan.klug@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@iki.fi>
Subject: Re: [PATCH v1 5/6] media: imx-mipi-csis: Set all per-channel registers in one function
Date: Fri, 7 Nov 2025 11:37:14 -0500	[thread overview]
Message-ID: <aQ4gOqoV8tM65ojJ@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20251107015813.5834-6-laurent.pinchart@ideasonboard.com>

On Fri, Nov 07, 2025 at 03:58:12AM +0200, Laurent Pinchart wrote:
> The __mipi_csis_set_format() function programs most of the per-channel
> registers, with the exception of the MIPI_CSIS_ISP_SYNC_CH register. To
> prepare for multi-channel support, move programming of that register to
> the function, and rename it to mipi_csis_set_channel_params() to clearly
> indicate its purpose.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/media/platform/nxp/imx-mipi-csis.c | 23 +++++++++++-----------
>  1 file changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c
> index 9dd264af181f..d8c11223ed0a 100644
> --- a/drivers/media/platform/nxp/imx-mipi-csis.c
> +++ b/drivers/media/platform/nxp/imx-mipi-csis.c
> @@ -597,13 +597,14 @@ static void mipi_csis_system_enable(struct mipi_csis_device *csis, int on)
>  	mipi_csis_write(csis, MIPI_CSIS_DPHY_CMN_CTRL, val);
>  }
>
> -static void __mipi_csis_set_format(struct mipi_csis_device *csis,
> -				   const struct mipi_csis_channel_params *params)
> +static void mipi_csis_set_channel_params(struct mipi_csis_device *csis,
> +					 unsigned int channel,
> +					 const struct mipi_csis_channel_params *params)
>  {
>  	u32 val;
>
>  	/* Color format */
> -	val = mipi_csis_read(csis, MIPI_CSIS_ISP_CONFIG_CH(0));
> +	val = mipi_csis_read(csis, MIPI_CSIS_ISP_CONFIG_CH(channel));
>  	val &= ~(MIPI_CSIS_ISPCFG_PARALLEL | MIPI_CSIS_ISPCFG_PIXEL_MODE_MASK |
>  		 MIPI_CSIS_ISPCFG_DATAFORMAT_MASK |
>  		 MIPI_CSIS_ISPCFG_VIRTUAL_CHANNEL_MASK);
> @@ -627,10 +628,15 @@ static void __mipi_csis_set_format(struct mipi_csis_device *csis,
>  	val |= MIPI_CSIS_ISPCFG_DATAFORMAT(params->data_type);
>  	val |= MIPI_CSIS_ISPCFG_VIRTUAL_CHANNEL(0);
>
> -	mipi_csis_write(csis, MIPI_CSIS_ISP_CONFIG_CH(0), val);
> +	mipi_csis_write(csis, MIPI_CSIS_ISP_CONFIG_CH(channel), val);
> +
> +	mipi_csis_write(csis, MIPI_CSIS_ISP_SYNC_CH(channel),
> +			MIPI_CSIS_ISP_SYNC_HSYNC_LINTV(0) |
> +			MIPI_CSIS_ISP_SYNC_VSYNC_SINTV(0) |
> +			MIPI_CSIS_ISP_SYNC_VSYNC_EINTV(0));
>
>  	/* Pixel resolution */
> -	mipi_csis_write(csis, MIPI_CSIS_ISP_RESOL_CH(0),
> +	mipi_csis_write(csis, MIPI_CSIS_ISP_RESOL_CH(channel),
>  			MIPI_CSIS_ISP_RESOL_VRESOL(params->height) |
>  			MIPI_CSIS_ISP_RESOL_HRESOL(params->width));
>  }
> @@ -711,17 +717,12 @@ static void mipi_csis_set_params(struct mipi_csis_device *csis,
>
>  	mipi_csis_write(csis, MIPI_CSIS_CMN_CTRL, val);
>
> -	__mipi_csis_set_format(csis, &params->channels[0]);
> +	mipi_csis_set_channel_params(csis, 0, &params->channels[0]);
>
>  	mipi_csis_write(csis, MIPI_CSIS_DPHY_CMN_CTRL,
>  			MIPI_CSIS_DPHY_CMN_CTRL_HSSETTLE(params->hs_settle) |
>  			MIPI_CSIS_DPHY_CMN_CTRL_CLKSETTLE(params->clk_settle));
>
> -	mipi_csis_write(csis, MIPI_CSIS_ISP_SYNC_CH(0),
> -			MIPI_CSIS_ISP_SYNC_HSYNC_LINTV(0) |
> -			MIPI_CSIS_ISP_SYNC_VSYNC_SINTV(0) |
> -			MIPI_CSIS_ISP_SYNC_VSYNC_EINTV(0));
> -
>  	val = mipi_csis_read(csis, MIPI_CSIS_CLK_CTRL);
>  	val |= MIPI_CSIS_CLK_CTRL_WCLK_SRC(0);
>  	val |= MIPI_CSIS_CLK_CTRL_CLKGATE_TRAIL(0, 15);
> --
> Regards,
>
> Laurent Pinchart
>

  reply	other threads:[~2025-11-07 16:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07  1:58 [PATCH v1 0/6] media: imx-mipi-csis: Add streams support Laurent Pinchart
2025-11-07  1:58 ` [PATCH v1 1/6] media: imx-mipi-csis: Add VC-related register fields Laurent Pinchart
2025-11-07 16:19   ` Frank Li
2025-11-07 18:44     ` Laurent Pinchart
2025-11-07 20:37       ` Frank Li
2025-11-07  1:58 ` [PATCH v1 2/6] media: imx-mipi-csis: Switch to .enable_streams() Laurent Pinchart
2025-11-07 16:29   ` Frank Li
2025-11-07 18:32     ` Laurent Pinchart
2025-11-07  1:58 ` [PATCH v1 3/6] media: imx-mipi-csis: Implement the .set_routing() operation Laurent Pinchart
2025-11-07 16:36   ` Frank Li
2025-11-07 18:30     ` Laurent Pinchart
2025-11-07 20:38       ` Frank Li
2025-11-09 21:48   ` kernel test robot
2025-11-07  1:58 ` [PATCH v1 4/6] media: imx-mipi-csis: Group runtime parameters in structure Laurent Pinchart
2025-11-07 16:40   ` Frank Li
2025-11-07  1:58 ` [PATCH v1 5/6] media: imx-mipi-csis: Set all per-channel registers in one function Laurent Pinchart
2025-11-07 16:37   ` Frank Li [this message]
2025-11-07  1:58 ` [PATCH v1 6/6] media: imx-mipi-csis: Add multi-channel support Laurent Pinchart
2025-11-07 16:48   ` Frank Li
2025-11-07 18:43     ` Laurent Pinchart
2025-11-20  3:12     ` G.N. Zhou
2025-11-20 15:23       ` Frank Li
2025-11-20 16:22       ` Laurent Pinchart
2025-12-02  0:59         ` [EXT] " G.N. Zhou
2025-11-07  9:31 ` [PATCH v1 0/6] media: imx-mipi-csis: Add streams support Martin Kepplinger
2025-11-07 18:28   ` Laurent Pinchart

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=aQ4gOqoV8tM65ojJ@lizhi-Precision-Tower-5810 \
    --to=frank.li@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=kernel@puri.sm \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=martink@posteo.de \
    --cc=rmfrfs@gmail.com \
    --cc=sakari.ailus@iki.fi \
    --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