From nobody Mon Nov 25 02:31:45 2024 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDDFD1E411D; Wed, 30 Oct 2024 10:54:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730285678; cv=none; b=L/ra5BwhVj7OTP92E1uCHUEh3nJTCXvjbZ3CPU+JNQVlt+tPVz8higQ8ofmDp+jjnDKnALWj3cpI3SuzKoeYCi3NPSefKqgIyyv9mLRS0s/EOA+elQaPYfIbuJJL2gW6fzDrRpKPQ+UJuC+F47nAyIYPYC/09PhadEP/dtBc4Mk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730285678; c=relaxed/simple; bh=j4OueEndsDKUkMZsjO71HyqJ1026t30K6W4/BNvFG5Q=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=g8LiCawA/oIhkiL+Kg6FIOIbzMpYIwgPYuobIoBlLIOM1Arg9K8O7bfIeE738+VwZp64+q2F/rucrgq9PYEqUZFpSexjUmoU9UrLncf4kvuf7z8NOzXLpbU2fcfnrW0nihsFY1W7iX07h4K7XyuJTey/8XJx+zqArrBGinILVlI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=JjCsRNGp; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="JjCsRNGp" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49U8tcqh007307; Wed, 30 Oct 2024 10:54:25 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= MchXVeHuU0Ne7MaSu7AdLTmewnC64SxRyuFlym4y/V8=; b=JjCsRNGpPNjWJw8V UYiBK1L0KO9UC0+aouiq46/rsq/12rY0l44JPb3CNf/djHULK9/oq+1VdZvi/ACe CuNoXfQmJymEg+R6zok4HS+XW4jOL/U6GfF9C3nMWI7M7+2dLixvom1vFl3VNpGa ocPBHrB1HtY1NgYan5+HoE2kUCPbvYw9rPSnwD3GjVMaaRnH20eCzcggZkkTih1E RSj5fQiQ6MpsK0EF3VoDRv8rG5Us12XVEqRXFcL4z7xxqyo/U2QxWBjhGO+dTBUB ZMFiiaR59zxkSppmEPCVfXfMTV6M6LbBHWfRNhIueZ2aKZgbdwK8Ov/NhzOMecLU l+SDOA== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42khqbrbe0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Oct 2024 10:54:25 +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 49UAsOLg015501 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Oct 2024 10:54:24 GMT Received: from hu-vikramsa-hyd.qualcomm.com (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, 30 Oct 2024 03:54:15 -0700 From: Vikram Sharma To: , , , , , , , , , , , , , , CC: , , , , , , Subject: [PATCH v4 1/6] media: dt-bindings: media: camss: Add qcom,sc7280-camss binding Date: Wed, 30 Oct 2024 16:23:42 +0530 Message-ID: <20241030105347.2117034-2-quic_vikramsa@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241030105347.2117034-1-quic_vikramsa@quicinc.com> References: <20241030105347.2117034-1-quic_vikramsa@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: OwSYsdA-APBbW-edUZU3grUmqa10VMqg X-Proofpoint-ORIG-GUID: OwSYsdA-APBbW-edUZU3grUmqa10VMqg 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-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=999 lowpriorityscore=0 bulkscore=0 adultscore=0 mlxscore=0 suspectscore=0 malwarescore=0 spamscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410300084 Content-Type: text/plain; charset="utf-8" Add bindings for qcom,sc7280-camss to support the camera subsystem on the SC7280 platform. Signed-off-by: Suresh Vankadara Signed-off-by: Trishansh Bhardwaj Signed-off-by: Vikram Sharma --- .../bindings/media/qcom,sc7280-camss.yaml | 439 ++++++++++++++++++ 1 file changed, 439 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/qcom,sc7280-cam= ss.yaml diff --git a/Documentation/devicetree/bindings/media/qcom,sc7280-camss.yaml= b/Documentation/devicetree/bindings/media/qcom,sc7280-camss.yaml new file mode 100644 index 000000000000..783a5366e32b --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,sc7280-camss.yaml @@ -0,0 +1,439 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/qcom,sc7280-camss.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm SC7280 CAMSS ISP + +maintainers: + - Azam Sadiq Pasha Kapatrala Syed + - Hariram Purushothaman + +description: + The CAMSS IP is a CSI decoder and ISP present on Qualcomm platforms. + +properties: + compatible: + const: qcom,sc7280-camss + + clocks: + maxItems: 32 + + clock-names: + items: + - const: camnoc_axi + - const: csi0 + - const: csi1 + - const: csi2 + - const: csi3 + - const: csi4 + - const: csiphy0 + - const: csiphy0_timer + - const: csiphy1 + - const: csiphy1_timer + - const: csiphy2 + - const: csiphy2_timer + - const: csiphy3 + - const: csiphy3_timer + - const: csiphy4 + - const: csiphy4_timer + - const: gcc_camera_ahb + - const: gcc_camera_axi + - const: soc_ahb + - const: vfe0_axi + - const: vfe0 + - const: vfe0_cphy_rx + - const: vfe1_axi + - const: vfe1 + - const: vfe1_cphy_rx + - const: vfe2_axi + - const: vfe2 + - const: vfe2_cphy_rx + - const: vfe0_lite + - const: vfe0_lite_cphy_rx + - const: vfe1_lite + - const: vfe1_lite_cphy_rx + + interconnects: + maxItems: 2 + + interconnect-names: + items: + - const: ahb + - const: hf_0 + + interrupts: + maxItems: 15 + + interrupt-names: + items: + - const: csid0 + - const: csid1 + - const: csid2 + - const: csid_lite0 + - const: csid_lite1 + - const: csiphy0 + - const: csiphy1 + - const: csiphy2 + - const: csiphy3 + - const: csiphy4 + - const: vfe0 + - const: vfe1 + - const: vfe2 + - const: vfe_lite0 + - const: vfe_lite1 + + iommus: + maxItems: 1 + + power-domains: + items: + - description: IFE0 GDSC - Image Front End, Global Distributed Switc= h Controller. + - description: IFE1 GDSC - Image Front End, Global Distributed Switc= h Controller. + - description: IFE2 GDSC - Image Front End, Global Distributed Switc= h Controller. + - description: Titan GDSC - Titan ISP Block, Global Distributed Swit= ch Controller. + + power-domains-names: + items: + - const: ife0 + - const: ife1 + - const: ife2 + - const: top + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + description: + CSI input ports. + + properties: + port@0: + $ref: /schemas/graph.yaml#/$defs/port-base + unevaluatedProperties: false + description: + Input port for receiving CSI data. + + properties: + endpoint: + $ref: video-interfaces.yaml# + unevaluatedProperties: false + + properties: + data-lanes: + minItems: 1 + maxItems: 4 + + required: + - data-lanes + + port@1: + $ref: /schemas/graph.yaml#/$defs/port-base + unevaluatedProperties: false + description: + Input port for receiving CSI data. + + properties: + endpoint: + $ref: video-interfaces.yaml# + unevaluatedProperties: false + + properties: + data-lanes: + minItems: 1 + maxItems: 4 + + required: + - data-lanes + + port@2: + $ref: /schemas/graph.yaml#/$defs/port-base + unevaluatedProperties: false + description: + Input port for receiving CSI data. + + properties: + endpoint: + $ref: video-interfaces.yaml# + unevaluatedProperties: false + + properties: + data-lanes: + minItems: 1 + maxItems: 4 + + required: + - data-lanes + + port@3: + $ref: /schemas/graph.yaml#/$defs/port-base + unevaluatedProperties: false + description: + Input port for receiving CSI data. + + properties: + endpoint: + $ref: video-interfaces.yaml# + unevaluatedProperties: false + + properties: + data-lanes: + minItems: 1 + maxItems: 4 + + required: + - data-lanes + + port@4: + $ref: /schemas/graph.yaml#/$defs/port-base + unevaluatedProperties: false + description: + Input port for receiving CSI data. + + properties: + endpoint: + $ref: video-interfaces.yaml# + unevaluatedProperties: false + + properties: + data-lanes: + minItems: 1 + maxItems: 4 + + required: + - data-lanes + + port@5: + $ref: /schemas/graph.yaml#/$defs/port-base + unevaluatedProperties: false + description: + Input port for receiving CSI data. + + properties: + endpoint: + $ref: video-interfaces.yaml# + unevaluatedProperties: false + + properties: + data-lanes: + minItems: 1 + maxItems: 4 + + required: + - data-lanes + + reg: + maxItems: 15 + + reg-names: + items: + - const: csid0 + - const: csid1 + - const: csid2 + - const: csid_lite0 + - const: csid_lite1 + - const: csiphy0 + - const: csiphy1 + - const: csiphy2 + - const: csiphy3 + - const: csiphy4 + - const: vfe0 + - const: vfe1 + - const: vfe2 + - const: vfe_lite0 + - const: vfe_lite1 + + vdda-phy-supply: + description: + Phandle to a regulator supply to PHY core block. + + vdda-pll-supply: + description: + Phandle to 1.8V regulator supply to PHY refclk pll block. + +required: + - clock-names + - clocks + - compatible + - interconnects + - interconnect-names + - interrupts + - interrupt-names + - iommus + - power-domains + - power-domains-names + - reg + - reg-names + - vdda-phy-supply + - vdda-pll-supply + +additionalProperties: false + +examples: + - | + #include + #include + #include + #include + #include + + soc { + #address-cells =3D <2>; + #size-cells =3D <2>; + + camss: camss@acaf000 { + compatible =3D "qcom,sc7280-camss"; + + clocks =3D <&clock_camcc CAM_CC_CAMNOC_AXI_CLK>, + <&clock_camcc CAM_CC_IFE_0_CSID_CLK>, + <&clock_camcc CAM_CC_IFE_1_CSID_CLK>, + <&clock_camcc CAM_CC_IFE_2_CSID_CLK>, + <&clock_camcc CAM_CC_IFE_LITE_0_CSID_CLK>, + <&clock_camcc CAM_CC_IFE_LITE_1_CSID_CLK>, + <&clock_camcc CAM_CC_CSIPHY0_CLK>, + <&clock_camcc CAM_CC_CSI0PHYTIMER_CLK>, + <&clock_camcc CAM_CC_CSIPHY1_CLK>, + <&clock_camcc CAM_CC_CSI1PHYTIMER_CLK>, + <&clock_camcc CAM_CC_CSIPHY2_CLK>, + <&clock_camcc CAM_CC_CSI2PHYTIMER_CLK>, + <&clock_camcc CAM_CC_CSIPHY3_CLK>, + <&clock_camcc CAM_CC_CSI3PHYTIMER_CLK>, + <&clock_camcc CAM_CC_CSIPHY4_CLK>, + <&clock_camcc CAM_CC_CSI4PHYTIMER_CLK>, + <&gcc GCC_CAMERA_AHB_CLK>, + <&gcc GCC_CAMERA_HF_AXI_CLK>, + <&clock_camcc CAM_CC_CPAS_AHB_CLK>, + <&clock_camcc CAM_CC_IFE_0_AXI_CLK>, + <&clock_camcc CAM_CC_IFE_0_CLK>, + <&clock_camcc CAM_CC_IFE_0_CPHY_RX_CLK>, + <&clock_camcc CAM_CC_IFE_1_AXI_CLK>, + <&clock_camcc CAM_CC_IFE_1_CLK>, + <&clock_camcc CAM_CC_IFE_1_CPHY_RX_CLK>, + <&clock_camcc CAM_CC_IFE_2_AXI_CLK>, + <&clock_camcc CAM_CC_IFE_2_CLK>, + <&clock_camcc CAM_CC_IFE_2_CPHY_RX_CLK>, + <&clock_camcc CAM_CC_IFE_LITE_0_CLK>, + <&clock_camcc CAM_CC_IFE_LITE_0_CPHY_RX_CLK>, + <&clock_camcc CAM_CC_IFE_LITE_1_CLK>, + <&clock_camcc CAM_CC_IFE_LITE_1_CPHY_RX_CLK>; + + clock-names =3D "camnoc_axi", + "csi0", + "csi1", + "csi2", + "csi3", + "csi4", + "csiphy0", + "csiphy0_timer", + "csiphy1", + "csiphy1_timer", + "csiphy2", + "csiphy2_timer", + "csiphy3", + "csiphy3_timer", + "csiphy4", + "csiphy4_timer", + "gcc_camera_ahb", + "gcc_camera_axi", + "soc_ahb", + "vfe0_axi", + "vfe0", + "vfe0_cphy_rx", + "vfe1_axi", + "vfe1", + "vfe1_cphy_rx", + "vfe2_axi", + "vfe2", + "vfe2_cphy_rx", + "vfe0_lite", + "vfe0_lite_cphy_rx", + "vfe1_lite", + "vfe1_lite_cphy_rx"; + + interconnects =3D <&gem_noc MASTER_APPSS_PROC 0 &cnoc2 SLAVE_C= AMERA_CFG 0>, + <&mmss_noc MASTER_CAMNOC_HF 0 &mc_virt SLAVE_E= BI1 0>; + + interconnect-names =3D "ahb", "hf_0"; + + interrupts =3D , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + + interrupt-names =3D "csid0", + "csid1", + "csid2", + "csid_lite0", + "csid_lite1", + "csiphy0", + "csiphy1", + "csiphy2", + "csiphy3", + "csiphy4", + "vfe0", + "vfe1", + "vfe2", + "vfe_lite0", + "vfe_lite1"; + + iommus =3D <&apps_smmu 0x800 0x4e0>; + + power-domains =3D <&camcc CAM_CC_IFE_0_GDSC>, + <&camcc CAM_CC_IFE_1_GDSC>, + <&camcc CAM_CC_IFE_2_GDSC>, + <&camcc CAM_CC_TITAN_TOP_GDSC>; + + power-domains-names =3D "ife0", "ife1", "ife2", "top"; + + reg =3D <0x0 0x0acb3000 0x0 0x1000>, + <0x0 0x0acba000 0x0 0x1000>, + <0x0 0x0acc1000 0x0 0x1000>, + <0x0 0x0acc8000 0x0 0x1000>, + <0x0 0x0accf000 0x0 0x1000>, + <0x0 0x0ace0000 0x0 0x2000>, + <0x0 0x0ace2000 0x0 0x2000>, + <0x0 0x0ace4000 0x0 0x2000>, + <0x0 0x0ace6000 0x0 0x2000>, + <0x0 0x0ace8000 0x0 0x2000>, + <0x0 0x0acaf000 0x0 0x4000>, + <0x0 0x0acb6000 0x0 0x4000>, + <0x0 0x0acbd000 0x0 0x4000>, + <0x0 0x0acc4000 0x0 0x4000>, + <0x0 0x0accb000 0x0 0x4000>; + + reg-names =3D "csid0", + "csid1", + "csid2", + "csid_lite0", + "csid_lite1", + "csiphy0", + "csiphy1", + "csiphy2", + "csiphy3", + "csiphy4", + "vfe0", + "vfe1", + "vfe2", + "vfe_lite0", + "vfe_lite1"; + + vdda-phy-supply =3D <&vreg_l10c_0p88>; + vdda-pll-supply =3D <&vreg_l6b_1p2>; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + }; + }; + }; --=20 2.25.1 From nobody Mon Nov 25 02:31:45 2024 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1769B1E3DEC; Wed, 30 Oct 2024 10:54:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730285688; cv=none; b=BpIzUXBlLE42sJ/C5Pnrrkb4UpbVNR79GmklMbxohpXLsB6+guOe1gwaknqKVZRRXvwHRKTCSpOrAZ0oMmIOmiX8qhZJ6rBAgNU6yoDeGj/bJcSPtiCvPb1/bxhO3dMZfhpcDQhn5kI2XMOFzxhYOu89AbWq6QzYaSSGSJDemlo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730285688; c=relaxed/simple; bh=emPUvFrFXkDopSdcqNjR5Kvbp8S1Qe7u/dQgK8JwJD8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tPWNw67losbDHjGNZHBW4fRESJNBfuq6hliEYY0FjbTiu0ggeomwl/8gjkxm8O0Pz2RaxQJ0VE/nKDAYfrmxBwv345AXCBEUvGs/jzHjh5U8f7TnKfF7TJ/QI5VzHhmDLZsHR0qye09E128uJKkwFYPPwD9t1xUualz6igul1iI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=Tnoh7md5; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Tnoh7md5" 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 49U5FgMQ027398; Wed, 30 Oct 2024 10:54:32 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= UrmOgvd2ceRG8Y7uibtKUk24yS8TIwwaTKhvVRRaeuI=; b=Tnoh7md5jBteXjva eY7m+cTMahmBvmmyBdSZVItR3aeu5bObZqpX+ijmAe3CoPfw/nK6qdp5HvarEr5q s6e5iL4Mr7maFHjqaWUhLXU5ysS+PVHM6Rt05qetbMncdme6QVRSDc/I4Zx95Qs7 f27Vo3eObHP2h66yFqKXq+4MVKOPFY0agjFtEk5XUGLYEcxWPiwCvYkbQzMnP4a5 wg0dy9dbxu8JKr26M/nVy6f5YahCtRyDJ1gDAIE9JSw/4KpRa83whPvjolXsH//w Gg4rL5J0I4pO7wA/iTgSQ94U5UXtjJxPqbzFrfGj9LRcwvOhDdk1+dDmyGZZD8sC chFuHw== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42k1p330mx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Oct 2024 10:54:31 +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 49UAsUZ5015557 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Oct 2024 10:54:30 GMT Received: from hu-vikramsa-hyd.qualcomm.com (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, 30 Oct 2024 03:54:21 -0700 From: Vikram Sharma To: , , , , , , , , , , , , , , CC: , , , , , , Subject: [PATCH v4 2/6] media: qcom: camss: Sort CAMSS version enums and compatible strings Date: Wed, 30 Oct 2024 16:23:43 +0530 Message-ID: <20241030105347.2117034-3-quic_vikramsa@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241030105347.2117034-1-quic_vikramsa@quicinc.com> References: <20241030105347.2117034-1-quic_vikramsa@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: GsQRDTPCc9ytlV9Di90RyfcRwUSLZOzI X-Proofpoint-ORIG-GUID: GsQRDTPCc9ytlV9Di90RyfcRwUSLZOzI 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-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 spamscore=0 lowpriorityscore=0 mlxscore=0 malwarescore=0 phishscore=0 clxscore=1011 impostorscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410300084 Content-Type: text/plain; charset="utf-8" Sort CAMSS version enums and compatible strings alphanumerically. Signed-off-by: Suresh Vankadara Signed-off-by: Trishansh Bhardwaj Signed-off-by: Vikram Sharma --- .../media/platform/qcom/camss/camss-csiphy-3ph-1-0.c | 10 +++++----- drivers/media/platform/qcom/camss/camss-vfe.c | 6 +++--- drivers/media/platform/qcom/camss/camss.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/dri= vers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c index df7e93a5a4f6..7d2490c9de01 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c @@ -505,10 +505,6 @@ static void csiphy_gen2_config_lanes(struct csiphy_dev= ice *csiphy, u32 val; =20 switch (csiphy->camss->res->version) { - case CAMSS_845: - r =3D &lane_regs_sdm845[0][0]; - array_size =3D ARRAY_SIZE(lane_regs_sdm845[0]); - break; case CAMSS_8250: r =3D &lane_regs_sm8250[0][0]; array_size =3D ARRAY_SIZE(lane_regs_sm8250[0]); @@ -517,6 +513,10 @@ static void csiphy_gen2_config_lanes(struct csiphy_dev= ice *csiphy, r =3D &lane_regs_sc8280xp[0][0]; array_size =3D ARRAY_SIZE(lane_regs_sc8280xp[0]); break; + case CAMSS_845: + r =3D &lane_regs_sdm845[0][0]; + array_size =3D ARRAY_SIZE(lane_regs_sdm845[0]); + break; default: WARN(1, "unknown cspi version\n"); return; @@ -557,9 +557,9 @@ static bool csiphy_is_gen2(u32 version) bool ret =3D false; =20 switch (version) { - case CAMSS_845: case CAMSS_8250: case CAMSS_8280XP: + case CAMSS_845: ret =3D true; break; } diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/= platform/qcom/camss/camss-vfe.c index 83c5a36d071f..ffcb1e2ec417 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -333,11 +333,11 @@ static u32 vfe_src_pad_code(struct vfe_line *line, u3= 2 sink_code, return sink_code; } break; - case CAMSS_8x96: case CAMSS_660: - case CAMSS_845: + case CAMSS_8x96: case CAMSS_8250: case CAMSS_8280XP: + case CAMSS_845: switch (sink_code) { case MEDIA_BUS_FMT_YUYV8_1X16: { @@ -1692,9 +1692,9 @@ static int vfe_bpl_align(struct vfe_device *vfe) int ret =3D 8; =20 switch (vfe->camss->res->version) { - case CAMSS_845: case CAMSS_8250: case CAMSS_8280XP: + case CAMSS_845: ret =3D 16; break; default: diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/plat= form/qcom/camss/camss.c index fabe034081ed..e8cd8afe7bee 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -2456,10 +2456,10 @@ static const struct camss_resources sc8280xp_resour= ces =3D { static const struct of_device_id camss_dt_match[] =3D { { .compatible =3D "qcom,msm8916-camss", .data =3D &msm8916_resources }, { .compatible =3D "qcom,msm8996-camss", .data =3D &msm8996_resources }, + { .compatible =3D "qcom,sc8280xp-camss", .data =3D &sc8280xp_resources }, { .compatible =3D "qcom,sdm660-camss", .data =3D &sdm660_resources }, { .compatible =3D "qcom,sdm845-camss", .data =3D &sdm845_resources }, { .compatible =3D "qcom,sm8250-camss", .data =3D &sm8250_resources }, - { .compatible =3D "qcom,sc8280xp-camss", .data =3D &sc8280xp_resources }, { } }; =20 --=20 2.25.1 From nobody Mon Nov 25 02:31:45 2024 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBFD91E47C8; Wed, 30 Oct 2024 10:55:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730285711; cv=none; b=Jw7j7zsVYwaoVIWXa4miHdvn73iKSpLTgHRK5cdiCsPvM/CEGFF8m9trAG1L+1uWSkCWz0JvwAhRNCYx+4V3I+JP/l8Xa5s6w3RyFoPKh3wRhw/ZVNKA/Rs2A+WQiWUymCx/mtdyPjqUm9KeNYnr3fXhakxXnqtBTcim3C+set8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730285711; c=relaxed/simple; bh=yJc3XDZKxX+oy5Bi1bFFAAjHnPjBAMdHUStNVkI0zVo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=l8JgumX5Uhp/LP04nh7bTr2HRz4oMoBy2Aw55lFu0NywOv6fKzPPXs0FTPAGSVcuUbMftvfGTklzM+a9NjFzATLOzlB8HEDSpAs2pqQvkn+7kNyOyycMAZ1AAVldb29HymkIj6whgwnJdHlI/muTIrCAyjHN5Zq2YYTy4xXnzd4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=AP7S6t5K; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="AP7S6t5K" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49U0p37x007486; Wed, 30 Oct 2024 10:54:58 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= dWmRc5thpgh0rpNmE86OJV830oFwHtoNbQnsFtu6Tr4=; b=AP7S6t5KfyW/ZUo8 sxl6owXr9VkKlXxuwgsxVkxvq5MpM79DcwU4QmLVn0XVQ8UPDWrjo8AeNbA5nwdo 83NFwmTuF429o0CCYYLuvz1CwxfCSRki3gJ5yAROFWHCl5/DG3FinyebhdEYPohW GG94pT5ufjrm5TMy9j1kbUAjewRdPz7PV16jUgjg0DgNU2YWmt7N1i5074cz7mOJ oH2upXZ8ixNcal1ymxB8B/X5Ed1WypszC/2RT7ZjLa4KzRJ1ZNsvw6pZo+Dn/+hb +WSAwVka2l9teoVJjYLTlzrtDyNTAQfoRPYUvEK7eknhsnoA85hopcQhU4W82kan 7VSjig== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42gqe63ma9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Oct 2024 10:54:57 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49UAsbqO002568 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Oct 2024 10:54:37 GMT Received: from hu-vikramsa-hyd.qualcomm.com (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, 30 Oct 2024 03:54:28 -0700 From: Vikram Sharma To: , , , , , , , , , , , , , , CC: , , , , , , Subject: [PATCH v4 3/6] media: qcom: camss: Add support for camss driver on SC7280 Date: Wed, 30 Oct 2024 16:23:44 +0530 Message-ID: <20241030105347.2117034-4-quic_vikramsa@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241030105347.2117034-1-quic_vikramsa@quicinc.com> References: <20241030105347.2117034-1-quic_vikramsa@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: D38zbpDQ2-Pmj8PXO8YgkVCS2UM2-Fy2 X-Proofpoint-ORIG-GUID: D38zbpDQ2-Pmj8PXO8YgkVCS2UM2-Fy2 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-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 priorityscore=1501 impostorscore=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410300085 Content-Type: text/plain; charset="utf-8" From: Suresh Vankadara Add support for the camss driver on the SC7280 SoC. Signed-off-by: Suresh Vankadara Signed-off-by: Trishansh Bhardwaj Signed-off-by: Vikram Sharma Reviewed-by: Bryan O'Donoghue --- .../media/platform/qcom/camss/camss-csid.c | 1 - .../qcom/camss/camss-csiphy-3ph-1-0.c | 5 + .../media/platform/qcom/camss/camss-csiphy.c | 5 + .../media/platform/qcom/camss/camss-csiphy.h | 1 + drivers/media/platform/qcom/camss/camss-vfe.c | 2 + drivers/media/platform/qcom/camss/camss.c | 339 ++++++++++++++++++ drivers/media/platform/qcom/camss/camss.h | 1 + 7 files changed, 353 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media= /platform/qcom/camss/camss-csid.c index 858db5d4ca75..8d3dc26e2af4 100644 --- a/drivers/media/platform/qcom/camss/camss-csid.c +++ b/drivers/media/platform/qcom/camss/camss-csid.c @@ -1028,7 +1028,6 @@ int msm_csid_subdev_init(struct camss *camss, struct = csid_device *csid, csid->res->hw_ops->subdev_init(csid); =20 /* Memory */ - if (camss->res->version =3D=3D CAMSS_8250) { /* for titan 480, CSID registers are inside the VFE region, * between the VFE "top" and "bus" registers. this requires diff --git a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c b/dri= vers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c index 7d2490c9de01..f341f7b7fd8a 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy-3ph-1-0.c @@ -505,6 +505,10 @@ static void csiphy_gen2_config_lanes(struct csiphy_dev= ice *csiphy, u32 val; =20 switch (csiphy->camss->res->version) { + case CAMSS_7280: + r =3D &lane_regs_sm8250[0][0]; + array_size =3D ARRAY_SIZE(lane_regs_sm8250[0]); + break; case CAMSS_8250: r =3D &lane_regs_sm8250[0][0]; array_size =3D ARRAY_SIZE(lane_regs_sm8250[0]); @@ -557,6 +561,7 @@ static bool csiphy_is_gen2(u32 version) bool ret =3D false; =20 switch (version) { + case CAMSS_7280: case CAMSS_8250: case CAMSS_8280XP: case CAMSS_845: diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/med= ia/platform/qcom/camss/camss-csiphy.c index 68a3ea1ba2a5..9722cee4143f 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c @@ -108,6 +108,11 @@ const struct csiphy_formats csiphy_formats_sdm845 =3D { .formats =3D formats_sdm845 }; =20 +const struct csiphy_formats csiphy_formats_sc7280 =3D { + .nformats =3D ARRAY_SIZE(formats_sdm845), + .formats =3D formats_sdm845 +}; + /* * csiphy_get_bpp - map media bus format to bits per pixel * @formats: supported media bus formats array diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.h b/drivers/med= ia/platform/qcom/camss/camss-csiphy.h index eebc1ff1cfab..67a96ef55bb6 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.h +++ b/drivers/media/platform/qcom/camss/camss-csiphy.h @@ -112,6 +112,7 @@ void msm_csiphy_unregister_entity(struct csiphy_device = *csiphy); extern const struct csiphy_formats csiphy_formats_8x16; extern const struct csiphy_formats csiphy_formats_8x96; extern const struct csiphy_formats csiphy_formats_sdm845; +extern const struct csiphy_formats csiphy_formats_sc7280; =20 extern const struct csiphy_hw_ops csiphy_ops_2ph_1_0; extern const struct csiphy_hw_ops csiphy_ops_3ph_1_0; diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/= platform/qcom/camss/camss-vfe.c index ffcb1e2ec417..61f6815a3756 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -334,6 +334,7 @@ static u32 vfe_src_pad_code(struct vfe_line *line, u32 = sink_code, } break; case CAMSS_660: + case CAMSS_7280: case CAMSS_8x96: case CAMSS_8250: case CAMSS_8280XP: @@ -1692,6 +1693,7 @@ static int vfe_bpl_align(struct vfe_device *vfe) int ret =3D 8; =20 switch (vfe->camss->res->version) { + case CAMSS_7280: case CAMSS_8250: case CAMSS_8280XP: case CAMSS_845: diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/plat= form/qcom/camss/camss.c index e8cd8afe7bee..addaed8f77cb 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -1480,6 +1480,330 @@ static const struct resources_icc icc_res_sc8280xp[= ] =3D { }, }; =20 +static const struct camss_subdev_resources csiphy_res_7280[] =3D { + /* CSIPHY0 */ + { + .regulators =3D {}, + .clock =3D { "csiphy0", "csiphy0_timer"}, + .clock_rate =3D { + { 300000000 }, + { 300000000 } + }, + .reg =3D { "csiphy0" }, + .interrupt =3D { "csiphy0" }, + .csiphy =3D { + .hw_ops =3D &csiphy_ops_3ph_1_0, + .formats =3D &csiphy_formats_sc7280 + } + }, + /* CSIPHY1 */ + { + .regulators =3D {}, + .clock =3D { "csiphy1", "csiphy1_timer"}, + .clock_rate =3D { + { 300000000 }, + { 300000000 } + }, + .reg =3D { "csiphy1" }, + .interrupt =3D { "csiphy1" }, + .csiphy =3D { + .hw_ops =3D &csiphy_ops_3ph_1_0, + .formats =3D &csiphy_formats_sc7280 + } + }, + /* CSIPHY2 */ + { + .regulators =3D {}, + .clock =3D { "csiphy2", "csiphy2_timer"}, + .clock_rate =3D { + { 300000000 }, + { 300000000 } + }, + .reg =3D { "csiphy2" }, + .interrupt =3D { "csiphy2" }, + .csiphy =3D { + .hw_ops =3D &csiphy_ops_3ph_1_0, + .formats =3D &csiphy_formats_sc7280 + } + }, + /* CSIPHY3 */ + { + .regulators =3D {}, + .clock =3D { "csiphy3", "csiphy3_timer"}, + .clock_rate =3D { + { 300000000 }, + { 300000000 } + }, + .reg =3D { "csiphy3" }, + .interrupt =3D { "csiphy3" }, + .csiphy =3D { + .hw_ops =3D &csiphy_ops_3ph_1_0, + .formats =3D &csiphy_formats_sc7280 + } + }, + /* CSIPHY4 */ + { + .regulators =3D {}, + .clock =3D { "csiphy4", "csiphy4_timer"}, + .clock_rate =3D { + { 300000000 }, + { 300000000 } + }, + .reg =3D { "csiphy4" }, + .interrupt =3D { "csiphy4" }, + .csiphy =3D { + .hw_ops =3D &csiphy_ops_3ph_1_0, + .formats =3D &csiphy_formats_sc7280 + } + }, +}; + +static const struct camss_subdev_resources csid_res_7280[] =3D { + /* CSID0 */ + { + .regulators =3D { "vdda-phy", "vdda-pll" }, + + .clock =3D { "csi0", "vfe0_cphy_rx", "vfe0", "soc_ahb"}, + .clock_rate =3D { + { 300000000, 0, 380000000, 0}, + { 400000000, 0, 510000000, 0}, + { 400000000, 0, 637000000, 0}, + { 400000000, 0, 760000000, 0} + }, + + .reg =3D { "csid0" }, + .interrupt =3D { "csid0" }, + .csid =3D { + .is_lite =3D false, + .hw_ops =3D &csid_ops_gen2, + .parent_dev_ops =3D &vfe_parent_dev_ops, + .formats =3D &csid_formats_gen2 + } + }, + /* CSID1 */ + { + .regulators =3D { "vdda-phy", "vdda-pll" }, + + .clock =3D { "csi1", "vfe1_cphy_rx", "vfe1", "soc_ahb"}, + .clock_rate =3D { + { 300000000, 0, 380000000, 0}, + { 400000000, 0, 510000000, 0}, + { 400000000, 0, 637000000, 0}, + { 400000000, 0, 760000000, 0} + }, + + .reg =3D { "csid1" }, + .interrupt =3D { "csid1" }, + .csid =3D { + .is_lite =3D false, + .hw_ops =3D &csid_ops_gen2, + .parent_dev_ops =3D &vfe_parent_dev_ops, + .formats =3D &csid_formats_gen2 + } + }, + /* CSID2 */ + { + .regulators =3D { "vdda-phy", "vdda-pll" }, + + .clock =3D { "csi2", "vfe2_cphy_rx", "vfe2", "soc_ahb"}, + .clock_rate =3D { + { 300000000, 0, 380000000, 0}, + { 400000000, 0, 510000000, 0}, + { 400000000, 0, 637000000, 0}, + { 400000000, 0, 760000000, 0} + }, + + .reg =3D { "csid2" }, + .interrupt =3D { "csid2" }, + .csid =3D { + .is_lite =3D false, + .hw_ops =3D &csid_ops_gen2, + .parent_dev_ops =3D &vfe_parent_dev_ops, + .formats =3D &csid_formats_gen2 + } + }, + /* CSID3 */ + { + .regulators =3D { "vdda-phy", "vdda-pll" }, + + .clock =3D { "csi3", "vfe0_lite_cphy_rx", "vfe0_lite", "soc_ahb"}, + .clock_rate =3D { + { 300000000, 0, 320000000, 0}, + { 400000000, 0, 400000000, 0}, + { 400000000, 0, 480000000, 0}, + { 400000000, 0, 600000000, 0} + }, + + .reg =3D { "csid_lite0" }, + .interrupt =3D { "csid_lite0" }, + .csid =3D { + .is_lite =3D true, + .hw_ops =3D &csid_ops_gen2, + .parent_dev_ops =3D &vfe_parent_dev_ops, + .formats =3D &csid_formats_gen2 + } + }, + /* CSID4 */ + { + .regulators =3D { "vdda-phy", "vdda-pll" }, + + .clock =3D { "csi3", "vfe0_lite_cphy_rx", "vfe0_lite", "soc_ahb"}, + .clock_rate =3D { + { 300000000, 0, 320000000, 0}, + { 400000000, 0, 400000000, 0}, + { 400000000, 0, 480000000, 0}, + { 400000000, 0, 600000000, 0} + }, + + .reg =3D { "csid_lite1" }, + .interrupt =3D { "csid_lite1" }, + .csid =3D { + .is_lite =3D true, + .hw_ops =3D &csid_ops_gen2, + .parent_dev_ops =3D &vfe_parent_dev_ops, + .formats =3D &csid_formats_gen2 + } + }, +}; + +static const struct camss_subdev_resources vfe_res_7280[] =3D { + /* VFE0 */ + { + .regulators =3D {}, + + .clock =3D { "vfe0", "vfe0_axi", "soc_ahb", + "camnoc_axi", "gcc_camera_axi"}, + .clock_rate =3D { + { 380000000, 0, 80000000, 150000000, 0}, + { 510000000, 0, 80000000, 240000000, 0}, + { 637000000, 0, 80000000, 320000000, 0}, + { 760000000, 0, 80000000, 400000000, 0}, + { 760000000, 0, 80000000, 480000000, 0}, + }, + + .reg =3D { "vfe0" }, + .interrupt =3D { "vfe0" }, + .vfe =3D { + .line_num =3D 3, + .is_lite =3D false, + .has_pd =3D true, + .pd_name =3D "ife0", + .hw_ops =3D &vfe_ops_170, + .formats_rdi =3D &vfe_formats_rdi_845, + .formats_pix =3D &vfe_formats_pix_845 + } + }, + /* VFE1 */ + { + .regulators =3D {}, + + .clock =3D { "vfe1", "vfe1_axi", "soc_ahb", + "camnoc_axi", "gcc_camera_axi"}, + .clock_rate =3D { + { 380000000, 0, 80000000, 150000000, 0}, + { 510000000, 0, 80000000, 240000000, 0}, + { 637000000, 0, 80000000, 320000000, 0}, + { 760000000, 0, 80000000, 400000000, 0}, + { 760000000, 0, 80000000, 480000000, 0}, + }, + + .reg =3D { "vfe1" }, + .interrupt =3D { "vfe1" }, + .vfe =3D { + .line_num =3D 3, + .is_lite =3D false, + .has_pd =3D true, + .pd_name =3D "ife1", + .hw_ops =3D &vfe_ops_170, + .formats_rdi =3D &vfe_formats_rdi_845, + .formats_pix =3D &vfe_formats_pix_845 + } + }, + /* VFE2 */ + { + .regulators =3D {}, + + .clock =3D { "vfe2", "vfe2_axi", "soc_ahb", + "camnoc_axi", "gcc_camera_axi"}, + .clock_rate =3D { + { 380000000, 0, 80000000, 150000000, 0}, + { 510000000, 0, 80000000, 240000000, 0}, + { 637000000, 0, 80000000, 320000000, 0}, + { 760000000, 0, 80000000, 400000000, 0}, + { 760000000, 0, 80000000, 480000000, 0}, + }, + + .reg =3D { "vfe2" }, + .interrupt =3D { "vfe2" }, + .vfe =3D { + .line_num =3D 3, + .is_lite =3D false, + .hw_ops =3D &vfe_ops_170, + .has_pd =3D true, + .pd_name =3D "ife2", + .formats_rdi =3D &vfe_formats_rdi_845, + .formats_pix =3D &vfe_formats_pix_845 + } + }, + /* VFE3 (lite) */ + { + .clock =3D { "vfe0_lite", "soc_ahb", + "camnoc_axi", "gcc_camera_axi"}, + .clock_rate =3D { + { 320000000, 80000000, 150000000, 0}, + { 400000000, 80000000, 240000000, 0}, + { 480000000, 80000000, 320000000, 0}, + { 600000000, 80000000, 400000000, 0}, + }, + + .regulators =3D {}, + .reg =3D { "vfe_lite0" }, + .interrupt =3D { "vfe_lite0" }, + .vfe =3D { + .line_num =3D 4, + .is_lite =3D true, + .hw_ops =3D &vfe_ops_170, + .formats_rdi =3D &vfe_formats_rdi_845, + .formats_pix =3D &vfe_formats_pix_845 + } + }, + /* VFE4 (lite) */ + { + .clock =3D { "vfe1_lite", "soc_ahb", + "camnoc_axi", "gcc_camera_axi"}, + .clock_rate =3D { + { 320000000, 80000000, 150000000, 0}, + { 400000000, 80000000, 240000000, 0}, + { 480000000, 80000000, 320000000, 0}, + { 600000000, 80000000, 400000000, 0}, + }, + + .regulators =3D {}, + .reg =3D { "vfe_lite1" }, + .interrupt =3D { "vfe_lite1" }, + .vfe =3D { + .line_num =3D 4, + .is_lite =3D true, + .hw_ops =3D &vfe_ops_170, + .formats_rdi =3D &vfe_formats_rdi_845, + .formats_pix =3D &vfe_formats_pix_845 + } + }, +}; + +static const struct resources_icc icc_res_sc7280[] =3D { + { + .name =3D "ahb", + .icc_bw_tbl.avg =3D 38400, + .icc_bw_tbl.peak =3D 76800, + }, + { + .name =3D "hf_0", + .icc_bw_tbl.avg =3D 2097152, + .icc_bw_tbl.peak =3D 2097152, + }, +}; + /* * camss_add_clock_margin - Add margin to clock frequency rate * @rate: Clock frequency rate @@ -2453,9 +2777,24 @@ static const struct camss_resources sc8280xp_resourc= es =3D { .link_entities =3D camss_link_entities }; =20 +static const struct camss_resources sc7280_resources =3D { + .version =3D CAMSS_7280, + .pd_name =3D "top", + .csiphy_res =3D csiphy_res_7280, + .csid_res =3D csid_res_7280, + .vfe_res =3D vfe_res_7280, + .icc_res =3D icc_res_sc7280, + .icc_path_num =3D ARRAY_SIZE(icc_res_sc7280), + .csiphy_num =3D ARRAY_SIZE(csiphy_res_7280), + .csid_num =3D ARRAY_SIZE(csid_res_7280), + .vfe_num =3D ARRAY_SIZE(vfe_res_7280), + .link_entities =3D camss_link_entities +}; + static const struct of_device_id camss_dt_match[] =3D { { .compatible =3D "qcom,msm8916-camss", .data =3D &msm8916_resources }, { .compatible =3D "qcom,msm8996-camss", .data =3D &msm8996_resources }, + { .compatible =3D "qcom,sc7280-camss", .data =3D &sc7280_resources }, { .compatible =3D "qcom,sc8280xp-camss", .data =3D &sc8280xp_resources }, { .compatible =3D "qcom,sdm660-camss", .data =3D &sdm660_resources }, { .compatible =3D "qcom,sdm845-camss", .data =3D &sdm845_resources }, diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/plat= form/qcom/camss/camss.h index 0ce84fcbbd25..bbdf9aa81c36 100644 --- a/drivers/media/platform/qcom/camss/camss.h +++ b/drivers/media/platform/qcom/camss/camss.h @@ -80,6 +80,7 @@ enum camss_version { CAMSS_8x16, CAMSS_8x96, CAMSS_660, + CAMSS_7280, CAMSS_845, CAMSS_8250, CAMSS_8280XP, --=20 2.25.1 From nobody Mon Nov 25 02:31:45 2024 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19B451E3DC2; Wed, 30 Oct 2024 10:55:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730285712; cv=none; b=AtA/xClSzqiFAyv2kZBpZ1P6NmryWo1BhA5a5FEyMqavNG39Rmq65R9qp/zn52TdCosHD2j0vm5UlEaRADHbQZn/m3brMKtBVLBOs1ySBWogjJ5mH30faWo4aZaayh1+oT+nxh3FPhhvrJbVOKB+Z80VVluMq8cFLUhu/9g16rE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730285712; c=relaxed/simple; bh=4970G2JLY/yzGIbEwrD7SWDYKmUoDtwqKKkJex9Azqc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nPK3Th/1E3wVwEM1dKBhRDHLkkdT/IkihAQjqMusksGlMTgvYvxfj1ThF4MmJ6vdu4kYcdZ+p0iag0Bdvfsr0RYdlZg5UalMBtJb/pZM/iFfRLXqwOQy+q5olyEGtIEHVv8OKx8RKkmP/rzmxXjvjsWlwVYedkh+UqtkGScYJQY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=WxCgFdtX; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="WxCgFdtX" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49U8tGkq007057; Wed, 30 Oct 2024 10:54:58 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= AHsXIlovFdhS9IXQtuxtH5HCunRGdtFKg5ndk+ClhbU=; b=WxCgFdtXY9iXWDwa v/RqGYeUSN1OzOoSEDAtb/uMSTwH7x3Oo+b1NCvEhEeMZPqukRlSYmjLSVjHDBSt TCkTKC8JSO386KjpvH2uEIl501zh6a5PK9nv3jEOP0GxdYM63PqnW5QoVIWVkoFZ Ut3xpoUIuA9MqQAmivhPqw9a0Loq18eatFo9SIZ7rQzD51IQmsWB03px0+1uJ+ig Odp+7M37mmVufnbIJouEmtKy4e/Y4YgRTmu7whLp4ZC2FSzRWJlX7O8nrLIq7v2j fd/12jIWm/WvU7ZrZzRpodMJ8K/Y1UiEKM5cBif1IxsgvrhmrfFBJHfmTCiKmTQp Y6PWQw== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42khqbrbew-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Oct 2024 10:54:58 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49UAsh1H017410 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Oct 2024 10:54:43 GMT Received: from hu-vikramsa-hyd.qualcomm.com (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, 30 Oct 2024 03:54:34 -0700 From: Vikram Sharma To: , , , , , , , , , , , , , , CC: , , , , , , Subject: [PATCH v4 4/6] media: qcom: camss: Restructure camss_link_entities Date: Wed, 30 Oct 2024 16:23:45 +0530 Message-ID: <20241030105347.2117034-5-quic_vikramsa@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241030105347.2117034-1-quic_vikramsa@quicinc.com> References: <20241030105347.2117034-1-quic_vikramsa@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: Nw-zYhQzI6OalN1uwBK3DACL5E2k2FeU X-Proofpoint-ORIG-GUID: Nw-zYhQzI6OalN1uwBK3DACL5E2k2FeU 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-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=944 lowpriorityscore=0 bulkscore=0 adultscore=0 mlxscore=0 suspectscore=0 malwarescore=0 spamscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410300085 Content-Type: text/plain; charset="utf-8" Refactor the camss_link_entities function by breaking it down into three distinct functions. Each function will handle the linking of a specific entity separately, enhancing readability. Signed-off-by: Suresh Vankadara Signed-off-by: Trishansh Bhardwaj Signed-off-by: Vikram Sharma --- drivers/media/platform/qcom/camss/camss.c | 159 ++++++++++++++-------- 1 file changed, 105 insertions(+), 54 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/plat= form/qcom/camss/camss.c index addaed8f77cb..e4579ce80572 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -2164,14 +2164,66 @@ static int camss_init_subdevices(struct camss *cams= s) } =20 /* - * camss_link_entities - Register subdev nodes and create links + * camss_link_entities_csid - 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(struct camss *camss) +static int camss_link_entities_csid(struct camss *camss) { - int i, j, k; + int i, j; + int ret, line_num; + u16 src_pad; + u16 sink_pad; + struct media_entity *src_entity; + struct media_entity *sink_entity; + + for (i =3D 0; i < camss->res->csid_num; i++) { + if (camss->ispif) + line_num =3D camss->ispif->line_num; + else + line_num =3D camss->vfe[i].res->line_num; + + src_entity =3D &camss->csid[i].subdev.entity; + for (j =3D 0; j < line_num; j++) { + if (camss->ispif) { + sink_entity =3D &camss->ispif->line[j].subdev.entity; + src_pad =3D MSM_CSID_PAD_SRC; + sink_pad =3D MSM_ISPIF_PAD_SINK; + } else { + sink_entity =3D &camss->vfe[i].line[j].subdev.entity; + src_pad =3D MSM_CSID_PAD_FIRST_SRC + j; + sink_pad =3D MSM_VFE_PAD_SINK; + } + + ret =3D media_create_pad_link(src_entity, + src_pad, + sink_entity, + sink_pad, + 0); + if (ret < 0) { + dev_err(camss->dev, + "Failed to link %s->%s entities: %d\n", + src_entity->name, + sink_entity->name, + ret); + return ret; + } + } + } + + return 0; +} + +/* + * camss_link_entities_csiphy - 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_csiphy(struct camss *camss) +{ + int i, j; int ret; =20 for (i =3D 0; i < camss->res->csiphy_num; i++) { @@ -2192,71 +2244,70 @@ static int camss_link_entities(struct camss *camss) } } =20 - if (camss->ispif) { - for (i =3D 0; i < camss->res->csid_num; i++) { - for (j =3D 0; j < camss->ispif->line_num; j++) { - ret =3D media_create_pad_link(&camss->csid[i].subdev.entity, - MSM_CSID_PAD_SRC, - &camss->ispif->line[j].subdev.entity, - MSM_ISPIF_PAD_SINK, + return 0; +} + +/* + * camss_link_entities_ispif - 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_ispif(struct camss *camss) +{ + int i, j, k; + int ret; + + for (i =3D 0; i < camss->ispif->line_num; i++) { + for (k =3D 0; k < camss->res->vfe_num; k++) { + for (j =3D 0; j < camss->vfe[k].res->line_num; j++) { + struct v4l2_subdev *ispif =3D &camss->ispif->line[i].subdev; + struct v4l2_subdev *vfe =3D &camss->vfe[k].line[j].subdev; + + ret =3D media_create_pad_link(&ispif->entity, + MSM_ISPIF_PAD_SRC, + &vfe->entity, + MSM_VFE_PAD_SINK, 0); if (ret < 0) { dev_err(camss->dev, "Failed to link %s->%s entities: %d\n", - camss->csid[i].subdev.entity.name, - camss->ispif->line[j].subdev.entity.name, + ispif->entity.name, + vfe->entity.name, ret); return ret; } } } - - for (i =3D 0; i < camss->ispif->line_num; i++) - for (k =3D 0; k < camss->res->vfe_num; k++) - for (j =3D 0; j < camss->vfe[k].res->line_num; j++) { - struct v4l2_subdev *ispif =3D &camss->ispif->line[i].subdev; - struct v4l2_subdev *vfe =3D &camss->vfe[k].line[j].subdev; - - ret =3D media_create_pad_link(&ispif->entity, - MSM_ISPIF_PAD_SRC, - &vfe->entity, - MSM_VFE_PAD_SINK, - 0); - if (ret < 0) { - dev_err(camss->dev, - "Failed to link %s->%s entities: %d\n", - ispif->entity.name, - vfe->entity.name, - ret); - return ret; - } - } - } else { - for (i =3D 0; i < camss->res->csid_num; i++) - for (k =3D 0; k < camss->res->vfe_num; k++) - for (j =3D 0; j < camss->vfe[k].res->line_num; j++) { - struct v4l2_subdev *csid =3D &camss->csid[i].subdev; - struct v4l2_subdev *vfe =3D &camss->vfe[k].line[j].subdev; - - ret =3D 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; - } - } } =20 return 0; } =20 +/* + * camss_link_entities - 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(struct camss *camss) +{ + int ret; + + ret =3D camss_link_entities_csiphy(camss); + if (ret < 0) + return ret; + + ret =3D camss_link_entities_csid(camss); + if (ret < 0) + return ret; + + if (camss->ispif) + ret =3D camss_link_entities_ispif(camss); + + return ret; +} + /* * camss_register_entities - Register subdev nodes and create links * @camss: CAMSS device --=20 2.25.1 From nobody Mon Nov 25 02:31:46 2024 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF1891E32CB; Wed, 30 Oct 2024 10:55:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730285704; cv=none; b=cIjM41+kcN2P7kmLzegHuoOrqgd8rGx6LuQ4nAm3GfL6Fmp4kqHBammM9rTwvDzF/o/4bcX7e7Geavu0RFH7ScAcM1TG1foZvwTIyhWnQzg2K2LD7GUkDwoUTufl5D311PVsAlQeAC27qy4TtSsA/wYdO73KR4w90AEo0RFrrho= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730285704; c=relaxed/simple; bh=rySlbT60RUfazR0dHh8grpKpny7uM+6bK9VgKcwrgFA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fi6E4VKsv4hEf/QRHOs9LHKJsKSbCnlZtWiVw49w4tKPNnukK+040vD7eyigjyR1zYByCuOxbyyCJzSL1yjTuoFzcQlwUCQS+tYDWcWjTyhT4WNKk304mvx6d4HFwm/nFv4HLkjsZBwwA6WbEYYo1wAJSycV4pAFzennxDMJcEk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=bS7eIgKS; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="bS7eIgKS" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49UAJF9G009343; Wed, 30 Oct 2024 10:54:51 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= KsDUtU6BSw7BrBm5/NNJzK2vl5+53zJt7aGaWRg1Dyw=; b=bS7eIgKSubXp1sCI N6RhzbtitWtiVxZC4kgJyOI84yWmg4mU1dGTEK86Eodzl/4DvrHUlE3w25gDsVy/ q0FKy8tfnYo+UjuVgyHadL3NvNZy6itnd6/mvb3rEL1/UfCysm449+j+a6O0ygIn AaTgbRBQLJwZ5dZoz1fZ4QgnCH3/U7JHk5j32YHvwvfdpTMcEFDhmu1x7ULSzWld s4COKqOvaL+O4PHJvwFUqbe6Xjxlr4GjcCsz3xs6avjm2fIsIW7S6cw1gcQU11Y1 lWiIK5OE33+QwVs064Tz9Eb1kKHjHZ27xNIgpI40N/EWRm39Co/loADsGWdLYKBN mI+KoQ== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42grn53rcq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Oct 2024 10:54:51 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49UAsnAc002691 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Oct 2024 10:54:49 GMT Received: from hu-vikramsa-hyd.qualcomm.com (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, 30 Oct 2024 03:54:41 -0700 From: Vikram Sharma To: , , , , , , , , , , , , , , CC: , , , , , , Subject: [PATCH v4 5/6] arm64: dts: qcom: sc7280: Add support for camss Date: Wed, 30 Oct 2024 16:23:46 +0530 Message-ID: <20241030105347.2117034-6-quic_vikramsa@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241030105347.2117034-1-quic_vikramsa@quicinc.com> References: <20241030105347.2117034-1-quic_vikramsa@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: L-6r1TOSJlUw9QcutJzN9O-hNVN8d6Me X-Proofpoint-ORIG-GUID: L-6r1TOSJlUw9QcutJzN9O-hNVN8d6Me 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-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 mlxlogscore=999 malwarescore=0 clxscore=1015 bulkscore=0 suspectscore=0 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410300084 Content-Type: text/plain; charset="utf-8" Add changes to support the camera subsystem on the SC7280. Signed-off-by: Suresh Vankadara Signed-off-by: Trishansh Bhardwaj Signed-off-by: Vikram Sharma --- arch/arm64/boot/dts/qcom/sc7280.dtsi | 175 +++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qco= m/sc7280.dtsi index 55db1c83ef55..690051708dec 100644 --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi @@ -4426,6 +4426,181 @@ cci1_i2c1: i2c-bus@1 { }; }; =20 + camss: camss@acaf000 { + compatible =3D "qcom,sc7280-camss"; + + clocks =3D <&camcc CAM_CC_CAMNOC_AXI_CLK>, + <&camcc CAM_CC_IFE_0_CSID_CLK>, + <&camcc CAM_CC_IFE_1_CSID_CLK>, + <&camcc CAM_CC_IFE_2_CSID_CLK>, + <&camcc CAM_CC_IFE_LITE_0_CSID_CLK>, + <&camcc CAM_CC_IFE_LITE_1_CSID_CLK>, + <&camcc CAM_CC_CSIPHY0_CLK>, + <&camcc CAM_CC_CSI0PHYTIMER_CLK>, + <&camcc CAM_CC_CSIPHY1_CLK>, + <&camcc CAM_CC_CSI1PHYTIMER_CLK>, + <&camcc CAM_CC_CSIPHY2_CLK>, + <&camcc CAM_CC_CSI2PHYTIMER_CLK>, + <&camcc CAM_CC_CSIPHY3_CLK>, + <&camcc CAM_CC_CSI3PHYTIMER_CLK>, + <&camcc CAM_CC_CSIPHY4_CLK>, + <&camcc CAM_CC_CSI4PHYTIMER_CLK>, + <&gcc GCC_CAMERA_AHB_CLK>, + <&gcc GCC_CAMERA_HF_AXI_CLK>, + <&camcc CAM_CC_CPAS_AHB_CLK>, + <&camcc CAM_CC_IFE_0_AXI_CLK>, + <&camcc CAM_CC_IFE_0_CLK>, + <&camcc CAM_CC_IFE_0_CPHY_RX_CLK>, + <&camcc CAM_CC_IFE_1_AXI_CLK>, + <&camcc CAM_CC_IFE_1_CLK>, + <&camcc CAM_CC_IFE_1_CPHY_RX_CLK>, + <&camcc CAM_CC_IFE_2_AXI_CLK>, + <&camcc CAM_CC_IFE_2_CLK>, + <&camcc CAM_CC_IFE_2_CPHY_RX_CLK>, + <&camcc CAM_CC_IFE_LITE_0_CLK>, + <&camcc CAM_CC_IFE_LITE_0_CPHY_RX_CLK>, + <&camcc CAM_CC_IFE_LITE_1_CLK>, + <&camcc CAM_CC_IFE_LITE_1_CPHY_RX_CLK>; + + clock-names =3D "camnoc_axi", + "csi0", + "csi1", + "csi2", + "csi3", + "csi4", + "csiphy0", + "csiphy0_timer", + "csiphy1", + "csiphy1_timer", + "csiphy2", + "csiphy2_timer", + "csiphy3", + "csiphy3_timer", + "csiphy4", + "csiphy4_timer", + "gcc_camera_ahb", + "gcc_camera_axi", + "soc_ahb", + "vfe0_axi", + "vfe0", + "vfe0_cphy_rx", + "vfe1_axi", + "vfe1", + "vfe1_cphy_rx", + "vfe2_axi", + "vfe2", + "vfe2_cphy_rx", + "vfe0_lite", + "vfe0_lite_cphy_rx", + "vfe1_lite", + "vfe1_lite_cphy_rx"; + + interconnects =3D <&gem_noc MASTER_APPSS_PROC 0 &cnoc2 SLAVE_CAMERA_CF= G 0>, + <&mmss_noc MASTER_CAMNOC_HF 0 &mc_virt SLAVE_EBI1 0>; + + interconnect-names =3D "ahb", "hf_0"; + + interrupts =3D , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + + interrupt-names =3D "csid0", + "csid1", + "csid2", + "csid_lite0", + "csid_lite1", + "csiphy0", + "csiphy1", + "csiphy2", + "csiphy3", + "csiphy4", + "vfe0", + "vfe1", + "vfe2", + "vfe_lite0", + "vfe_lite1"; + + iommus =3D <&apps_smmu 0x800 0x4e0>; + + power-domains =3D <&camcc CAM_CC_IFE_0_GDSC>, + <&camcc CAM_CC_IFE_1_GDSC>, + <&camcc CAM_CC_IFE_2_GDSC>, + <&camcc CAM_CC_TITAN_TOP_GDSC>; + + power-domains-names =3D "ife0", "ife1", "ife2", "top"; + + reg =3D <0x0 0x0acb3000 0x0 0x1000>, + <0x0 0x0acba000 0x0 0x1000>, + <0x0 0x0acc1000 0x0 0x1000>, + <0x0 0x0acc8000 0x0 0x1000>, + <0x0 0x0accf000 0x0 0x1000>, + <0x0 0x0ace0000 0x0 0x2000>, + <0x0 0x0ace2000 0x0 0x2000>, + <0x0 0x0ace4000 0x0 0x2000>, + <0x0 0x0ace6000 0x0 0x2000>, + <0x0 0x0ace8000 0x0 0x2000>, + <0x0 0x0acaf000 0x0 0x4000>, + <0x0 0x0acb6000 0x0 0x4000>, + <0x0 0x0acbd000 0x0 0x4000>, + <0x0 0x0acc4000 0x0 0x4000>, + <0x0 0x0accb000 0x0 0x4000>; + + reg-names =3D "csid0", + "csid1", + "csid2", + "csid_lite0", + "csid_lite1", + "csiphy0", + "csiphy1", + "csiphy2", + "csiphy3", + "csiphy4", + "vfe0", + "vfe1", + "vfe2", + "vfe_lite0", + "vfe_lite1"; + + status =3D "disabled"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + }; + + port@1 { + reg =3D <1>; + }; + + port@2 { + reg =3D <2>; + }; + + port@3 { + reg =3D <3>; + }; + + port@4 { + reg =3D <4>; + }; + }; + }; + camcc: clock-controller@ad00000 { compatible =3D "qcom,sc7280-camcc"; reg =3D <0 0x0ad00000 0 0x10000>; --=20 2.25.1 From nobody Mon Nov 25 02:31:46 2024 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A6D71E3797; Wed, 30 Oct 2024 10:55:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730285711; cv=none; b=rHoY0V1/T+wqUcCufddvDHVlQMdqF+jz8YqE6jkd089z+g56+cMDO3GxYAx9nfwpuz8Ve6eMiPE59kUbeqZxKCpxf1JCuorJsiiVcFktFrNmCVNuOtdQslj/ZXh+iXVLMbFVNfSrYcDA2necVfU2leQcJigjRu/x4bHroOKKBU4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730285711; c=relaxed/simple; bh=wuZ7LTlT9Z4VG9OzPeHAxrw0rlQtLwqS5Hu2osalNCg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=K3AOveNg2JpYgfLpy7H7rjF021nrfLIKAVOpsnXlDmvW0Ihw4cWQ+TOsaAEPq02+PoaZljarCJM451E7GBHcnkAyclRJkGQvrZI0LWmQc3XxuZacx8v2+M/Rle1WIRECBzx8oLXCnYv5WYIFVxRTF/vTTk0EEgMI8+8caIZXSms= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=BOh6tNfh; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="BOh6tNfh" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49U9i7iS006853; Wed, 30 Oct 2024 10:54:57 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= bhaOSwgRgWw/5HeQA5POnyczQGuHVdALfWX/DT2LBos=; b=BOh6tNfhTmkOCgZj HJjlkwUj5SlzncvvW+zdsTuvlyoOk2b4UGXIueTyR4A/ADMbJyOOCKE6vOnAnc8t 1YnUYY431CiRiSWjjgbgGs8UiM0gsmRR9TL05FaZJ+cnW0615XauHdROyAF+mFbM ZUNNRNKIaBHLLs3O240XoB1ygo/JwGono8tcQfZrFJCYy0RAOkiTlHgJUw1I+y+S BncW25eoIc2eSCEUEVNPkJFTbcsUmlSW9e1YMmSwSQi5AaMOcGd4nUEkPYX+p5wN g7w+YIa3LU82fkVfWPapuT2SKhCqkQ1gj4DTEOrT8/KGLCZl3fuLfJSbvHlD6YxD J8jGrA== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 42gp4e3wd1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Oct 2024 10:54:57 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49UAsuhW003588 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Oct 2024 10:54:56 GMT Received: from hu-vikramsa-hyd.qualcomm.com (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, 30 Oct 2024 03:54:47 -0700 From: Vikram Sharma To: , , , , , , , , , , , , , , CC: , , , , , , Subject: [PATCH v4 6/6] arm64: dts: qcom: qcs6490-rb3gen2-vision-mezzanine: Add vision mezzanine Date: Wed, 30 Oct 2024 16:23:47 +0530 Message-ID: <20241030105347.2117034-7-quic_vikramsa@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241030105347.2117034-1-quic_vikramsa@quicinc.com> References: <20241030105347.2117034-1-quic_vikramsa@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-ORIG-GUID: jkHdlLkamE_XYFNLy1D-NFBsklaaUkQH X-Proofpoint-GUID: jkHdlLkamE_XYFNLy1D-NFBsklaaUkQH 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-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 mlxlogscore=999 clxscore=1015 spamscore=0 lowpriorityscore=0 malwarescore=0 bulkscore=0 adultscore=0 phishscore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410300085 Content-Type: text/plain; charset="utf-8" The Vision Mezzanine for the RB3 ships with an imx577 camera sensor. Enable the IMX577 on the vision mezzanine. An example media-ctl pipeline for the imx577 is: media-ctl --reset media-ctl -v -V '"imx577 '19-001a'":0[fmt:SRGGB10/4056x3040 field:none]' media-ctl -V '"msm_csiphy3":0[fmt:SRGGB10/4056x3040]' media-ctl -V '"msm_csid0":0[fmt:SRGGB10/4056x3040]' media-ctl -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/4056x3040]' media-ctl -l '"msm_csiphy3":1->"msm_csid0":0[1]' media-ctl -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]' yavta -B capture-mplane -c -I -n 5 -f SRGGB10P -s 4056x3040 -F /dev/video0 Signed-off-by: Hariram Purushothaman Signed-off-by: Vikram Sharma Signed-off-by: Trishansh Bhardwaj --- arch/arm64/boot/dts/qcom/Makefile | 4 + .../qcs6490-rb3gen2-vision-mezzanine.dtso | 73 +++++++++++++++++++ arch/arm64/boot/dts/qcom/sc7280.dtsi | 33 +++++++++ 3 files changed, 110 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/qcs6490-rb3gen2-vision-mezzani= ne.dtso diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/M= akefile index ac199f809b0d..186768f7c696 100644 --- a/arch/arm64/boot/dts/qcom/Makefile +++ b/arch/arm64/boot/dts/qcom/Makefile @@ -111,6 +111,10 @@ dtb-$(CONFIG_ARCH_QCOM) +=3D qcm6490-shift-otter.dtb dtb-$(CONFIG_ARCH_QCOM) +=3D qcs404-evb-1000.dtb dtb-$(CONFIG_ARCH_QCOM) +=3D qcs404-evb-4000.dtb dtb-$(CONFIG_ARCH_QCOM) +=3D qcs6490-rb3gen2.dtb + +qcs6490-rb3gen2-vision-mezzanine-dtbs :=3D qcs6490-rb3gen2.dtb qcs6490-rb3= gen2-vision-mezzanine.dtbo + +dtb-$(CONFIG_ARCH_QCOM) +=3D qcs6490-rb3gen2-vision-mezzanine.dtb dtb-$(CONFIG_ARCH_QCOM) +=3D qcs8550-aim300-aiot.dtb dtb-$(CONFIG_ARCH_QCOM) +=3D qdu1000-idp.dtb dtb-$(CONFIG_ARCH_QCOM) +=3D qrb2210-rb1.dtb diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2-vision-mezzanine.dtso= b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2-vision-mezzanine.dtso new file mode 100644 index 000000000000..cd3fe65fa971 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2-vision-mezzanine.dtso @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2024, Qualcomm Innovation Center, Inc. All rights reserve= d. + */ + +/* + * Camera Sensor overlay on top of rb3gen2 core kit. + */ + +#include +#include + +/dts-v1/; +/plugin/; + +&camcc { + status =3D "okay"; +}; + +&camss { + vdda-phy-supply =3D <&vreg_l10c_0p88>; + vdda-pll-supply =3D <&vreg_l6b_1p2>; + status =3D "okay"; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + /* The port index denotes CSIPHY id i.e. csiphy3 */ + port@3 { + reg =3D <3>; + csiphy3_ep: endpoint { + clock-lanes =3D <7>; + data-lanes =3D <0 1 2 3>; + remote-endpoint =3D <&imx577_ep>; + }; + }; + }; +}; + +&cci1 { + status =3D "okay"; +}; + +&cci1_i2c1 { + #address-cells =3D <1>; + #size-cells =3D <0>; + + camera@1a { + compatible =3D "sony,imx577"; + reg =3D <0x1a>; + + reset-gpios =3D <&tlmm 78 GPIO_ACTIVE_LOW>; + pinctrl-names =3D "default", "suspend"; + pinctrl-0 =3D <&cam2_default>; + pinctrl-1 =3D <&cam2_suspend>; + + clocks =3D <&camcc CAM_CC_MCLK3_CLK>; + assigned-clocks =3D <&camcc CAM_CC_MCLK3_CLK>; + assigned-clock-rates =3D <24000000>; + + dovdd-supply =3D <&vreg_l18b_1p8>; + + port { + imx577_ep: endpoint { + clock-lanes =3D <7>; + link-frequencies =3D /bits/ 64 <600000000>; + data-lanes =3D <0 1 2 3>; + remote-endpoint =3D <&csiphy3_ep>; + }; + }; + }; +}; diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qco= m/sc7280.dtsi index 690051708dec..8130c1374722 100644 --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi @@ -5115,6 +5115,39 @@ tlmm: pinctrl@f100000 { gpio-ranges =3D <&tlmm 0 0 175>; wakeup-parent =3D <&pdc>; =20 + cam2_default: cam2-default-state { + rst-pins { + pins =3D "gpio78"; + function =3D "gpio"; + drive-strength =3D <2>; + bias-disable; + }; + + mclk-pins { + pins =3D "gpio67"; + function =3D "cam_mclk"; + drive-strength =3D <2>; + bias-disable; + }; + }; + + cam2_suspend: cam2-suspend-state { + rst-pins { + pins =3D "gpio78"; + function =3D "gpio"; + drive-strength =3D <2>; + bias-pull-down; + output-low; + }; + + mclk-pins { + pins =3D "gpio67"; + function =3D "cam_mclk"; + drive-strength =3D <2>; + bias-pull-down; + }; + }; + cci0_default: cci0-default-state { pins =3D "gpio69", "gpio70"; function =3D "cci_i2c"; --=20 2.25.1