From nobody Sun Nov 24 20:42:02 2024 Received: from mail.mainlining.org (mail.mainlining.org [5.75.144.95]) (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 98A2E1A0B06; Fri, 1 Nov 2024 13:47:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.75.144.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730468854; cv=none; b=j9qIA8XQC218y9/F5+SlblkpKAVM8q3CHS/rpkz21Qa1ionnEMG08dlb6bJ4I6njUAPBY9mRVybXNIm6nPHhMDP21yty1f9EGHwIkHsOZGblQ3Q/Yk0XGoVhJLUYRhoTnbqOuPpfTMs2Vv/teu5V/9rOhvvVkQ18irQ4nfSqasc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730468854; c=relaxed/simple; bh=bH081dbY2wq+jmqHheBoc805cGu+jE4ti0YSwteNCyM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZA4RUhp3vBtbccioAsigbQNKQl27wI1wHBwaOmOTjxLqbDfcCTL5/xoMdppaQ5phk4Ltfcq5aIvgzZysKWSa4dLto5MrWB3eOfQKNFHepHzrjJHSiPLYfGOLKtVeU5xEaKujh9rn4lUxm5lF1ttHl0S0sPg8frf+lt+EunhwWtc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mainlining.org; spf=pass smtp.mailfrom=mainlining.org; dkim=pass (2048-bit key) header.d=mainlining.org header.i=@mainlining.org header.b=ap27q1dZ; arc=none smtp.client-ip=5.75.144.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mainlining.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mainlining.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mainlining.org header.i=@mainlining.org header.b="ap27q1dZ" Received: from [192.168.1.130] (BC24930C.dsl.pool.telekom.hu [188.36.147.12]) by mail.mainlining.org (Postfix) with ESMTPSA id 84CC7E45B7; Fri, 1 Nov 2024 13:47:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mainlining.org; s=psm; t=1730468844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GGuWgqH+1bwI/HrW60ySCtzBCVJ/NXD7MWi8uWD22S8=; b=ap27q1dZSqKYGB6mj8CwDEwLyXHvgykm/VLVwdAyQLbBlcaqquvdGcMZxQRM6O9aLRf9gz 06KS1f7vmv2OgukLSP5bRoKb9aj5AaUvxwB20ePSfdQbFXhsV/UaY2119yXiMr8Gj5uxyY tgLJwtqqI8NUQVrMxc/A5dgpjB6zBC/t7p4xYDWaGUopo44ShEl+L/XJXwG7a0rD8hC8K3 2pB9jZHkVgsz32GEFZ7PKcbR4i5WJAu4dGR95k2fNQXLzYe+5TUWZvYS88KFXwV7EcgrR7 fu1FPSTObK15//cSebPrP9s9Ma4y/RAxQu14NDlDskMEP/VyvRv94jg0dRLULg== From: =?utf-8?q?Barnab=C3=A1s_Cz=C3=A9m=C3=A1n?= Date: Fri, 01 Nov 2024 14:47:22 +0100 Subject: [PATCH 1/3] media: camss: vfe: implement pm domain ops for v4.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241101-camss-msm8953-v1-1-4012559fcbc2@mainlining.org> References: <20241101-camss-msm8953-v1-0-4012559fcbc2@mainlining.org> In-Reply-To: <20241101-camss-msm8953-v1-0-4012559fcbc2@mainlining.org> To: Robert Foss , Todor Tomov , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Barnabas Czeman Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1730468843; l=1166; i=barnabas.czeman@mainlining.org; s=20240730; h=from:subject:message-id; bh=bH081dbY2wq+jmqHheBoc805cGu+jE4ti0YSwteNCyM=; b=ZSkafLchsH5pdS/ACB+Z2AVt0O0ndUcRaHz3NfmH+Ns2ngoTLERQ2vpryv9siAhcrjyduKZoX k0Qer9Yn2l7B+OBVpkOMkgQG7s3UvFHbTr7u14Z/rsdONwYlFwlLcHj X-Developer-Key: i=barnabas.czeman@mainlining.org; a=ed25519; pk=TWUSIGgwW/Sn4xnX25nw+lszj1AT/A3bzkahn7EhOFc= MSM8917 and MSM8953 has multiple VFE power domains they have to be power on/off explicitly. Signed-off-by: Barnab=C3=A1s Cz=C3=A9m=C3=A1n Reviewed-by: Bryan O'Donoghue --- drivers/media/platform/qcom/camss/camss-vfe-4-1.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-vfe-4-1.c b/drivers/me= dia/platform/qcom/camss/camss-vfe-4-1.c index 1bd3a6ef1d04d8610fd1bee0c22cdbc147c98de5..9a9007c3ff33b40f4c88cd30283= f0ad42f8e8d00 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe-4-1.c +++ b/drivers/media/platform/qcom/camss/camss-vfe-4-1.c @@ -938,7 +938,10 @@ static irqreturn_t vfe_isr(int irq, void *dev) */ static void vfe_4_1_pm_domain_off(struct vfe_device *vfe) { - /* nop */ + if (!vfe->res->has_pd) + return; + + vfe_pm_domain_off(vfe); } =20 /* @@ -947,7 +950,10 @@ static void vfe_4_1_pm_domain_off(struct vfe_device *v= fe) */ static int vfe_4_1_pm_domain_on(struct vfe_device *vfe) { - return 0; + if (!vfe->res->has_pd) + return 0; + + return vfe_pm_domain_on(vfe); } =20 static const struct vfe_hw_ops_gen1 vfe_ops_gen1_4_1 =3D { --=20 2.47.0 From nobody Sun Nov 24 20:42:02 2024 Received: from mail.mainlining.org (mail.mainlining.org [5.75.144.95]) (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 672A71A0BCA; Fri, 1 Nov 2024 13:47:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.75.144.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730468856; cv=none; b=Pg+lavu3AElQqutfDXxGjUy822vC/GZRVrWWjmFqrkPFGl9YLSYlGYQRDpu5PCUTmdQfVSRYemp9WYsAnjKW6CPNvg6Gi+//hze5+wllHOBK2iz/XxRnSwv+bwJaHXrg1BQNrtpIiqHqswnLZraeNTY54T0Uj2MdET1umq+J6pg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730468856; c=relaxed/simple; bh=DwmODMOYpxKs8pDkFiU4d0qnyC6Z3t2oHSTorqoxBgg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XyuIEvCozqgmikXBEe/TUi0MOsjtTEt8t/O3h07vScKNn7+R9smvLAdSitCg4kqrRzPI2qU10zrFltE9x1shWr9UmBYizgBFayy0PaV3026rk/U68eT5N9ubi0zqmjIffLP8FS/q1mLdmC63/Mr7Wzsp8nj12hASr1kE9u8Kmrc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mainlining.org; spf=pass smtp.mailfrom=mainlining.org; dkim=pass (2048-bit key) header.d=mainlining.org header.i=@mainlining.org header.b=mqHBtHly; arc=none smtp.client-ip=5.75.144.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mainlining.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mainlining.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mainlining.org header.i=@mainlining.org header.b="mqHBtHly" Received: from [192.168.1.130] (BC24930C.dsl.pool.telekom.hu [188.36.147.12]) by mail.mainlining.org (Postfix) with ESMTPSA id 10C98E45B9; Fri, 1 Nov 2024 13:47:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mainlining.org; s=psm; t=1730468845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ox8yrRy/Sv/0CUQ9KvYBPQy6VLCzEuPVzIca908upCw=; b=mqHBtHly5OmyTmBkaMEGy6VYo5hYI3PvrHpwciMC/bFniu9czNfIU9lwz100/lYEhGxrhV BbHVInPpj3mq+auVwL9lxReu8IqfrWu8NL1Sop/LbLsw8blZk3MJdbkCMhA3fFP5RWjJQZ PwclpEivErHSBm9R2KRbVoWZqPII/wWprBJN9gl01ApMD7VM3yQF+BcCKwkZ3IVbiyuhqL JrAbQykV9RY7UP7lq2v2Ex5/gxpbcYSlPjT204S0NwT0/PWPxBtfRQzz3jPYulTZlt+DrA 4lvwaILtB4wtWui3eJUeooBBnJuBqcfOf3L3ZdFfSVaNuwZM5zRWrbQ9vDHUUA== From: =?utf-8?q?Barnab=C3=A1s_Cz=C3=A9m=C3=A1n?= Date: Fri, 01 Nov 2024 14:47:23 +0100 Subject: [PATCH 2/3] media: dt-bindings: media: camss: Add qcom,msm8953-camss binding Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241101-camss-msm8953-v1-2-4012559fcbc2@mainlining.org> References: <20241101-camss-msm8953-v1-0-4012559fcbc2@mainlining.org> In-Reply-To: <20241101-camss-msm8953-v1-0-4012559fcbc2@mainlining.org> To: Robert Foss , Todor Tomov , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Barnabas Czeman Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1730468843; l=8890; i=barnabas.czeman@mainlining.org; s=20240730; h=from:subject:message-id; bh=DwmODMOYpxKs8pDkFiU4d0qnyC6Z3t2oHSTorqoxBgg=; b=t4NLQEI7x0RMPSzlN1YNXueyw02mXOJIzhdCKCzLUZdUJwTSY1tgb4kTfjxkKYK4rC1aBYkRQ XhwtRthmr76CtIuljJdrfMFXprFMjcFkfQq3bmCQqMiGSLHt3JU5H7e X-Developer-Key: i=barnabas.czeman@mainlining.org; a=ed25519; pk=TWUSIGgwW/Sn4xnX25nw+lszj1AT/A3bzkahn7EhOFc= Add bindings for qcom,msm8953-camss in order to support the camera subsystem for MSM8953/SDM450/SDM632. Signed-off-by: Barnab=C3=A1s Cz=C3=A9m=C3=A1n --- .../bindings/media/qcom,msm8953-camss.yaml | 320 +++++++++++++++++= ++++ 1 file changed, 320 insertions(+) diff --git a/Documentation/devicetree/bindings/media/qcom,msm8953-camss.yam= l b/Documentation/devicetree/bindings/media/qcom,msm8953-camss.yaml new file mode 100644 index 0000000000000000000000000000000000000000..39b9c58e2a2ea2e1ad434aa35bf= 6ee128d3a0649 --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,msm8953-camss.yaml @@ -0,0 +1,320 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) + +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/qcom,msm8953-camss.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm CAMSS ISP + +maintainers: + - Barnabas Czeman + +description: | + The CAMSS IP is a CSI decoder and ISP present on Qualcomm platforms + +properties: + compatible: + const: qcom,msm8953-camss + + clocks: + minItems: 30 + maxItems: 30 + + clock-names: + items: + - const: top_ahb + - const: ispif_ahb + - const: micro_ahb + - const: csiphy0_timer + - const: csiphy1_timer + - const: csiphy2_timer + - const: csi0_ahb + - const: csi0 + - const: csi0_phy + - const: csi0_pix + - const: csi0_rdi + - const: csi1_ahb + - const: csi1 + - const: csi1_phy + - const: csi1_pix + - const: csi1_rdi + - const: csi2_ahb + - const: csi2 + - const: csi2_phy + - const: csi2_pix + - const: csi2_rdi + - const: ahb + - const: vfe0 + - const: csi_vfe0 + - const: vfe0_ahb + - const: vfe0_axi + - const: vfe1 + - const: csi_vfe1 + - const: vfe1_ahb + - const: vfe1_axi + + interrupts: + minItems: 9 + maxItems: 9 + + interrupt-names: + items: + - const: csiphy0 + - const: csiphy1 + - const: csiphy2 + - const: csid0 + - const: csid1 + - const: csid2 + - const: ispif + - const: vfe0 + - const: vfe1 + + iommus: + maxItems: 1 + + power-domains: + items: + - description: VFE0 GDSC - Video Front End, Global Distributed Switc= h Controller. + - description: VFE1 GDSC - Video Front End, Global Distributed Switc= h Controller. + + 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: + description: + An array of physical data lanes indexes. + Position of an entry determines the logical + lane number, while the value of an entry + indicates physical lane index. Lane swapping + is supported. Physical lane indexes; + 0, 2, 3, 4. + 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 + + reg: + minItems: 13 + maxItems: 13 + + reg-names: + items: + - const: csiphy0 + - const: csiphy0_clk_mux + - const: csiphy1 + - const: csiphy1_clk_mux + - const: csiphy2 + - const: csiphy2_clk_mux + - const: csid0 + - const: csid1 + - const: csid2 + - const: ispif + - const: csi_clk_mux + - const: vfe0 + - const: vfe1 + + vdda-supply: + description: + Definition of the regulator used as analog power supply. + +required: + - clock-names + - clocks + - compatible + - interrupt-names + - interrupts + - iommus + - power-domains + - reg + - reg-names + - vdda-supply + +additionalProperties: false + +examples: + - | + #include + #include + + camss: camss@1b00000 { + + compatible =3D "qcom,msm8953-camss"; + + clocks =3D <&gcc GCC_CAMSS_TOP_AHB_CLK>, + <&gcc GCC_CAMSS_ISPIF_AHB_CLK>, + <&gcc GCC_CAMSS_MICRO_AHB_CLK>, + <&gcc GCC_CAMSS_CSI0PHYTIMER_CLK>, + <&gcc GCC_CAMSS_CSI1PHYTIMER_CLK>, + <&gcc GCC_CAMSS_CSI2PHYTIMER_CLK>, + <&gcc GCC_CAMSS_CSI0_AHB_CLK>, + <&gcc GCC_CAMSS_CSI0_CLK>, + <&gcc GCC_CAMSS_CSI0PHY_CLK>, + <&gcc GCC_CAMSS_CSI0PIX_CLK>, + <&gcc GCC_CAMSS_CSI0RDI_CLK>, + <&gcc GCC_CAMSS_CSI1_AHB_CLK>, + <&gcc GCC_CAMSS_CSI1_CLK>, + <&gcc GCC_CAMSS_CSI1PHY_CLK>, + <&gcc GCC_CAMSS_CSI1PIX_CLK>, + <&gcc GCC_CAMSS_CSI1RDI_CLK>, + <&gcc GCC_CAMSS_CSI2_AHB_CLK>, + <&gcc GCC_CAMSS_CSI2_CLK>, + <&gcc GCC_CAMSS_CSI2PHY_CLK>, + <&gcc GCC_CAMSS_CSI2PIX_CLK>, + <&gcc GCC_CAMSS_CSI2RDI_CLK>, + <&gcc GCC_CAMSS_AHB_CLK>, + <&gcc GCC_CAMSS_VFE0_CLK>, + <&gcc GCC_CAMSS_CSI_VFE0_CLK>, + <&gcc GCC_CAMSS_VFE0_AHB_CLK>, + <&gcc GCC_CAMSS_VFE0_AXI_CLK>, + <&gcc GCC_CAMSS_VFE1_CLK>, + <&gcc GCC_CAMSS_CSI_VFE1_CLK>, + <&gcc GCC_CAMSS_VFE1_AHB_CLK>, + <&gcc GCC_CAMSS_VFE1_AXI_CLK>; + + clock-names =3D "top_ahb", + "ispif_ahb", + "micro_ahb", + "csiphy0_timer", + "csiphy1_timer", + "csiphy2_timer", + "csi0_ahb", + "csi0", + "csi0_phy", + "csi0_pix", + "csi0_rdi", + "csi1_ahb", + "csi1", + "csi1_phy", + "csi1_pix", + "csi1_rdi", + "csi2_ahb", + "csi2", + "csi2_phy", + "csi2_pix", + "csi2_rdi", + "ahb", + "vfe0", + "csi_vfe0", + "vfe0_ahb", + "vfe0_axi", + "vfe1", + "csi_vfe1", + "vfe1_ahb", + "vfe1_axi"; + + iommus =3D <&apps_iommu 0x14>; + + interrupts =3D , + , + , + , + , + , + , + , + ; + + interrupt-names =3D "csiphy0", + "csiphy1", + "csiphy2", + "csid0", + "csid1", + "csid2", + "ispif", + "vfe0", + "vfe1"; + + power-domains =3D <&gcc VFE0_GDSC>, + <&gcc VFE1_GDSC>; + + reg =3D <0x1b34000 0x1000>, + <0x1b00030 0x4>, + <0x1b35000 0x1000>, + <0x1b00038 0x4>, + <0x1b36000 0x1000>, + <0x1b00040 0x4>, + <0x1b30000 0x100>, + <0x1b30400 0x100>, + <0x1b30800 0x100>, + <0x1b31000 0x500>, + <0x1b00020 0x10>, + <0x1b10000 0x1000>, + <0x1b14000 0x1000>; + + reg-names =3D "csiphy0", + "csiphy0_clk_mux", + "csiphy1", + "csiphy1_clk_mux", + "csiphy2", + "csiphy2_clk_mux", + "csid0", + "csid1", + "csid2", + "ispif", + "csi_clk_mux", + "vfe0", + "vfe1"; + + vdda-supply =3D <®_2v8>; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + }; + }; --=20 2.47.0 From nobody Sun Nov 24 20:42:02 2024 Received: from mail.mainlining.org (mail.mainlining.org [5.75.144.95]) (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 6724D1A0B16; Fri, 1 Nov 2024 13:47:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.75.144.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730468856; cv=none; b=LXBLtExlBCb+R3lN2en2ZLIXpaavisXT67rd/sMcz+3grZkFC39AirdOueTujUyMI8U1aFzABDFSRAlE6nRMWR4RJ1F+LqVxPNQTctmE3n7so+agILaa8ZlNDL/rJG7WjlVb1jO01xj9M0zIIoSOA+ixYbeiKlVIMGJKWzEC/U8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730468856; c=relaxed/simple; bh=hDPqjX7R0X0N/cejXLDu71hA3tc1D0Q1pI5bae/0KcY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BRYqJVFZOvDMFEN6gbxNzpuIMKG7ViSd7edFWaLypzkcsl5yACsUp6dURR/HPgbepdDRWPUofcv0jWVzHb7to5W312n0ogXVMdjihK61WnmOYdDuSp/5Ss7euEbUAcLcJoERizWzhyiEVT0Eh4cOARYcCfFR1Nc1t0YnOJeQQR0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mainlining.org; spf=pass smtp.mailfrom=mainlining.org; dkim=pass (2048-bit key) header.d=mainlining.org header.i=@mainlining.org header.b=XcMBPr65; arc=none smtp.client-ip=5.75.144.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mainlining.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mainlining.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mainlining.org header.i=@mainlining.org header.b="XcMBPr65" Received: from [192.168.1.130] (BC24930C.dsl.pool.telekom.hu [188.36.147.12]) by mail.mainlining.org (Postfix) with ESMTPSA id EBF16E45BA; Fri, 1 Nov 2024 13:47:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mainlining.org; s=psm; t=1730468846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vALYwPZP8k0dEiw1OWoaNhj1VogvFTcrBYFehkVFW28=; b=XcMBPr65v8m1kNiSStVktwNO4k4kXz6hUHE0zMu6K7FnH6V+wm/AOWfeRzLHdhWAQlCaog xvf3bl5ovSQvkLbZRMYZ0/Mzu8+3L/I+NGsnx93QR8VQTihLQ1+r+B2yQ18rmEkmG3BIfq ohK44xHr2e/kWjc85kVng2kxnPKOsrznJsovFFxXywtDRgT9VdFaMIs0bmF+9q7xBeowbJ iY0De8eSdOB4WR2p1QiSOxN722S0KhHTky1kEiQBArVNGzHv3W2dsY7lnIua+dDLjXGAwz 5Z7t/kqGLx0T/fQX/VDCWuj0mSPS7O+gXrT7vVKt6Bl9oET4AaX4JgVl22sUDg== From: =?utf-8?q?Barnab=C3=A1s_Cz=C3=A9m=C3=A1n?= Date: Fri, 01 Nov 2024 14:47:24 +0100 Subject: [PATCH 3/3] media: qcom: camss: Add MSM8953 resources Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241101-camss-msm8953-v1-3-4012559fcbc2@mainlining.org> References: <20241101-camss-msm8953-v1-0-4012559fcbc2@mainlining.org> In-Reply-To: <20241101-camss-msm8953-v1-0-4012559fcbc2@mainlining.org> To: Robert Foss , Todor Tomov , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Barnabas Czeman Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Vladimir Lypak X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1730468843; l=10108; i=barnabas.czeman@mainlining.org; s=20240730; h=from:subject:message-id; bh=rp3tsvhgxorGqhPFlXS67hSONRWmhHhYkzeYEPV2TGE=; b=a5EUy0oiyX9mbKIfSzmXx3OyjjkpbL4eibe68KCan9sGzyMuYe6ihApnMP+VE/hXJ3hDCBS4t tD+GmOKV7X1C7xEYiaewoqBhTAWxjizzfJLsbfOkp9X+55RkNCP2zLk X-Developer-Key: i=barnabas.czeman@mainlining.org; a=ed25519; pk=TWUSIGgwW/Sn4xnX25nw+lszj1AT/A3bzkahn7EhOFc= From: Vladimir Lypak This commit describes the hardware layout for the MSM8953/SDM450/SDM632 for the following hardware blocks: - 2 x VFE, 3 RDI per VFE - 3 x CSID - 3 x CSI PHY Signed-off-by: Vladimir Lypak Signed-off-by: Barnab=C3=A1s Cz=C3=A9m=C3=A1n Acked-by: Bryan O'Donoghue --- drivers/media/platform/qcom/camss/camss-csiphy.c | 1 + drivers/media/platform/qcom/camss/camss-ispif.c | 5 + drivers/media/platform/qcom/camss/camss-vfe.c | 1 + drivers/media/platform/qcom/camss/camss.c | 168 +++++++++++++++++++= ++++ drivers/media/platform/qcom/camss/camss.h | 1 + 5 files changed, 176 insertions(+) diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/med= ia/platform/qcom/camss/camss-csiphy.c index 68a3ea1ba2a5299cf28289dfdb958cfdff3c91e0..5af2b382a843c2b8857339ba289= 30fe1682c9412 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c @@ -596,6 +596,7 @@ int msm_csiphy_subdev_init(struct camss *camss, return PTR_ERR(csiphy->base); =20 if (camss->res->version =3D=3D CAMSS_8x16 || + camss->res->version =3D=3D CAMSS_8x53 || camss->res->version =3D=3D CAMSS_8x96) { csiphy->base_clk_mux =3D devm_platform_ioremap_resource_byname(pdev, res->reg[1]); diff --git a/drivers/media/platform/qcom/camss/camss-ispif.c b/drivers/medi= a/platform/qcom/camss/camss-ispif.c index a12dcc7ff438c55167bc2981fd399dbf178181df..2dc585c6123dd248a5bacd9c7a8= 8cb5375644311 100644 --- a/drivers/media/platform/qcom/camss/camss-ispif.c +++ b/drivers/media/platform/qcom/camss/camss-ispif.c @@ -830,6 +830,7 @@ static int ispif_set_stream(struct v4l2_subdev *sd, int= enable) ispif_select_cid(ispif, intf, cid, vfe, 1); ispif_config_irq(ispif, intf, vfe, 1); if (camss->res->version =3D=3D CAMSS_8x96 || + camss->res->version =3D=3D CAMSS_8x53 || camss->res->version =3D=3D CAMSS_660) ispif_config_pack(ispif, line->fmt[MSM_ISPIF_PAD_SINK].code, @@ -848,6 +849,7 @@ static int ispif_set_stream(struct v4l2_subdev *sd, int= enable) =20 mutex_lock(&ispif->config_lock); if (camss->res->version =3D=3D CAMSS_8x96 || + camss->res->version =3D=3D CAMSS_8x53 || camss->res->version =3D=3D CAMSS_660) ispif_config_pack(ispif, line->fmt[MSM_ISPIF_PAD_SINK].code, @@ -1111,6 +1113,7 @@ int msm_ispif_subdev_init(struct camss *camss, if (camss->res->version =3D=3D CAMSS_8x16) ispif->line_num =3D 2; else if (camss->res->version =3D=3D CAMSS_8x96 || + camss->res->version =3D=3D CAMSS_8x53 || camss->res->version =3D=3D CAMSS_660) ispif->line_num =3D 4; else @@ -1130,6 +1133,7 @@ int msm_ispif_subdev_init(struct camss *camss, ispif->line[i].nformats =3D ARRAY_SIZE(ispif_formats_8x16); } else if (camss->res->version =3D=3D CAMSS_8x96 || + camss->res->version =3D=3D CAMSS_8x53 || camss->res->version =3D=3D CAMSS_660) { ispif->line[i].formats =3D ispif_formats_8x96; ispif->line[i].nformats =3D @@ -1162,6 +1166,7 @@ int msm_ispif_subdev_init(struct camss *camss, ret =3D devm_request_irq(dev, ispif->irq, ispif_isr_8x16, IRQF_TRIGGER_RISING, ispif->irq_name, ispif); else if (camss->res->version =3D=3D CAMSS_8x96 || + camss->res->version =3D=3D CAMSS_8x53 || camss->res->version =3D=3D CAMSS_660) ret =3D devm_request_irq(dev, ispif->irq, ispif_isr_8x96, IRQF_TRIGGER_RISING, ispif->irq_name, ispif); diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/= platform/qcom/camss/camss-vfe.c index 83c5a36d071fcc32c4b8a89e4e429dc1820df139..80a62ba11295042802cbaec617f= b87c492ea6a55 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -285,6 +285,7 @@ static u32 vfe_src_pad_code(struct vfe_line *line, u32 = sink_code, =20 switch (vfe->camss->res->version) { case CAMSS_8x16: + case CAMSS_8x53: switch (sink_code) { case MEDIA_BUS_FMT_YUYV8_1X16: { diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/plat= form/qcom/camss/camss.c index fabe034081ed0a7c0e0fcd8bc76c4eb396cb0067..f0716952c86a3888fa3ee7680d8= 65a2872b6ed13 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -152,6 +152,158 @@ static const struct camss_subdev_resources vfe_res_8x= 16[] =3D { } }; =20 +static const struct camss_subdev_resources csid_res_8x53[] =3D { + /* CSID0 */ + { + .regulators =3D { "vdda" }, + .clock =3D { "top_ahb", "ispif_ahb", "csi0_ahb", "ahb", + "csi0", "csi0_phy", "csi0_pix", "csi0_rdi" }, + .clock_rate =3D { { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 100000000, 200000000, 310000000, + 400000000, 465000000 }, + { 0 }, + { 0 }, + { 0 } }, + .reg =3D { "csid0" }, + .interrupt =3D { "csid0" }, + .csid =3D { + .hw_ops =3D &csid_ops_4_7, + .parent_dev_ops =3D &vfe_parent_dev_ops, + .formats =3D &csid_formats_4_7 + } + }, + + /* CSID1 */ + { + .regulators =3D { "vdda" }, + .clock =3D { "top_ahb", "ispif_ahb", "csi1_ahb", "ahb", + "csi1", "csi1_phy", "csi1_pix", "csi1_rdi" }, + .clock_rate =3D { { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 100000000, 200000000, 310000000, + 400000000, 465000000 }, + { 0 }, + { 0 }, + { 0 } }, + .reg =3D { "csid1" }, + .interrupt =3D { "csid1" }, + .csid =3D { + .hw_ops =3D &csid_ops_4_7, + .parent_dev_ops =3D &vfe_parent_dev_ops, + .formats =3D &csid_formats_4_7 + } + }, + + /* CSID2 */ + { + .regulators =3D { "vdda" }, + .clock =3D { "top_ahb", "ispif_ahb", "csi2_ahb", "ahb", + "csi2", "csi2_phy", "csi2_pix", "csi2_rdi" }, + .clock_rate =3D { { 0 }, + { 0 }, + { 0 }, + { 0 }, + { 100000000, 200000000, 310000000, + 400000000, 465000000 }, + { 0 }, + { 0 }, + { 0 } }, + .reg =3D { "csid2" }, + .interrupt =3D { "csid2" }, + .csid =3D { + .hw_ops =3D &csid_ops_4_7, + .parent_dev_ops =3D &vfe_parent_dev_ops, + .formats =3D &csid_formats_4_7 + } + }, +}; + +static const struct camss_subdev_resources ispif_res_8x53 =3D { + /* ISPIF */ + .clock =3D { "top_ahb", "ahb", "ispif_ahb", + "csi0", "csi0_pix", "csi0_rdi", + "csi1", "csi1_pix", "csi1_rdi", + "csi2", "csi2_pix", "csi2_rdi" }, + .clock_for_reset =3D { "vfe0", "csi_vfe0", "vfe1", "csi_vfe1" }, + .reg =3D { "ispif", "csi_clk_mux" }, + .interrupt =3D { "ispif" }, +}; + +static const struct camss_subdev_resources vfe_res_8x53[] =3D { + /* VFE0 */ + { + .regulators =3D {}, + .clock =3D { "top_ahb", "ahb", "ispif_ahb", + "vfe0", "csi_vfe0", "vfe0_ahb", "vfe0_axi" }, + .clock_rate =3D { { 0 }, + { 0 }, + { 0 }, + { 50000000, 100000000, 133330000, + 160000000, 200000000, 266670000, + 310000000, 400000000, 465000000 }, + { 0 }, + { 0 }, + { 0 } }, + .reg =3D { "vfe0" }, + .interrupt =3D { "vfe0" }, + .vfe =3D { + .line_num =3D 3, + .has_pd =3D true, + .hw_ops =3D &vfe_ops_4_1, + .formats_rdi =3D &vfe_formats_rdi_8x16, + .formats_pix =3D &vfe_formats_pix_8x16 + } + }, + + /* VFE1 */ + { + .regulators =3D {}, + .clock =3D { "top_ahb", "ahb", "ispif_ahb", + "vfe1", "csi_vfe1", "vfe1_ahb", "vfe1_axi" }, + .clock_rate =3D { { 0 }, + { 0 }, + { 0 }, + { 50000000, 100000000, 133330000, + 160000000, 200000000, 266670000, + 310000000, 400000000, 465000000 }, + { 0 }, + { 0 }, + { 0 } }, + .reg =3D { "vfe1" }, + .interrupt =3D { "vfe1" }, + .vfe =3D { + .line_num =3D 3, + .has_pd =3D true, + .hw_ops =3D &vfe_ops_4_1, + .formats_rdi =3D &vfe_formats_rdi_8x16, + .formats_pix =3D &vfe_formats_pix_8x16 + } + } +}; + +static const struct resources_icc icc_res_8x53[] =3D { + { + .name =3D "cam_ahb", + .icc_bw_tbl.avg =3D 38400, + .icc_bw_tbl.peak =3D 76800, + }, + { + .name =3D "cam_vfe0_mem", + .icc_bw_tbl.avg =3D 939524, + .icc_bw_tbl.peak =3D 1342177, + }, + { + .name =3D "cam_vfe1_mem", + .icc_bw_tbl.avg =3D 939524, + .icc_bw_tbl.peak =3D 1342177, + }, +}; + static const struct camss_subdev_resources csiphy_res_8x96[] =3D { /* CSIPHY0 */ { @@ -2248,6 +2400,7 @@ static int camss_probe(struct platform_device *pdev) return -ENOMEM; =20 if (camss->res->version =3D=3D CAMSS_8x16 || + camss->res->version =3D=3D CAMSS_8x53 || camss->res->version =3D=3D CAMSS_8x96) { camss->ispif =3D devm_kcalloc(dev, 1, sizeof(*camss->ispif), GFP_KERNEL); if (!camss->ispif) @@ -2389,6 +2542,20 @@ static const struct camss_resources msm8916_resource= s =3D { .link_entities =3D camss_link_entities }; =20 +static const struct camss_resources msm8953_resources =3D { + .version =3D CAMSS_8x53, + .icc_res =3D icc_res_8x53, + .icc_path_num =3D ARRAY_SIZE(icc_res_8x53), + .csiphy_res =3D csiphy_res_8x96, + .csid_res =3D csid_res_8x53, + .ispif_res =3D &ispif_res_8x53, + .vfe_res =3D vfe_res_8x53, + .csiphy_num =3D ARRAY_SIZE(csiphy_res_8x96), + .csid_num =3D ARRAY_SIZE(csid_res_8x53), + .vfe_num =3D ARRAY_SIZE(vfe_res_8x53), + .link_entities =3D camss_link_entities +}; + static const struct camss_resources msm8996_resources =3D { .version =3D CAMSS_8x96, .csiphy_res =3D csiphy_res_8x96, @@ -2455,6 +2622,7 @@ static const struct camss_resources sc8280xp_resource= s =3D { =20 static const struct of_device_id camss_dt_match[] =3D { { .compatible =3D "qcom,msm8916-camss", .data =3D &msm8916_resources }, + { .compatible =3D "qcom,msm8953-camss", .data =3D &msm8953_resources }, { .compatible =3D "qcom,msm8996-camss", .data =3D &msm8996_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 0ce84fcbbd25c7825212beb74073ffd4c70858a8..9da7f48f5dd762d27521d449051= 892e956693970 100644 --- a/drivers/media/platform/qcom/camss/camss.h +++ b/drivers/media/platform/qcom/camss/camss.h @@ -78,6 +78,7 @@ enum pm_domain { =20 enum camss_version { CAMSS_8x16, + CAMSS_8x53, CAMSS_8x96, CAMSS_660, CAMSS_845, --=20 2.47.0