[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240904-camss_on_sc7280_rb3gen2_vision_v2_patches-v1-6-b18ddcd7d9df@quicinc.com>
Date: Wed, 4 Sep 2024 16:40:12 +0530
From: Vikram Sharma <quic_vikramsa@...cinc.com>
To: Robert Foss <rfoss@...nel.org>, Todor Tomov <todor.too@...il.com>,
"Bryan
O'Donoghue" <bryan.odonoghue@...aro.org>,
Mauro Carvalho Chehab
<mchehab@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski
<krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Kapatrala Syed
<akapatra@...cinc.com>,
Hariram Purushothaman <hariramp@...cinc.com>,
"Bjorn
Andersson" <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>,
Hans Verkuil <hverkuil-cisco@...all.nl>,
<cros-qcom-dts-watchers@...omium.org>,
Catalin Marinas
<catalin.marinas@....com>,
Will Deacon <will@...nel.org>
CC: <linux-arm-msm@...r.kernel.org>, <linux-media@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
Vikram Sharma
<quic_vikramsa@...cinc.com>,
Suresh Vankadara <quic_svankada@...cinc.com>,
Trishansh Bhardwaj <quic_tbhardwa@...cinc.com>
Subject: [PATCH 06/10] media: qcom: camss: Add camss_link_entities_v2
Add camss_link_entities_v2, derived from the camss_link_entities
function, to handle linking for targets without ISPIF.
camss_link_entities -> Targets with ispif.
camss_link_entities_v2 -> Targets without ispif.
Signed-off-by: Suresh Vankadara <quic_svankada@...cinc.com>
Signed-off-by: Trishansh Bhardwaj <quic_tbhardwa@...cinc.com>
Signed-off-by: Vikram Sharma <quic_vikramsa@...cinc.com>
---
drivers/media/platform/qcom/camss/camss.c | 53 ++++++++++++++++++++++++++++++-
1 file changed, 52 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index 5e7235001239..516434686a27 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -2154,6 +2154,57 @@ static int camss_init_subdevices(struct camss *camss)
return 0;
}
+/*
+ * camss_link_entities_v2 - Register subdev nodes and create links
+ * @camss: CAMSS device
+ *
+ * Return 0 on success or a negative error code on failure
+ */
+static int camss_link_entities_v2(struct camss *camss)
+{
+ int i, j;
+ int ret;
+
+ for (i = 0; i < camss->res->csiphy_num; i++) {
+ for (j = 0; j < camss->res->csid_num; j++) {
+ ret = media_create_pad_link(&camss->csiphy[i].subdev.entity,
+ MSM_CSIPHY_PAD_SRC,
+ &camss->csid[j].subdev.entity,
+ MSM_CSID_PAD_SINK,
+ 0);
+ if (ret < 0) {
+ dev_err(camss->dev,
+ "Failed to link %s->%s entities: %d\n",
+ camss->csiphy[i].subdev.entity.name,
+ camss->csid[j].subdev.entity.name,
+ ret);
+ return ret;
+ }
+ }
+ }
+
+ for (i = 0; i < camss->res->csid_num; i++)
+ for (j = 0; j < camss->vfe[i].res->line_num; j++) {
+ struct v4l2_subdev *csid = &camss->csid[i].subdev;
+ struct v4l2_subdev *vfe = &camss->vfe[i].line[j].subdev;
+
+ ret = media_create_pad_link(&csid->entity,
+ MSM_CSID_PAD_FIRST_SRC + j,
+ &vfe->entity,
+ MSM_VFE_PAD_SINK,
+ 0);
+ if (ret < 0) {
+ dev_err(camss->dev,
+ "Failed to link %s->%s entities: %d\n",
+ csid->entity.name,
+ vfe->entity.name,
+ ret);
+ return ret;
+ }
+ }
+ return 0;
+}
+
/*
* camss_link_entities - Register subdev nodes and create links
* @camss: CAMSS device
@@ -2769,7 +2820,7 @@ static const struct camss_resources sc8280xp_resources = {
.csiphy_num = ARRAY_SIZE(csiphy_res_sc8280xp),
.csid_num = ARRAY_SIZE(csid_res_sc8280xp),
.vfe_num = ARRAY_SIZE(vfe_res_sc8280xp),
- .link_entities = camss_link_entities
+ .link_entities = camss_link_entities_v2
};
static const struct camss_resources sc7280_resources = {
--
2.25.1
Powered by blists - more mailing lists