Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
Cc: Frank Li <Frank.Li@nxp.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Loic Poulain <loic.poulain@oss.qualcomm.com>,
	linux-media@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v5 07/11] media: imx8-isi: Select MSB-aligned RAW input from pixel link on i.MX95
Date: Tue, 1 Dec 2026 00:12:32 +0900	[thread overview]
Message-ID: <20261130151232.GC57763@killaraus.ideasonboard.com> (raw)
In-Reply-To: <20261116-isi_imx952-v5-7-46de1d24efd4@oss.nxp.com>

On Mon, Nov 16, 2026 at 11:28:25AM +0800, Guoniu Zhou wrote:
> The ISI receives RAW data from the Pixel Link, whose alignment is
> determined by the SoC integration. Before i.MX93, the Pixel Link
> provides LSB-aligned RAW data to the ISI. Starting with i.MX93, both
> LSB and MSB alignment are supported and can be selected via
> CHNL_CTRL_RAW_IN_MSB_ALIGN, with the default keeping LSB alignment
> for backward compatibility. From i.MX95 onwards, the CSI formatter
> replaces the gasket and only provides MSB-aligned RAW data.
> 
> Set CHNL_CTRL_RAW_IN_MSB_ALIGN on i.MX95 so the ISI selects RAW
> samples from the high bits of the Pixel Link bus.
> 
> Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>

I think this patch should go after 08/11.

> ---
> Changes in v4:
> - New patch
> ---
>  drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c   | 20 ++++++++++++++++++++
>  drivers/media/platform/nxp/imx8-isi/imx8-isi-regs.h |  1 +
>  2 files changed, 21 insertions(+)
> 
> diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c
> index cc52a90c2477..b3f32b9796d5 100644
> --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c
> +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c
> @@ -303,6 +303,22 @@ static void mxc_isi_channel_set_panic_threshold(struct mxc_isi_pipe *pipe)
>  	mxc_isi_write(pipe, CHNL_OUT_BUF_CTRL, val);
>  }
>  
> +/*
> + * The ISI receives RAW data from the Pixel Link, whose alignment is
> + * determined by the SoC integration. It originally selected RAW samples
> + * from the low bits of the Pixel Link bus. Starting with i.MX93,
> + * CHNL_CTRL_RAW_IN_MSB_ALIGN was introduced to allow the ISI to select
> + * RAW samples from either the high or low bits, as both LSB and MSB
> + * alignment can be selected in the gasket.
> + *
> + * On i.MX95, the CSI formatter provides MSB-aligned RAW data, so the ISI
> + * must select RAW samples from the high bits of the Pixel Link bus.

This comment is too verbose. It copies most of the information from the
commit messages while that's not useful for the reader here. See below
for a shortened message.

> + */
> +static bool isi_raw_in_msb(const struct mxc_isi_plat_data *pdata)
> +{
> +	return pdata->model == MXC_ISI_IMX95;
> +}
> +
>  static void mxc_isi_channel_set_control(struct mxc_isi_pipe *pipe,
>  					enum mxc_isi_input_id input,
>  					unsigned int vc,
> @@ -357,6 +373,10 @@ static void mxc_isi_channel_set_control(struct mxc_isi_pipe *pipe,
>  			val |= CHNL_CTRL_VC_ID_1(vc >> 2);
>  	}
>  
> +	/* Select MSB-aligned RAW data from the Pixel Link when needed. */
> +	if (isi_raw_in_msb(pipe->isi->pdata))
> +		val |= CHNL_CTRL_RAW_IN_MSB_ALIGN;

The helper function is used here only, you can just inline it.

	/*
	 * Starting on i.MX95, the ISI gasket is replaced by a Pixel Formatter
	 * that unconditionally aligns data to the MSB. Configure the ISI to
	 * select MSB-aligned data.
	 */
	if (isi->pdata->model == MXC_ISI_IMX95)
		val |= CHNL_CTRL_RAW_IN_MSB_ALIGN;

> +
>  	mxc_isi_write(pipe, CHNL_CTRL, val);
>  
>  	mutex_unlock(&pipe->lock);
> diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-regs.h b/drivers/media/platform/nxp/imx8-isi/imx8-isi-regs.h
> index 5f66b7c9cd1c..35438abf3172 100644
> --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-regs.h
> +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-regs.h
> @@ -20,6 +20,7 @@
>  #define CHNL_CTRL_CHAIN_BUF_NO_CHAIN				0
>  #define CHNL_CTRL_CHAIN_BUF_2_CHAIN				1
>  #define CHNL_CTRL_SW_RST					BIT(24)
> +#define CHNL_CTRL_RAW_IN_MSB_ALIGN				BIT(22)	/* i.MX{91,93,95} */
>  /*
>   * CHNL_CTRL_BLANK_PXL: i.MX8{QM,QXP} only
>   * CHNL_CTRL_VC_ID_1, CHNL_CTRL_VC_ID_1_MASK: i.MX95 only

-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2026-11-30 15:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  3:28 [PATCH v5 00/11] media: imx8-isi: Add i.MX952 ISI support Guoniu Zhou
2026-11-16  3:28 ` [PATCH v5 01/11] media: imx8-isi: Reorder mxc_imx95_data to follow mxc_imx93_data Guoniu Zhou
2026-11-16  3:28 ` [PATCH v5 02/11] media: imx8-isi: Extend output format mask to 7 bits Guoniu Zhou
2026-11-16  3:28 ` [PATCH v5 03/11] media: imx8-isi: Support mbus_code filtering in format enumeration Guoniu Zhou
2026-11-30  8:22   ` Laurent Pinchart
2026-11-16  3:28 ` [PATCH v5 04/11] media: imx8-isi: Reuse mxc_isi_format_enum() in capture " Guoniu Zhou
2026-11-16  3:28 ` [PATCH v5 05/11] media: imx8-isi: Apply RAW output format workaround at runtime Guoniu Zhou
2026-11-30 13:43   ` Laurent Pinchart
2026-11-16  3:28 ` [PATCH v5 06/11] media: imx8-isi: Add RAW14 output format support Guoniu Zhou
2026-11-30 13:57   ` Laurent Pinchart
2026-11-16  3:28 ` [PATCH v5 07/11] media: imx8-isi: Select MSB-aligned RAW input from pixel link on i.MX95 Guoniu Zhou
2026-11-16 16:48   ` Frank Li
2026-11-30 15:12   ` Laurent Pinchart [this message]
2026-11-16  3:28 ` [PATCH v5 08/11] media: imx8-isi: Exclude RAW10/12/14 output formats " Guoniu Zhou
2026-11-16 16:53   ` Frank Li
2026-11-30 15:18   ` Laurent Pinchart
2026-11-16  3:28 ` [PATCH v5 09/11] media: dt-bindings: nxp,imx8-isi: Add i.MX952 ISI compatible string Guoniu Zhou
2026-11-16  3:28 ` [PATCH v5 10/11] media: imx8-isi: Add i.MX952 ISI support Guoniu Zhou
2026-11-30 15:32   ` Laurent Pinchart
2026-11-16  3:28 ` [PATCH v5 11/11] media: imx8-isi: Enable RAW10/12/14 output LSB alignment on i.MX952 Guoniu Zhou

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=20261130151232.GC57763@killaraus.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=Frank.Li@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=guoniu.zhou@oss.nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    /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