Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Amin Gattout <amin.gattout@gmail.com>
To: Mehdi Djait <mehdi.djait@linux.intel.com>,
	 Michael Riesch <michael.riesch@collabora.com>,
	 Mauro Carvalho Chehab <mchehab@kernel.org>,
	Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	Heiko Stuebner <heiko@sntech.de>
Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	 linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org,
	 linux-kernel@vger.kernel.org,
	Amin Gattout <amin.gattout@gmail.com>
Subject: [PATCH v2 3/5] media: rockchip: rkcif: add a callback for the MIPI ID_CTRL1 register
Date: Mon, 21 Sep 2026 17:29:59 +0200	[thread overview]
Message-ID: <20260921-vicap-rk3576-v2-3-0a4582e20c72@gmail.com> (raw)
In-Reply-To: <20260921-vicap-rk3576-v2-0-0a4582e20c72@gmail.com>

The contents of the MIPI ID_CTRL1 register differ between variants. The
RK3568 and RK3588 hold the capture size there, while the RK3576 uses it
for the virtual channel and data type filter.

Let each variant provide a callback that builds the register value, in
preparation for the RK3576 support. Variants that do not provide one
keep writing the capture size, so their behavior is unchanged.

Signed-off-by: Amin Gattout <amin.gattout@gmail.com>
---
 drivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.c | 5 ++++-
 drivers/media/platform/rockchip/rkcif/rkcif-common.h       | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.c b/drivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.c
index e0acb9049ca1..432f47a1fc23 100644
--- a/drivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.c
+++ b/drivers/media/platform/rockchip/rkcif/rkcif-capture-mipi.c
@@ -749,7 +749,10 @@ static int rkcif_mipi_start_streaming(struct rkcif_stream *stream)
 	if (match_data->mipi_ctrl0)
 		ctrl0 = match_data->mipi_ctrl0(stream, active_out_fmt);
 
-	ctrl1 = RKCIF_XY_COORD(width, height);
+	if (match_data->mipi_ctrl1)
+		ctrl1 = match_data->mipi_ctrl1(stream, active_out_fmt);
+	else
+		ctrl1 = RKCIF_XY_COORD(width, height);
 
 	int_mask |= RKCIF_MIPI_INT_FRAME0_END(stream->id);
 	int_mask |= RKCIF_MIPI_INT_FRAME1_END(stream->id);
diff --git a/drivers/media/platform/rockchip/rkcif/rkcif-common.h b/drivers/media/platform/rockchip/rkcif/rkcif-common.h
index 4d9211ba9bda..f83c8099b78e 100644
--- a/drivers/media/platform/rockchip/rkcif/rkcif-common.h
+++ b/drivers/media/platform/rockchip/rkcif/rkcif-common.h
@@ -207,6 +207,8 @@ struct rkcif_mipi_match_data {
 	unsigned int regs_id[RKCIF_ID_MAX][RKCIF_MIPI_ID_REGISTER_MAX];
 	u32 (*mipi_ctrl0)(struct rkcif_stream *stream,
 			  const struct rkcif_output_fmt *active_out_fmt);
+	u32 (*mipi_ctrl1)(struct rkcif_stream *stream,
+			  const struct rkcif_output_fmt *active_out_fmt);
 	struct {
 		unsigned int offset;
 	} blocks[RKCIF_MIPI_MAX - RKCIF_MIPI_BASE];

-- 
2.43.0



  parent reply	other threads:[~2026-09-21 15:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21 15:29 [PATCH v2 0/5] media: rockchip: add support for the RK3576 Video Capture unit Amin Gattout
2026-09-21 15:29 ` [PATCH v2 1/5] media: dt-bindings: add rockchip rk3576 vicap Amin Gattout
2026-09-23 14:51   ` Mehdi Djait
2026-09-21 15:29 ` [PATCH v2 2/5] media: rockchip: rkcif: add a register index for the MIPI capture size Amin Gattout
2026-09-23 14:52   ` Mehdi Djait
2026-10-01 15:24   ` Michael Riesch
2026-09-21 15:29 ` Amin Gattout [this message]
2026-09-23 14:53   ` [PATCH v2 3/5] media: rockchip: rkcif: add a callback for the MIPI ID_CTRL1 register Mehdi Djait
2026-10-01 15:27   ` Michael Riesch
2026-09-21 15:30 ` [PATCH v2 4/5] media: rockchip: rkcif: add support for rk3576 vicap mipi capture Amin Gattout
2026-09-23 14:55   ` Mehdi Djait
2026-10-01 15:30   ` Michael Riesch
2026-09-21 15:30 ` [PATCH v2 5/5] arm64: dts: rockchip: add vicap node to rk3576 Amin Gattout
2026-09-23 14:56   ` Mehdi Djait
2026-09-23 14:35 ` [PATCH v2 0/5] media: rockchip: add support for the RK3576 Video Capture unit Mehdi Djait
2026-10-05 19:06 ` (subset) " Heiko Stuebner

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=20260921-vicap-rk3576-v2-3-0a4582e20c72@gmail.com \
    --to=amin.gattout@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.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=linux-rockchip@lists.infradead.org \
    --cc=mchehab@kernel.org \
    --cc=mehdi.djait@linux.intel.com \
    --cc=michael.riesch@collabora.com \
    --cc=robh@kernel.org \
    /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