From patchwork Wed Sep 4 11:10:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikram Sharma X-Patchwork-Id: 13790630 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C652ACD3431 for ; Wed, 4 Sep 2024 11:28:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:CC:To:In-Reply-To:References :Message-ID:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zrLAh74DYFhvMtwKfP+Vk1B+Ukjx+HUK386pS2ziaA4=; b=mRudiL1e89RCIZE/0MzXHdN8O2 jWKPxRlss9q4GZenIqzIA2gmrTyj79Ekx+ijLU7OC9dAk3/RGuU5IGImWgv/NT4/aysh7ueIaSnO/ yfCdO/cvo47oQZQxqFLvK958n5jRb1QnEt9YVGRbqnZ8plwFVYpgibkbkfL7wIBPxhaiEkxUH6Jsm WanTn+5AMLJdkG6E5IENanGkKjksR9518M4YALDMwVhvY0YOqlsFFRyzX4Suq5fNshamJCZyvJQ/h ysbouK9KbNWS3T/pG6dlSWA/e+vYqCe4wvb+fV/Q95J5jj8F0/+Sybel10nmc/KDGOP5e5fXc0jzD RA4h3Kjw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sloAr-0000000489a-2kUS; Wed, 04 Sep 2024 11:27:45 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slnw6-000000043p3-06Ji for linux-arm-kernel@lists.infradead.org; Wed, 04 Sep 2024 11:12:32 +0000 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 484A1b30001041; Wed, 4 Sep 2024 11:12:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= zrLAh74DYFhvMtwKfP+Vk1B+Ukjx+HUK386pS2ziaA4=; b=gmls/LGz+Gv2cpc1 IfspzQqFETYcj89L9IZ12oTza7NnMAI961D4joDoh9glSVV5oy2SNwoB61zPwi+1 jRm0FR71RiwCSVJibfBYmchCBhwyNMl0i4j7wdTg7CQA1X3Jj2czg5zDWwJvEFDJ 0Utq7PL4sbiTmTYkUCxmceUrRiwn2X2J0UEQ4EVVpJK3+qHxJP3k/hRP5nvvUH2T B4oDm4naoz3tWJd+ewfJQkMlBxrya3ptbu2BdWMpIp6dHY6Z+bJk4oEBRE1p/VUH oCSKd7sk8G1vmwtG7N4S3cWOcE3+gBl8rIl9tBWKz/JH+nOnEBGlVGySIhNbywLO IeGssw== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41drqe4t0e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Sep 2024 11:12:15 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA05.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 484BCDGe030749 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 4 Sep 2024 11:12:13 GMT Received: from [169.254.0.1] (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 4 Sep 2024 04:12:07 -0700 From: Vikram Sharma Date: Wed, 4 Sep 2024 16:40:12 +0530 Subject: [PATCH 06/10] media: qcom: camss: Add camss_link_entities_v2 MIME-Version: 1.0 Message-ID: <20240904-camss_on_sc7280_rb3gen2_vision_v2_patches-v1-6-b18ddcd7d9df@quicinc.com> References: <20240904-camss_on_sc7280_rb3gen2_vision_v2_patches-v1-0-b18ddcd7d9df@quicinc.com> In-Reply-To: <20240904-camss_on_sc7280_rb3gen2_vision_v2_patches-v1-0-b18ddcd7d9df@quicinc.com> To: Robert Foss , Todor Tomov , "Bryan O'Donoghue" , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Kapatrala Syed , Hariram Purushothaman , "Bjorn Andersson" , Konrad Dybcio , Hans Verkuil , , Catalin Marinas , Will Deacon CC: , , , , , Vikram Sharma , Suresh Vankadara , Trishansh Bhardwaj X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1725448289; l=2731; i=quic_vikramsa@quicinc.com; s=20240628; h=from:subject:message-id; bh=Kcp2kWdP+HNWbKqjmmtJA1KBNWiD20CxJPBdj/Q6yBo=; b=al04Z44xl/mD5WvI/+Adn6dxipaTdlSF0P/YK/L1JRrbsxLWYBS+XBnFzoXTxFcoxCxk2gRlH m1ruQorThyRDCrJRjjbnzaci7EIpEQ/QlE2DpWbRM3FQz+FCBDHn01g X-Developer-Key: i=quic_vikramsa@quicinc.com; a=ed25519; pk=vQBkwZr1Hv+VXogAyTAu7AEx8/6bvkOmgrzYFbNGCDI= X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: g8Ew9EuCdgjlSPMOUzuaIx_G6yK7WyOv X-Proofpoint-ORIG-GUID: g8Ew9EuCdgjlSPMOUzuaIx_G6yK7WyOv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-04_09,2024-09-04_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 phishscore=0 adultscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 spamscore=0 mlxlogscore=848 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2409040084 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240904_041230_221878_B95B0FEA X-CRM114-Status: GOOD ( 17.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Signed-off-by: Trishansh Bhardwaj Signed-off-by: Vikram Sharma --- 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 = {