From patchwork Sun May 22 16:27:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 575491 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB6F5C4167E for ; Sun, 22 May 2022 16:28:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346595AbiEVQ21 (ORCPT ); Sun, 22 May 2022 12:28:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243694AbiEVQ2X (ORCPT ); Sun, 22 May 2022 12:28:23 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FE2E14087; Sun, 22 May 2022 09:28:19 -0700 (PDT) Received: from g550jk.arnhem.chello.nl (a246182.upc-a.chello.nl [62.163.246.182]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 10579CCD2E; Sun, 22 May 2022 16:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1653236896; bh=EYhJQ3zWTulE41T2N72ykAggT09j3zyFPWoji/hdbwE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cNlA50cyRZbv+u0T2TeGH5BINL6PKlmu1z/myopBKlIvzl850rKwWDJ6wxCwzpJTC aIqL/bzephBRoMPWRBbml8k1m576+8kx2YY38YKQaburllRqFumfGXYJxr+7Q4ejdS mx7CK9AbwBxZDTocTa3hiZdDgLBVC3/wnxHYURkE= From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Loic Poulain , Robert Foss , Rob Herring , Krzysztof Kozlowski , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, matti.lehtimaki@gmail.com, Luca Weiss Subject: [RFC PATCH 01/14] media: dt-bindings: media: camss: Add qcom,msm8974-camss binding Date: Sun, 22 May 2022 18:27:49 +0200 Message-Id: <20220522162802.208275-2-luca@z3ntu.xyz> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220522162802.208275-1-luca@z3ntu.xyz> References: <20220522162802.208275-1-luca@z3ntu.xyz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Matti Lehtimäki Add bindings for qcom,msm8974-camss in order to support the camera subsystem on MSM8974. Signed-off-by: Matti Lehtimäki Signed-off-by: Luca Weiss --- .../bindings/media/qcom,msm8974-camss.yaml | 321 ++++++++++++++++++ 1 file changed, 321 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml diff --git a/Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml b/Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml new file mode 100644 index 000000000000..f8f71e477535 --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,msm8974-camss.yaml @@ -0,0 +1,321 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) + +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/media/qcom,msm8974-camss.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: Qualcomm CAMSS ISP + +maintainers: + - Robert Foss + +description: | + The CAMSS IP is a CSI decoder and ISP present on Qualcomm platforms + +properties: + compatible: + const: qcom,msm8974-camss + + clocks: + minItems: 31 + maxItems: 31 + + clock-names: + items: + - const: top_ahb + - const: ispif_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: csi3_ahb + - const: csi3 + - const: csi3_phy + - const: csi3_pix + - const: csi3_rdi + - const: vfe0 + - const: vfe1 + - const: csi_vfe0 + - const: csi_vfe1 + - const: iface + - const: bus + + interrupts: + minItems: 10 + maxItems: 10 + + interrupt-names: + items: + - const: csiphy0 + - const: csiphy1 + - const: csiphy2 + - const: csid0 + - const: csid1 + - const: csid2 + - const: csid3 + - const: ispif + - const: vfe0 + - const: vfe1 + + power-domains: + items: + - description: VFE GDSC - Video Front End, Global Distributed Switch 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: + clock-lanes: + items: + - const: 1 + + data-lanes: + minItems: 1 + maxItems: 4 + + required: + - clock-lanes + - 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: + clock-lanes: + items: + - const: 1 + + data-lanes: + minItems: 1 + maxItems: 4 + + required: + - clock-lanes + - 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: + clock-lanes: + items: + - const: 1 + + data-lanes: + minItems: 1 + maxItems: 4 + + required: + - clock-lanes + - data-lanes + + reg: + minItems: 14 + maxItems: 14 + + 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: csid3 + - 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 + - power-domains + - reg + - reg-names + - vdda-supply + +additionalProperties: false + +examples: + - | + #include + #include + #include + camss@fda00000 { + compatible = "qcom,msm8974-camss"; + reg = <0xfda0ac00 0x200>, + <0xfda00030 0x4>, + <0xfda0b000 0x200>, + <0xfda00038 0x4>, + <0xfda0b400 0x200>, + <0xfda00040 0x4>, + <0xfda08000 0x100>, + <0xfda08400 0x100>, + <0xfda08800 0x100>, + <0xfda08c00 0x100>, + <0xfda0a000 0x800>, + <0xfda00020 0x10>, + <0xfda10000 0x1000>, + <0xfda14000 0x1000>; + reg-names = "csiphy0", + "csiphy0_clk_mux", + "csiphy1", + "csiphy1_clk_mux", + "csiphy2", + "csiphy2_clk_mux", + "csid0", + "csid1", + "csid2", + "csid3", + "ispif", + "csi_clk_mux", + "vfe0", + "vfe1"; + interrupts = , + , + , + , + , + , + , + , + , + ; + interrupt-names = "csiphy0", + "csiphy1", + "csiphy2", + "csid0", + "csid1", + "csid2", + "csid3", + "ispif", + "vfe0", + "vfe1"; + power-domains = <&mmcc CAMSS_VFE_GDSC>; + clocks = <&mmcc CAMSS_TOP_AHB_CLK>, + <&mmcc CAMSS_ISPIF_AHB_CLK>, + <&mmcc CAMSS_PHY0_CSI0PHYTIMER_CLK>, + <&mmcc CAMSS_PHY1_CSI1PHYTIMER_CLK>, + <&mmcc CAMSS_PHY2_CSI2PHYTIMER_CLK>, + <&mmcc CAMSS_CSI0_AHB_CLK>, + <&mmcc CAMSS_CSI0_CLK>, + <&mmcc CAMSS_CSI0PHY_CLK>, + <&mmcc CAMSS_CSI0PIX_CLK>, + <&mmcc CAMSS_CSI0RDI_CLK>, + <&mmcc CAMSS_CSI1_AHB_CLK>, + <&mmcc CAMSS_CSI1_CLK>, + <&mmcc CAMSS_CSI1PHY_CLK>, + <&mmcc CAMSS_CSI1PIX_CLK>, + <&mmcc CAMSS_CSI1RDI_CLK>, + <&mmcc CAMSS_CSI2_AHB_CLK>, + <&mmcc CAMSS_CSI2_CLK>, + <&mmcc CAMSS_CSI2PHY_CLK>, + <&mmcc CAMSS_CSI2PIX_CLK>, + <&mmcc CAMSS_CSI2RDI_CLK>, + <&mmcc CAMSS_CSI3_AHB_CLK>, + <&mmcc CAMSS_CSI3_CLK>, + <&mmcc CAMSS_CSI3PHY_CLK>, + <&mmcc CAMSS_CSI3PIX_CLK>, + <&mmcc CAMSS_CSI3RDI_CLK>, + <&mmcc CAMSS_VFE_VFE0_CLK>, + <&mmcc CAMSS_VFE_VFE1_CLK>, + <&mmcc CAMSS_CSI_VFE0_CLK>, + <&mmcc CAMSS_CSI_VFE1_CLK>, + <&mmcc CAMSS_VFE_VFE_AHB_CLK>, + <&mmcc CAMSS_VFE_VFE_AXI_CLK>; + clock-names = "top_ahb", + "ispif_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", + "csi3_ahb", + "csi3", + "csi3_phy", + "csi3_pix", + "csi3_rdi", + "vfe0", + "vfe1", + "csi_vfe0", + "csi_vfe1", + "iface", + "bus"; + + vdda-supply = <&pm8941_l12>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + }; + }; From patchwork Sun May 22 16:27:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 575492 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AE2BC4167B for ; Sun, 22 May 2022 16:28:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245393AbiEVQ2Z (ORCPT ); Sun, 22 May 2022 12:28:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230260AbiEVQ2X (ORCPT ); Sun, 22 May 2022 12:28:23 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 806B61408A; Sun, 22 May 2022 09:28:19 -0700 (PDT) Received: from g550jk.arnhem.chello.nl (a246182.upc-a.chello.nl [62.163.246.182]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 58879CCD3E; Sun, 22 May 2022 16:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1653236896; bh=PJTM0T2EqEM4oY5oIkQuUA4VA97D2zu/UUBRa6M68wc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=xYrtyj7j9C76OnQ+SgcTjdSFWKZaxt2wg6vddfcVYzMdMBxW1LbThJwKacvPj6UGD 8YjiK4KQuxbDTTZ7KgsnclazwXG7uo+S+xwmBRCHBIa3iO1k9McB+EDz762I9c5pqo TXZlLKpbwtIPc4aI8f6jamg+8j60z4U8gZNqShUc= From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Loic Poulain , Robert Foss , Rob Herring , Krzysztof Kozlowski , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, matti.lehtimaki@gmail.com, Luca Weiss Subject: [RFC PATCH 02/14] media: camss: Add CAMSS_8x74 camss version Date: Sun, 22 May 2022 18:27:50 +0200 Message-Id: <20220522162802.208275-3-luca@z3ntu.xyz> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220522162802.208275-1-luca@z3ntu.xyz> References: <20220522162802.208275-1-luca@z3ntu.xyz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Matti Lehtimäki Add enum representing the MSM8x74 SOC. Signed-off-by: Matti Lehtimäki Signed-off-by: Luca Weiss Reviewed-by: Robert Foss --- drivers/media/platform/qcom/camss/camss.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/platform/qcom/camss/camss.h b/drivers/media/platform/qcom/camss/camss.h index c9b3e0df5be8..663cf24f52d9 100644 --- a/drivers/media/platform/qcom/camss/camss.h +++ b/drivers/media/platform/qcom/camss/camss.h @@ -76,6 +76,7 @@ enum pm_domain { enum camss_version { CAMSS_8x16, + CAMSS_8x74, CAMSS_8x96, CAMSS_660, CAMSS_845, From patchwork Sun May 22 16:27:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 575240 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C37BC433EF for ; Sun, 22 May 2022 16:28:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348254AbiEVQ22 (ORCPT ); Sun, 22 May 2022 12:28:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242277AbiEVQ2X (ORCPT ); Sun, 22 May 2022 12:28:23 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80A31140A5; Sun, 22 May 2022 09:28:19 -0700 (PDT) Received: from g550jk.arnhem.chello.nl (a246182.upc-a.chello.nl [62.163.246.182]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 9BD06CCD3F; Sun, 22 May 2022 16:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1653236896; bh=IFedgtBwp9D2KJuEP5HWLqXXyvyVv6MDZe6OMaClztA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=u1E75YC2lj5dxIsJOBIvz17uyyEXx8OSQOcZtalAIP3a0i/04ScLtRAdSmXysAJpt JUlBndwXYjqmCNHyBEOBmeVT7SK8QaIaaNhB44K/jE0VaP4zsJaHAHQSLyNqDyNPld hEI56rG80N+d92PeTjcocdlOScqjey6EuhARYS8A= From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Loic Poulain , Robert Foss , Rob Herring , Krzysztof Kozlowski , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, matti.lehtimaki@gmail.com, Luca Weiss Subject: [RFC PATCH 03/14] media: camss: vfe: Add support for 8x74 Date: Sun, 22 May 2022 18:27:51 +0200 Message-Id: <20220522162802.208275-4-luca@z3ntu.xyz> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220522162802.208275-1-luca@z3ntu.xyz> References: <20220522162802.208275-1-luca@z3ntu.xyz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Matti Lehtimäki VFE hardware modules on 8x74 and 8x16 are similar. Signed-off-by: Matti Lehtimäki Signed-off-by: Luca Weiss Reviewed-by: Robert Foss --- drivers/media/platform/qcom/camss/camss-vfe.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c index 5b148e9f8134..ace53ed24884 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -170,7 +170,8 @@ static u32 vfe_src_pad_code(struct vfe_line *line, u32 sink_code, { struct vfe_device *vfe = to_vfe(line); - if (vfe->camss->version == CAMSS_8x16) + if (vfe->camss->version == CAMSS_8x16 || + vfe->camss->version == CAMSS_8x74) switch (sink_code) { case MEDIA_BUS_FMT_YUYV8_2X8: { @@ -1286,6 +1287,7 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe, switch (camss->version) { case CAMSS_8x16: + case CAMSS_8x74: vfe->ops = &vfe_ops_4_1; break; case CAMSS_8x96: @@ -1390,7 +1392,8 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe, init_completion(&l->output.sof); init_completion(&l->output.reg_update); - if (camss->version == CAMSS_8x16) { + if (camss->version == CAMSS_8x16 || + camss->version == CAMSS_8x74) { if (i == VFE_LINE_PIX) { l->formats = formats_pix_8x16; l->nformats = ARRAY_SIZE(formats_pix_8x16); From patchwork Sun May 22 16:27:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 575234 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F431C433F5 for ; Sun, 22 May 2022 16:30:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349653AbiEVQaX (ORCPT ); Sun, 22 May 2022 12:30:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349480AbiEVQ3F (ORCPT ); Sun, 22 May 2022 12:29:05 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A0783B551; Sun, 22 May 2022 09:28:48 -0700 (PDT) Received: from g550jk.arnhem.chello.nl (a246182.upc-a.chello.nl [62.163.246.182]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id DF3D8CCD41; Sun, 22 May 2022 16:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1653236897; bh=qao02Sq/9rfFn0GElYrCHwPimBxw5VShTKS3u0yw8zE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=xlUs/1s3Z6pC+MeAA549gOsltzukgS/iZuCYgYnl4/1omqGPOaVa7z6VqUZ3JMyYQ oebR6NjZmBHTdydmmIZRPL3v2RO6IlKfegopA7Z+YwIhAkWhHC42OQjMJJa63Cq3Gu wlBh9BWlbUbxa4ESbL+dT8zTdz67Ta1fPtZaRU8U= From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Loic Poulain , Robert Foss , Rob Herring , Krzysztof Kozlowski , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, matti.lehtimaki@gmail.com, Luca Weiss Subject: [RFC PATCH 04/14] media: camss: video: Add support for 8x74 Date: Sun, 22 May 2022 18:27:52 +0200 Message-Id: <20220522162802.208275-5-luca@z3ntu.xyz> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220522162802.208275-1-luca@z3ntu.xyz> References: <20220522162802.208275-1-luca@z3ntu.xyz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Matti Lehtimäki Video formats in 8x16 and 8x74 are similar. Signed-off-by: Matti Lehtimäki Signed-off-by: Luca Weiss Reviewed-by: Robert Foss --- drivers/media/platform/qcom/camss/camss-video.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c index 307bb1dc4589..ca955808fd6d 100644 --- a/drivers/media/platform/qcom/camss/camss-video.c +++ b/drivers/media/platform/qcom/camss/camss-video.c @@ -990,7 +990,8 @@ int msm_video_register(struct camss_video *video, struct v4l2_device *v4l2_dev, mutex_init(&video->lock); - if (video->camss->version == CAMSS_8x16) { + if (video->camss->version == CAMSS_8x16 || + video->camss->version == CAMSS_8x74) { if (is_pix) { video->formats = formats_pix_8x16; video->nformats = ARRAY_SIZE(formats_pix_8x16); From patchwork Sun May 22 16:27:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 575487 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A139C433FE for ; Sun, 22 May 2022 16:29:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350129AbiEVQ3W (ORCPT ); Sun, 22 May 2022 12:29:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349885AbiEVQ3I (ORCPT ); Sun, 22 May 2022 12:29:08 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B13F83BA53; Sun, 22 May 2022 09:28:54 -0700 (PDT) Received: from g550jk.arnhem.chello.nl (a246182.upc-a.chello.nl [62.163.246.182]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 3925ACCD42; Sun, 22 May 2022 16:28:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1653236897; bh=Z+OJGa1Upy60KMZOvZpycQ7yyyNT0Zo+p/WeDLbPSN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=B6TZQEWkDFp+qwDk/WMeNG1Pq3VsYA8P2YgW7HoQUfFa+4yBek68T1mSJSD54IrqI Vrw0m1eJEVp70b3iWsWROGKkuAECPwruxRDTJMnS4ixTBqvWDR/MMFZZIhk4T/sAUe PeyYgAjkN00lTxvaLhggf+sPob5Epjy5IAaH46+c= From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Loic Poulain , Robert Foss , Rob Herring , Krzysztof Kozlowski , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, matti.lehtimaki@gmail.com, Luca Weiss Subject: [RFC PATCH 05/14] media: camss: csid: Add support for 8x74 Date: Sun, 22 May 2022 18:27:53 +0200 Message-Id: <20220522162802.208275-6-luca@z3ntu.xyz> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220522162802.208275-1-luca@z3ntu.xyz> References: <20220522162802.208275-1-luca@z3ntu.xyz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Matti Lehtimäki CSID hardware module on 8x74 is similar to 8x16. Signed-off-by: Matti Lehtimäki Signed-off-by: Luca Weiss Reviewed-by: Robert Foss --- drivers/media/platform/qcom/camss/camss-csid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/camss/camss-csid.c b/drivers/media/platform/qcom/camss/camss-csid.c index f993f349b66b..6b5cd9a66ff6 100644 --- a/drivers/media/platform/qcom/camss/camss-csid.c +++ b/drivers/media/platform/qcom/camss/camss-csid.c @@ -570,7 +570,8 @@ int msm_csid_subdev_init(struct camss *camss, struct csid_device *csid, csid->camss = camss; csid->id = id; - if (camss->version == CAMSS_8x16) { + if (camss->version == CAMSS_8x16 || + camss->version == CAMSS_8x74) { csid->ops = &csid_ops_4_1; } else if (camss->version == CAMSS_8x96 || camss->version == CAMSS_660) { From patchwork Sun May 22 16:27:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 575236 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B563CC4321E for ; Sun, 22 May 2022 16:29:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350045AbiEVQ3T (ORCPT ); Sun, 22 May 2022 12:29:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349890AbiEVQ3I (ORCPT ); Sun, 22 May 2022 12:29:08 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B11E73BA50; Sun, 22 May 2022 09:28:54 -0700 (PDT) Received: from g550jk.arnhem.chello.nl (a246182.upc-a.chello.nl [62.163.246.182]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 7BC2DCCD43; Sun, 22 May 2022 16:28:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1653236897; bh=2At8G2q3LHuRykZ6Y668fVjVpNTLR5aUfkn/gQ8Jpec=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BEBA6g/LXIN+5tIcPMB5cMQt77OxEOqeMiQzg5+O0rOb9J4ykcmSvIw+CT84syKf9 hlX/Vs+I+GXwrQdsC/jru8SykuClGTV5In1DBqDilc/7AnkflkKZjwWHJ2O0iZnlB2 KJHogfMDDQjJl3gFHzLnjk8oSGZGy3Ojr29BwD0g= From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Loic Poulain , Robert Foss , Rob Herring , Krzysztof Kozlowski , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, matti.lehtimaki@gmail.com, Luca Weiss Subject: [RFC PATCH 06/14] media: camss: ispif: Add support for 8x74 Date: Sun, 22 May 2022 18:27:54 +0200 Message-Id: <20220522162802.208275-7-luca@z3ntu.xyz> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220522162802.208275-1-luca@z3ntu.xyz> References: <20220522162802.208275-1-luca@z3ntu.xyz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Matti Lehtimäki ISPIF hardware modules on 8x74, 8x16 and 8x96 are similar. However on 8x74 the ISPIF routes data to two VFE hardware modules like 8x96 but formats are similar to 8x16. Signed-off-by: Matti Lehtimäki Signed-off-by: Luca Weiss Reviewed-by: Robert Foss --- drivers/media/platform/qcom/camss/camss-ispif.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/camss/camss-ispif.c b/drivers/media/platform/qcom/camss/camss-ispif.c index 4ee11bb979cd..693807bf3c6b 100644 --- a/drivers/media/platform/qcom/camss/camss-ispif.c +++ b/drivers/media/platform/qcom/camss/camss-ispif.c @@ -1112,6 +1112,7 @@ int msm_ispif_subdev_init(struct camss *camss, if (camss->version == CAMSS_8x16) ispif->line_num = 2; else if (camss->version == CAMSS_8x96 || + camss->version == CAMSS_8x74 || camss->version == CAMSS_660) ispif->line_num = 4; else @@ -1126,7 +1127,8 @@ int msm_ispif_subdev_init(struct camss *camss, ispif->line[i].ispif = ispif; ispif->line[i].id = i; - if (camss->version == CAMSS_8x16) { + if (camss->version == CAMSS_8x16 || + camss->version == CAMSS_8x74) { ispif->line[i].formats = ispif_formats_8x16; ispif->line[i].nformats = ARRAY_SIZE(ispif_formats_8x16); @@ -1163,6 +1165,7 @@ int msm_ispif_subdev_init(struct camss *camss, ret = devm_request_irq(dev, ispif->irq, ispif_isr_8x16, IRQF_TRIGGER_RISING, ispif->irq_name, ispif); else if (camss->version == CAMSS_8x96 || + camss->version == CAMSS_8x74 || camss->version == CAMSS_660) ret = devm_request_irq(dev, ispif->irq, ispif_isr_8x96, IRQF_TRIGGER_RISING, ispif->irq_name, ispif); From patchwork Sun May 22 16:27:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 575489 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 791B4C352A1 for ; Sun, 22 May 2022 16:28:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349251AbiEVQ2e (ORCPT ); Sun, 22 May 2022 12:28:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343882AbiEVQ20 (ORCPT ); Sun, 22 May 2022 12:28:26 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63E4F14087; Sun, 22 May 2022 09:28:24 -0700 (PDT) Received: from g550jk.arnhem.chello.nl (a246182.upc-a.chello.nl [62.163.246.182]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id C34B1CCD45; Sun, 22 May 2022 16:28:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1653236898; bh=Ja6UJLLoY69ioz4GOQEi4TAltPn6idOtLA6g2qiKj2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nQoPo+kWMh0sTGmyO7oSZmqILT/AjkkuNi3n2lxcFAXIu3edlnOSlZT5pubOWZd7p 7lL8ud7CFI9ZEmbZE36V8dYniEY7beFcqkw7tU4VKzdd/Cz6v5khZmgI8yeOT1CImk AeWU1y4ZbKSvjOPtlOh3oCg9uCLyqM1c2SzdEfpk= From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Loic Poulain , Robert Foss , Rob Herring , Krzysztof Kozlowski , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, matti.lehtimaki@gmail.com, Luca Weiss Subject: [RFC PATCH 07/14] media: camss: csiphy: Add support for 8x74 Date: Sun, 22 May 2022 18:27:55 +0200 Message-Id: <20220522162802.208275-8-luca@z3ntu.xyz> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220522162802.208275-1-luca@z3ntu.xyz> References: <20220522162802.208275-1-luca@z3ntu.xyz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Matti Lehtimäki CSIPHY hardware modules in 8x74 and 8x16 are similar. Signed-off-by: Matti Lehtimäki Signed-off-by: Luca Weiss Reviewed-by: Robert Foss --- drivers/media/platform/qcom/camss/camss-csiphy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c index 75fcfc627400..a0122705a874 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c @@ -557,7 +557,8 @@ int msm_csiphy_subdev_init(struct camss *camss, csiphy->id = id; csiphy->cfg.combo_mode = 0; - if (camss->version == CAMSS_8x16) { + if (camss->version == CAMSS_8x16 || + camss->version == CAMSS_8x74) { csiphy->ops = &csiphy_ops_2ph_1_0; csiphy->formats = csiphy_formats_8x16; csiphy->nformats = ARRAY_SIZE(csiphy_formats_8x16); @@ -582,6 +583,7 @@ int msm_csiphy_subdev_init(struct camss *camss, return PTR_ERR(csiphy->base); if (camss->version == CAMSS_8x16 || + camss->version == CAMSS_8x74 || camss->version == CAMSS_8x96) { csiphy->base_clk_mux = devm_platform_ioremap_resource_byname(pdev, res->reg[1]); From patchwork Sun May 22 16:27:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 575486 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D0E0C433FE for ; Sun, 22 May 2022 16:30:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349574AbiEVQaD (ORCPT ); Sun, 22 May 2022 12:30:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349889AbiEVQ3I (ORCPT ); Sun, 22 May 2022 12:29:08 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B14753BA54; Sun, 22 May 2022 09:28:54 -0700 (PDT) Received: from g550jk.arnhem.chello.nl (a246182.upc-a.chello.nl [62.163.246.182]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 18F5ACCD46; Sun, 22 May 2022 16:28:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1653236898; bh=u1MZC2pnHpWAI6AtgxHiNKZYOM6dKJrEx8uX2bfSBSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rFmkBXx0WlcC2JCL2QT04mcGu4/M3hH+NLStUSVk6M8v2FhZwr9jXUpoz7oibl3rq +ETKPF6Cm7MbFZ+4vHi9pWklXp2p8nhULI4VecVxZiBzkjaCPx+MLae36YQfvxFCQi 98Qym7d7h+7UK/iIq2keSzz4ysuXC4w+9/CVqcjk= From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Loic Poulain , Robert Foss , Rob Herring , Krzysztof Kozlowski , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, matti.lehtimaki@gmail.com, Luca Weiss Subject: [RFC PATCH 08/14] media: camss: Add 8x74 resources Date: Sun, 22 May 2022 18:27:56 +0200 Message-Id: <20220522162802.208275-9-luca@z3ntu.xyz> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220522162802.208275-1-luca@z3ntu.xyz> References: <20220522162802.208275-1-luca@z3ntu.xyz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Matti Lehtimäki Add structs with 8x74 resources. The number of CSIPHY, CSID and VFE hardware modules is the same as 8x96 but the support is otherwise different. Signed-off-by: Matti Lehtimäki Signed-off-by: Luca Weiss Reviewed-by: Robert Foss --- drivers/media/platform/qcom/camss/camss.c | 161 ++++++++++++++++++++++ 1 file changed, 161 insertions(+) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index 79ad82e233cb..5a69ce48c792 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -126,6 +126,154 @@ static const struct resources vfe_res_8x16[] = { } }; +static const struct resources csiphy_res_8974[] = { + /* CSIPHY0 */ + { + .regulators = { NULL }, + .clock = { "top_ahb", "ispif_ahb", "csiphy0_timer" }, + .clock_rate = { { 0 }, + { 0 }, + { 100000000, 200000000 } }, + .reg = { "csiphy0", "csiphy0_clk_mux" }, + .interrupt = { "csiphy0" } + }, + + /* CSIPHY1 */ + { + .regulators = { NULL }, + .clock = { "top_ahb", "ispif_ahb", "csiphy1_timer" }, + .clock_rate = { { 0 }, + { 0 }, + { 100000000, 200000000 } }, + .reg = { "csiphy1", "csiphy1_clk_mux" }, + .interrupt = { "csiphy1" } + }, + + /* CSIPHY2 */ + { + .regulators = { NULL }, + .clock = { "top_ahb", "ispif_ahb", "csiphy2_timer" }, + .clock_rate = { { 0 }, + { 0 }, + { 100000000, 200000000 } }, + .reg = { "csiphy2", "csiphy2_clk_mux" }, + .interrupt = { "csiphy2" } + } +}; + +static const struct resources csid_res_8974[] = { + /* CSID0 */ + { + .regulators = { "vdda" }, + .clock = { "top_ahb", "ispif_ahb", "csi0_ahb", + "csi0", "csi0_phy", "csi0_pix", "csi0_rdi" }, + .clock_rate = { { 0 }, + { 0 }, + { 0 }, + { 100000000, 200000000 }, + { 0 }, + { 0 }, + { 0 } }, + .reg = { "csid0" }, + .interrupt = { "csid0" } + }, + + /* CSID1 */ + { + .regulators = { "vdda" }, + .clock = { "top_ahb", "ispif_ahb", "csi1_ahb", + "csi1", "csi1_phy", "csi1_pix", "csi1_rdi" }, + .clock_rate = { { 0 }, + { 0 }, + { 0 }, + { 100000000, 200000000 }, + { 0 }, + { 0 }, + { 0 } }, + .reg = { "csid1" }, + .interrupt = { "csid1" } + }, + + /* CSID2 */ + { + .regulators = { "vdda" }, + .clock = { "top_ahb", "ispif_ahb", "csi2_ahb", + "csi2", "csi2_phy", "csi2_pix", "csi2_rdi" }, + .clock_rate = { { 0 }, + { 0 }, + { 0 }, + { 100000000, 200000000 }, + { 0 }, + { 0 }, + { 0 } }, + .reg = { "csid2" }, + .interrupt = { "csid2" } + }, + + /* CSID3 */ + { + .regulators = { "vdda" }, + .clock = { "top_ahb", "ispif_ahb", "csi3_ahb", + "csi3", "csi3_phy", "csi3_pix", "csi3_rdi" }, + .clock_rate = { { 0 }, + { 0 }, + { 0 }, + { 100000000, 200000000 }, + { 0 }, + { 0 }, + { 0 } }, + .reg = { "csid3" }, + .interrupt = { "csid3" } + } +}; + +static const struct resources_ispif ispif_res_8974 = { + /* ISPIF */ + .clock = { "top_ahb", "ispif_ahb", + "csi0", "csi0_pix", "csi0_rdi", + "csi1", "csi1_pix", "csi1_rdi", + "csi2", "csi2_pix", "csi2_rdi", + "csi3", "csi3_pix", "csi3_rdi" }, + .clock_for_reset = { "vfe0", "csi_vfe0", + "vfe1", "csi_vfe1" }, + .reg = { "ispif", "csi_clk_mux" }, + .interrupt = "ispif" + +}; + +static const struct resources vfe_res_8974[] = { + /* VFE0 */ + { + .regulators = { NULL }, + .clock = { "top_ahb", "vfe0", "csi_vfe0", + "iface", "bus" }, + .clock_rate = { { 0 }, + { 50000000, 80000000, 100000000, 160000000, + 177780000, 200000000, 266670000, 320000000, + 400000000, 400000000 }, + { 0 }, + { 0 }, + { 0 } }, + .reg = { "vfe0" }, + .interrupt = { "vfe0" } + }, + /* VFE1 */ + { + .regulators = { NULL }, + .clock = { "top_ahb", "vfe1", "csi_vfe1", + "iface", "bus" }, + .clock_rate = { { 0 }, + { 50000000, 80000000, 100000000, 160000000, + 177780000, 200000000, 266670000, 320000000, + 400000000, 400000000 }, + { 0 }, + { 0 }, + { 0 } }, + .reg = { "vfe1" }, + .interrupt = { "vfe1" } + } +}; + static const struct resources csiphy_res_8x96[] = { /* CSIPHY0 */ { @@ -1132,6 +1280,11 @@ static int camss_init_subdevices(struct camss *camss) csid_res = csid_res_8x16; ispif_res = &ispif_res_8x16; vfe_res = vfe_res_8x16; + } else if (camss->version == CAMSS_8x74) { + csiphy_res = csiphy_res_8974; + csid_res = csid_res_8974; + ispif_res = &ispif_res_8974; + vfe_res = vfe_res_8974; } else if (camss->version == CAMSS_8x96) { csiphy_res = csiphy_res_8x96; csid_res = csid_res_8x96; @@ -1542,6 +1695,12 @@ static int camss_probe(struct platform_device *pdev) camss->csiphy_num = 2; camss->csid_num = 2; camss->vfe_num = 1; + } else if (of_device_is_compatible(dev->of_node, + "qcom,msm8974-camss")) { + camss->version = CAMSS_8x74; + camss->csiphy_num = 3; + camss->csid_num = 4; + camss->vfe_num = 2; } else if (of_device_is_compatible(dev->of_node, "qcom,msm8996-camss")) { camss->version = CAMSS_8x96; @@ -1586,6 +1745,7 @@ static int camss_probe(struct platform_device *pdev) } if (camss->version == CAMSS_8x16 || + camss->version == CAMSS_8x74 || camss->version == CAMSS_8x96) { camss->ispif = devm_kcalloc(dev, 1, sizeof(*camss->ispif), GFP_KERNEL); if (!camss->ispif) { @@ -1735,6 +1895,7 @@ static int camss_remove(struct platform_device *pdev) static const struct of_device_id camss_dt_match[] = { { .compatible = "qcom,msm8916-camss" }, + { .compatible = "qcom,msm8974-camss" }, { .compatible = "qcom,msm8996-camss" }, { .compatible = "qcom,sdm660-camss" }, { .compatible = "qcom,sdm845-camss" }, From patchwork Sun May 22 16:27:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 575490 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2074FC38A2C for ; Sun, 22 May 2022 16:28:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239510AbiEVQ2b (ORCPT ); Sun, 22 May 2022 12:28:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344039AbiEVQ20 (ORCPT ); Sun, 22 May 2022 12:28:26 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8C821408F; Sun, 22 May 2022 09:28:24 -0700 (PDT) Received: from g550jk.arnhem.chello.nl (a246182.upc-a.chello.nl [62.163.246.182]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 63A4CCCD47; Sun, 22 May 2022 16:28:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1653236898; bh=CoTN//IFcGHJAD0zibGBr30oBzqXrd4ztzhciPGcdAQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=v/dN0W5j+weiTe/2/qSO5tq38/vu4DJVPBBtiqhYYE1TNQL2GXbkTxpX+HPYn2S0Z 1enz1FfKmkLGZY7Rrxc79UXYsTcknXf1LbYEeq7JXQAG9ie1y5twoNyPjzxKgaNkey 5ABGHm+J/XyXQxr9hL0LvVgyv5UoYocUk6ebL1qw= From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Loic Poulain , Robert Foss , Rob Herring , Krzysztof Kozlowski , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, matti.lehtimaki@gmail.com, Luca Weiss Subject: [RFC PATCH 09/14] dt-bindings: i2c: qcom-cci: add QCOM MSM8974 compatible Date: Sun, 22 May 2022 18:27:57 +0200 Message-Id: <20220522162802.208275-10-luca@z3ntu.xyz> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220522162802.208275-1-luca@z3ntu.xyz> References: <20220522162802.208275-1-luca@z3ntu.xyz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add the compatible for the CCI found in MSM8974 which supports two I2C masters. Signed-off-by: Luca Weiss --- Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt b/Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt index 924ad8c03464..166865e48849 100644 --- a/Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt +++ b/Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt @@ -7,6 +7,7 @@ PROPERTIES: Value type: Definition: must be one of: "qcom,msm8916-cci" + "qcom,msm8974-cci" "qcom,msm8996-cci" "qcom,sdm845-cci" "qcom,sm8250-cci" @@ -43,9 +44,9 @@ PROPERTIES: SUBNODES: -The CCI provides I2C masters for one (msm8916) or two i2c busses (msm8996, -sdm845, sm8250 and sm8450), described as subdevices named "i2c-bus@0" and -"i2c-bus@1". +The CCI provides I2C masters for one (msm8916) or two i2c busses (msm8974, +msm8996, sdm845, sm8250 and sm8450), described as subdevices named "i2c-bus@0" +and "i2c-bus@1". PROPERTIES: From patchwork Sun May 22 16:27:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 575488 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED939C433F5 for ; Sun, 22 May 2022 16:29:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349827AbiEVQ3R (ORCPT ); Sun, 22 May 2022 12:29:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349493AbiEVQ3L (ORCPT ); Sun, 22 May 2022 12:29:11 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B12813BA52; Sun, 22 May 2022 09:28:54 -0700 (PDT) Received: from g550jk.arnhem.chello.nl (a246182.upc-a.chello.nl [62.163.246.182]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id ABE17CCD48; Sun, 22 May 2022 16:28:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1653236898; bh=NwhpmevNUU2gq+eDnD+yz+ZmjE9TKPUK+80uSILSa24=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EtlqUowxpcRSB7A+wmr/ig8CW8R3ymUErisirN1xMvfb2w+UIfk6zIaQozo3mXtu5 HKGpfvkhdKw7yy1omR93Nt88DpyAUX3dGPeDcYGVdvcd8wxuJC83fjmYVe6pM8xNB1 aK4eqqiPIHPIQdYbR9QNi9HPMsC6w5vVGa6kXtBE= From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Loic Poulain , Robert Foss , Rob Herring , Krzysztof Kozlowski , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, matti.lehtimaki@gmail.com, Luca Weiss Subject: [RFC PATCH 10/14] i2c: qcom-cci: add msm8974 compatible Date: Sun, 22 May 2022 18:27:58 +0200 Message-Id: <20220522162802.208275-11-luca@z3ntu.xyz> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220522162802.208275-1-luca@z3ntu.xyz> References: <20220522162802.208275-1-luca@z3ntu.xyz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Matti Lehtimäki MSM8974 CCI is the same as MSM8916 except it has two masters. Signed-off-by: Matti Lehtimäki Signed-off-by: Luca Weiss Reviewed-by: Loic Poulain --- To note, the cci_v1_5_data variable name is just a bit arbitrary and isn't meant to reflect IP version "1.5". I'd be happy to change the variable name to something else. drivers/i2c/busses/i2c-qcom-cci.c | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c index 5c7cc862f08f..a68f17eb9dd0 100644 --- a/drivers/i2c/busses/i2c-qcom-cci.c +++ b/drivers/i2c/busses/i2c-qcom-cci.c @@ -725,6 +725,40 @@ static const struct cci_data cci_v1_data = { }, }; +static const struct cci_data cci_v1_5_data = { + .num_masters = 2, + .queue_size = { 64, 16 }, + .quirks = { + .max_write_len = 10, + .max_read_len = 12, + }, + .cci_clk_rate = 19200000, + .params[I2C_MODE_STANDARD] = { + .thigh = 78, + .tlow = 114, + .tsu_sto = 28, + .tsu_sta = 28, + .thd_dat = 10, + .thd_sta = 77, + .tbuf = 118, + .scl_stretch_en = 0, + .trdhld = 6, + .tsp = 1 + }, + .params[I2C_MODE_FAST] = { + .thigh = 20, + .tlow = 28, + .tsu_sto = 21, + .tsu_sta = 21, + .thd_dat = 13, + .thd_sta = 18, + .tbuf = 32, + .scl_stretch_en = 0, + .trdhld = 6, + .tsp = 3 + }, +}; + static const struct cci_data cci_v2_data = { .num_masters = 2, .queue_size = { 64, 16 }, @@ -773,6 +807,7 @@ static const struct cci_data cci_v2_data = { static const struct of_device_id cci_dt_match[] = { { .compatible = "qcom,msm8916-cci", .data = &cci_v1_data}, + { .compatible = "qcom,msm8974-cci", .data = &cci_v1_5_data}, { .compatible = "qcom,msm8996-cci", .data = &cci_v2_data}, { .compatible = "qcom,sdm845-cci", .data = &cci_v2_data}, { .compatible = "qcom,sm8250-cci", .data = &cci_v2_data}, From patchwork Sun May 22 16:27:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 575238 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BA7DC433FE for ; Sun, 22 May 2022 16:28:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349052AbiEVQ2c (ORCPT ); Sun, 22 May 2022 12:28:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344271AbiEVQ20 (ORCPT ); Sun, 22 May 2022 12:28:26 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8BBC1408A; Sun, 22 May 2022 09:28:24 -0700 (PDT) Received: from g550jk.arnhem.chello.nl (a246182.upc-a.chello.nl [62.163.246.182]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id F06CDCCD4A; Sun, 22 May 2022 16:28:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1653236899; bh=4jjVuNpN2waSexMIPI/UK5ASkvRcWOM8+vg3R0n1bME=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qk/znrqUl0dRNRrN37oWkvW+SmgwDzcJka9D6MVR/bOqhfiPWkpkKoc7hX6kybh+/ reJR/aOuWCzi7YGc0WFo9PseyzrbUA2wit0EZexBkPimudCU0ontFGHUVyTRImYcFl SpsHynJWihwSqPtlTDd3bzPrlgOUgDhGFeK1pA3I= From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Loic Poulain , Robert Foss , Rob Herring , Krzysztof Kozlowski , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, matti.lehtimaki@gmail.com, Luca Weiss Subject: [RFC PATCH 11/14] ARM: dts: qcom: msm8974: add CCI bus Date: Sun, 22 May 2022 18:27:59 +0200 Message-Id: <20220522162802.208275-12-luca@z3ntu.xyz> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220522162802.208275-1-luca@z3ntu.xyz> References: <20220522162802.208275-1-luca@z3ntu.xyz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add a node for the camera-specific i2c bus found on msm8974. Signed-off-by: Luca Weiss --- arch/arm/boot/dts/qcom-msm8974.dtsi | 62 +++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi index ffa6f874917a..a80b4ae71745 100644 --- a/arch/arm/boot/dts/qcom-msm8974.dtsi +++ b/arch/arm/boot/dts/qcom-msm8974.dtsi @@ -1434,6 +1434,34 @@ blsp2_i2c5_sleep: blsp2-i2c5-sleep { /* BLSP2_I2C6 info is missing - nobody uses it though? */ + cci0_default: cci0-default { + pins = "gpio19", "gpio20"; + function = "cci_i2c0"; + drive-strength = <2>; + bias-disable; + }; + + cci0_sleep: cci0-sleep { + pins = "gpio19", "gpio20"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + cci1_default: cci1-default { + pins = "gpio21", "gpio22"; + function = "cci_i2c1"; + drive-strength = <2>; + bias-disable; + }; + + cci1_sleep: cci1-sleep { + pins = "gpio21", "gpio22"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + spi8_default: spi8_default { mosi { pins = "gpio45"; @@ -1587,6 +1615,40 @@ dsi0_phy: dsi-phy@fd922a00 { }; }; + cci: cci@fda0c000 { + compatible = "qcom,msm8974-cci"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xfda0c000 0x1000>; + interrupts = ; + clocks = <&mmcc CAMSS_TOP_AHB_CLK>, + <&mmcc CAMSS_CCI_CCI_AHB_CLK>, + <&mmcc CAMSS_CCI_CCI_CLK>; + clock-names = "camss_top_ahb", + "cci_ahb", + "cci"; + + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&cci0_default &cci1_default>; + pinctrl-1 = <&cci0_sleep &cci1_sleep>; + + status = "disabled"; + + cci_i2c0: i2c-bus@0 { + reg = <0>; + clock-frequency = <400000>; + #address-cells = <1>; + #size-cells = <0>; + }; + + cci_i2c1: i2c-bus@1 { + reg = <1>; + clock-frequency = <400000>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + gpu: adreno@fdb00000 { compatible = "qcom,adreno-330.1", "qcom,adreno"; reg = <0xfdb00000 0x10000>; From patchwork Sun May 22 16:28:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 575237 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88654C38A04 for ; Sun, 22 May 2022 16:28:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349184AbiEVQ2e (ORCPT ); Sun, 22 May 2022 12:28:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344417AbiEVQ20 (ORCPT ); Sun, 22 May 2022 12:28:26 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0C26140AE; Sun, 22 May 2022 09:28:24 -0700 (PDT) Received: from g550jk.arnhem.chello.nl (a246182.upc-a.chello.nl [62.163.246.182]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 47E78CCD4B; Sun, 22 May 2022 16:28:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1653236899; bh=4TTxOmR2wLD3TeNU2SiNXSl4p2JhyoECNe34bUMzQIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=l/cbL+zaC68xLzqKUyYLHx7IVtKrbMU80WFEw3IwVKuFiIdHMuvanw5PDpzyb665q V+uqjXo12iGkdy6OYU1OXe6le5yZ1dVMKfyy/Rzh4gxmMRrwroqnyiYv3amtPrD4uU FpuYkJAxvAJ+qbrCElrsPGFB0kugBw59ghMFPGJc= From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Loic Poulain , Robert Foss , Rob Herring , Krzysztof Kozlowski , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, matti.lehtimaki@gmail.com, Luca Weiss Subject: [RFC PATCH 12/14] ARM: dts: qcom: msm8974: add CAMSS node Date: Sun, 22 May 2022 18:28:00 +0200 Message-Id: <20220522162802.208275-13-luca@z3ntu.xyz> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220522162802.208275-1-luca@z3ntu.xyz> References: <20220522162802.208275-1-luca@z3ntu.xyz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add a node for the camera subsystem found on msm8974. Signed-off-by: Luca Weiss --- arch/arm/boot/dts/qcom-msm8974.dtsi | 122 ++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi index a80b4ae71745..e684a9229f8c 100644 --- a/arch/arm/boot/dts/qcom-msm8974.dtsi +++ b/arch/arm/boot/dts/qcom-msm8974.dtsi @@ -1615,6 +1615,128 @@ dsi0_phy: dsi-phy@fd922a00 { }; }; + camss: camss@fda00000 { + compatible = "qcom,msm8974-camss"; + reg = <0xfda0ac00 0x200>, + <0xfda00030 0x4>, + <0xfda0b000 0x200>, + <0xfda00038 0x4>, + <0xfda0b400 0x200>, + <0xfda00040 0x4>, + <0xfda08000 0x100>, + <0xfda08400 0x100>, + <0xfda08800 0x100>, + <0xfda08c00 0x100>, + <0xfda0a000 0x800>, + <0xfda00020 0x10>, + <0xfda10000 0x1000>, + <0xfda14000 0x1000>; + reg-names = "csiphy0", + "csiphy0_clk_mux", + "csiphy1", + "csiphy1_clk_mux", + "csiphy2", + "csiphy2_clk_mux", + "csid0", + "csid1", + "csid2", + "csid3", + "ispif", + "csi_clk_mux", + "vfe0", + "vfe1"; + interrupts = , + , + , + , + , + , + , + , + , + ; + interrupt-names = "csiphy0", + "csiphy1", + "csiphy2", + "csid0", + "csid1", + "csid2", + "csid3", + "ispif", + "vfe0", + "vfe1"; + power-domains = <&mmcc CAMSS_VFE_GDSC>; + clocks = <&mmcc CAMSS_TOP_AHB_CLK>, + <&mmcc CAMSS_ISPIF_AHB_CLK>, + <&mmcc CAMSS_PHY0_CSI0PHYTIMER_CLK>, + <&mmcc CAMSS_PHY1_CSI1PHYTIMER_CLK>, + <&mmcc CAMSS_PHY2_CSI2PHYTIMER_CLK>, + <&mmcc CAMSS_CSI0_AHB_CLK>, + <&mmcc CAMSS_CSI0_CLK>, + <&mmcc CAMSS_CSI0PHY_CLK>, + <&mmcc CAMSS_CSI0PIX_CLK>, + <&mmcc CAMSS_CSI0RDI_CLK>, + <&mmcc CAMSS_CSI1_AHB_CLK>, + <&mmcc CAMSS_CSI1_CLK>, + <&mmcc CAMSS_CSI1PHY_CLK>, + <&mmcc CAMSS_CSI1PIX_CLK>, + <&mmcc CAMSS_CSI1RDI_CLK>, + <&mmcc CAMSS_CSI2_AHB_CLK>, + <&mmcc CAMSS_CSI2_CLK>, + <&mmcc CAMSS_CSI2PHY_CLK>, + <&mmcc CAMSS_CSI2PIX_CLK>, + <&mmcc CAMSS_CSI2RDI_CLK>, + <&mmcc CAMSS_CSI3_AHB_CLK>, + <&mmcc CAMSS_CSI3_CLK>, + <&mmcc CAMSS_CSI3PHY_CLK>, + <&mmcc CAMSS_CSI3PIX_CLK>, + <&mmcc CAMSS_CSI3RDI_CLK>, + <&mmcc CAMSS_VFE_VFE0_CLK>, + <&mmcc CAMSS_VFE_VFE1_CLK>, + <&mmcc CAMSS_CSI_VFE0_CLK>, + <&mmcc CAMSS_CSI_VFE1_CLK>, + <&mmcc CAMSS_VFE_VFE_AHB_CLK>, + <&mmcc CAMSS_VFE_VFE_AXI_CLK>; + clock-names = "top_ahb", + "ispif_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", + "csi3_ahb", + "csi3", + "csi3_phy", + "csi3_pix", + "csi3_rdi", + "vfe0", + "vfe1", + "csi_vfe0", + "csi_vfe1", + "iface", + "bus"; + + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + }; + }; + cci: cci@fda0c000 { compatible = "qcom,msm8974-cci"; #address-cells = <1>; From patchwork Sun May 22 16:28:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 575235 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56E26C4332F for ; Sun, 22 May 2022 16:30:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349773AbiEVQaA (ORCPT ); Sun, 22 May 2022 12:30:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349919AbiEVQ3N (ORCPT ); Sun, 22 May 2022 12:29:13 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1BE43BBC2; Sun, 22 May 2022 09:29:01 -0700 (PDT) Received: from g550jk.arnhem.chello.nl (a246182.upc-a.chello.nl [62.163.246.182]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id C260BCCD4C; Sun, 22 May 2022 16:28:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1653236900; bh=IgPmeXh7eVwr5HxZ2OomHFKNX8KpazVLkhoxxY0pExM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=c4i9i5n8jBgfDVKePplF1mJyCQ/ynI+kLQKvgP50y5sbU9Z1GPJ4G7mLcnnM7GTgB PpLG8h4PsyQxOiB4gL3hf4OMzvaZO3xtwgQEKbWVbnuvdRH3wE9xgAOtWoQUdEoIdk oDSbNoV9vWuSFXT1oSqjBubD2zua86FWq4HVTLlw= From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Loic Poulain , Robert Foss , Rob Herring , Krzysztof Kozlowski , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, matti.lehtimaki@gmail.com, Luca Weiss Subject: [RFC PATCH 13/14] ARM: dts: qcom: msm8974-FP2: Add OV8865 rear camera Date: Sun, 22 May 2022 18:28:01 +0200 Message-Id: <20220522162802.208275-14-luca@z3ntu.xyz> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220522162802.208275-1-luca@z3ntu.xyz> References: <20220522162802.208275-1-luca@z3ntu.xyz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Configure the rear camera found in the 8MP camera module for Fairphone 2. There's also a AD5823 autofocus coil and an EEPROM present on the module but currently not included. Signed-off-by: Luca Weiss --- .../dts/qcom-msm8974pro-fairphone-fp2.dts | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts b/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts index 0fad82fc9e03..9a2c3a9177de 100644 --- a/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts +++ b/arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts @@ -77,6 +77,60 @@ &blsp1_uart2 { status = "okay"; }; +&camss { + status = "okay"; + + vdda-supply = <&pm8941_l12>; + + ports { + port@0 { + reg = <0>; + csiphy0_ep: endpoint { + clock-lanes = <1>; + data-lanes = <0 2 3 4>; + link-frequencies = /bits/ 64 <360000000>; + remote-endpoint = <&ov8865_ep>; + }; + }; + }; +}; + +&cci { + status = "okay"; +}; + +&cci_i2c0 { + ov8865: camera-sensor@10 { + compatible = "ovti,ov8865"; + reg = <0x10>; + + pinctrl-names = "default"; + pinctrl-0 = <&mclk0_pin_a>; + + clocks = <&mmcc CAMSS_MCLK0_CLK>; + + avdd-supply = <&pm8941_l17>; + dovdd-supply = <&pm8941_lvs3>; + dvdd-supply = <&pm8941_l3>; + + powerdown-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>; + reset-gpios = <&tlmm 90 GPIO_ACTIVE_LOW>; + + /* Rear camera */ + orientation = <1>; + rotation = <90>; + + port { + ov8865_ep: endpoint { + clock-lanes = <1>; + data-lanes = <0 2 3 4>; + link-frequencies = /bits/ 64 <360000000>; + remote-endpoint = <&csiphy0_ep>; + }; + }; + }; +}; + &dsi0 { status = "okay"; @@ -413,6 +467,15 @@ pm8941_l24: l24 { regulator-max-microvolt = <3075000>; regulator-boot-on; }; + + pm8941_lvs3: lvs3 { + /* + * TODO: Used as CCI0 and CCI1 pull-up. + * Replace with vbus-supply or similar once this lands + * upstream! + */ + regulator-always-on; + }; }; }; @@ -449,6 +512,13 @@ &smbb { }; &tlmm { + mclk0_pin_a: mclk0-pin-active { + pins = "gpio15"; + function = "cam_mclk0"; + drive-strength = <2>; + bias-disable; + }; + panel_pin: panel { te { pins = "gpio12"; From patchwork Sun May 22 16:28:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 575239 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8D6DC43217 for ; Sun, 22 May 2022 16:28:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348704AbiEVQ2b (ORCPT ); Sun, 22 May 2022 12:28:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348017AbiEVQ22 (ORCPT ); Sun, 22 May 2022 12:28:28 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D4BB14087; Sun, 22 May 2022 09:28:27 -0700 (PDT) Received: from g550jk.arnhem.chello.nl (a246182.upc-a.chello.nl [62.163.246.182]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id 188C6CCD4E; Sun, 22 May 2022 16:28:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=z3ntu.xyz; s=z3ntu; t=1653236900; bh=ZlU+QqaeeUpgg6ydwdW9tHYSbBg1JjP1qdMb8cM8JSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hP3NdJf6PTBiI/nZloaHgFq06IVg0B4nvzxBOzwW1puRDXe7bq3v9VvUKjhtE3ZAn tWEeap2QOohVKt/BdbTAWCpfv23yPfccYqkUeOapjMPbABlc8d9MSEMG/Ru5uF5Zad P7JbsE9Np1pU1STE6hVEcHDsT0xZKNJGpJRN/uZ8= From: Luca Weiss To: linux-arm-msm@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Loic Poulain , Robert Foss , Rob Herring , Krzysztof Kozlowski , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, matti.lehtimaki@gmail.com, Luca Weiss Subject: [RFC PATCH 14/14] [DNM] media: camss: hacks for MSM8974 Date: Sun, 22 May 2022 18:28:02 +0200 Message-Id: <20220522162802.208275-15-luca@z3ntu.xyz> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220522162802.208275-1-luca@z3ntu.xyz> References: <20220522162802.208275-1-luca@z3ntu.xyz> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Remove IOMMU_DMA dependency from VIDEO_QCOM_CAMSS: We don't have IOMMU on msm8974 yet. DMA_SG -> DMA_CONTIG: Taking a photo without this works but is offset and doing weird stuff. Signed-off-by: Luca Weiss --- drivers/media/platform/qcom/camss/Kconfig | 4 ++-- drivers/media/platform/qcom/camss/camss-video.c | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/qcom/camss/Kconfig b/drivers/media/platform/qcom/camss/Kconfig index 4eda48cb1adf..e382fd77ecc3 100644 --- a/drivers/media/platform/qcom/camss/Kconfig +++ b/drivers/media/platform/qcom/camss/Kconfig @@ -2,8 +2,8 @@ config VIDEO_QCOM_CAMSS tristate "Qualcomm V4L2 Camera Subsystem driver" depends on V4L_PLATFORM_DRIVERS depends on VIDEO_DEV - depends on (ARCH_QCOM && IOMMU_DMA) || COMPILE_TEST + depends on ARCH_QCOM || COMPILE_TEST select MEDIA_CONTROLLER select VIDEO_V4L2_SUBDEV_API - select VIDEOBUF2_DMA_SG + select VIDEOBUF2_DMA_CONTIG select V4L2_FWNODE diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c index ca955808fd6d..885a809cc941 100644 --- a/drivers/media/platform/qcom/camss/camss-video.c +++ b/drivers/media/platform/qcom/camss/camss-video.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include "camss-video.h" #include "camss.h" @@ -410,15 +410,15 @@ static int video_buf_init(struct vb2_buffer *vb) vb); const struct v4l2_pix_format_mplane *format = &video->active_fmt.fmt.pix_mp; - struct sg_table *sgt; + //struct sg_table *sgt; unsigned int i; for (i = 0; i < format->num_planes; i++) { - sgt = vb2_dma_sg_plane_desc(vb, i); - if (!sgt) - return -EFAULT; + //sgt = vb2_dma_sg_plane_desc(vb, i); + //if (!sgt) + // return -EFAULT; - buffer->addr[i] = sg_dma_address(sgt->sgl); + buffer->addr[i] = vb2_dma_contig_plane_dma_addr(vb, i); //sg_dma_address(sgt->sgl); } if (format->pixelformat == V4L2_PIX_FMT_NV12 || @@ -966,7 +966,7 @@ int msm_video_register(struct camss_video *video, struct v4l2_device *v4l2_dev, q = &video->vb2_q; q->drv_priv = video; - q->mem_ops = &vb2_dma_sg_memops; + q->mem_ops = &vb2_dma_contig_memops; q->ops = &msm_video_vb2_q_ops; q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; q->io_modes = VB2_DMABUF | VB2_MMAP | VB2_READ;