public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Jai Luthra <jai.luthra@ideasonboard.com>
To: Jai Luthra <jai.luthra@linux.dev>,
	 Mauro Carvalho Chehab <mchehab@kernel.org>,
	 Hans Verkuil <hverkuil@xs4all.nl>,
	 Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
	 Sakari Ailus <sakari.ailus@linux.intel.com>,
	 Maxime Ripard <mripard@kernel.org>
Cc: Devarsh Thakkar <devarsht@ti.com>,
	 Rishikesh Donadkar <r-donadkar@ti.com>,
	Vaishnav Achath <vaishnav.a@ti.com>,
	 Changhuang Liang <changhuang.liang@starfivetech.com>,
	 linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Jai Luthra <jai.luthra@ideasonboard.com>,
	stable@vger.kernel.org
Subject: [PATCH 3/6] media: ti: j721e-csi2rx: Fix source subdev link creation
Date: Mon, 24 Mar 2025 17:31:39 +0530	[thread overview]
Message-ID: <20250324-probe_fixes-v1-3-5cd5b9e1cfac@ideasonboard.com> (raw)
In-Reply-To: <20250324-probe_fixes-v1-0-5cd5b9e1cfac@ideasonboard.com>

We don't use OF ports and remote-endpoints to connect the CSI2RX bridge
and this device in the device tree, thus it is wrong to use
v4l2_create_fwnode_links_to_pad() to create the media graph link between
the two.

It works out on accident, as neither the source nor the sink implement
the .get_fwnode_pad() callback, and the framework helper falls back on
using the first source and sink pads to create the link between them.

Instead, manually create the media link from the first source pad of the
bridge to the first sink pad of the J721E CSI2RX.

Fixes: b4a3d877dc92 ("media: ti: Add CSI2RX support for J721E")
Cc: stable@vger.kernel.org
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
---
 drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
index 6d406925e092660cb67c04cc2a7e1e10c14e295e..ad51d033b6725426550578bdac1bae8443458f13 100644
--- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
+++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
@@ -53,6 +53,8 @@
 #define DRAIN_TIMEOUT_MS		50
 #define DRAIN_BUFFER_SIZE		SZ_32K
 
+#define CSI2RX_BRIDGE_SOURCE_PAD	1
+
 struct ti_csi2rx_fmt {
 	u32				fourcc;	/* Four character code. */
 	u32				code;	/* Mbus code. */
@@ -427,8 +429,9 @@ static int csi_async_notifier_complete(struct v4l2_async_notifier *notifier)
 	if (ret)
 		return ret;
 
-	ret = v4l2_create_fwnode_links_to_pad(csi->source, &csi->pad,
-					      MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED);
+	ret = media_create_pad_link(&csi->source->entity, CSI2RX_BRIDGE_SOURCE_PAD,
+				    &vdev->entity, csi->pad.index,
+				    MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED);
 
 	if (ret) {
 		video_unregister_device(vdev);

-- 
2.48.1


  parent reply	other threads:[~2025-03-24 12:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-24 12:01 [PATCH 0/6] media: ti, cdns: Multiple pixel support and misc fixes Jai Luthra
2025-03-24 12:01 ` [PATCH 1/6] media: ti: j721e-csi2rx: Use devm_of_platform_populate Jai Luthra
2025-03-27  6:25   ` Devarsh Thakkar
2025-03-24 12:01 ` [PATCH 2/6] media: ti: j721e-csi2rx: Use fwnode_get_named_child_node Jai Luthra
2025-03-27  6:31   ` Devarsh Thakkar
2025-03-24 12:01 ` Jai Luthra [this message]
2025-03-27 10:14   ` [PATCH 3/6] media: ti: j721e-csi2rx: Fix source subdev link creation Devarsh Thakkar
2025-03-24 12:01 ` [PATCH 4/6] media: cadence: csi2rx: Implement get_fwnode_pad op Jai Luthra
2025-03-27 10:24   ` Devarsh Thakkar
2025-03-28  2:39   ` 回复: " Changhuang Liang
2025-03-24 12:01 ` [PATCH 5/6] media: cadence: cdns-csi2rx: Support multiple pixels per clock cycle Jai Luthra
2025-03-24 14:28   ` kernel test robot
2025-03-24 18:21   ` kernel test robot
2025-03-24 12:01 ` [PATCH 6/6] media: ti: j721e-csi2rx: Support multiple pixels per clock Jai Luthra

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=20250324-probe_fixes-v1-3-5cd5b9e1cfac@ideasonboard.com \
    --to=jai.luthra@ideasonboard.com \
    --cc=changhuang.liang@starfivetech.com \
    --cc=devarsht@ti.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jai.luthra@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mripard@kernel.org \
    --cc=r-donadkar@ti.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=stable@vger.kernel.org \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=vaishnav.a@ti.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