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: 575896 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 1B0FAC4332F for ; Sun, 22 May 2022 16:28:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344669AbiEVQ20 (ORCPT ); Sun, 22 May 2022 12:28:26 -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-media@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: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: 575890 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 6CEDAC433F5 for ; Sun, 22 May 2022 16:30:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349800AbiEVQaZ (ORCPT ); Sun, 22 May 2022 12:30:25 -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-media@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: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: 575892 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 62D9EC433F5 for ; Sun, 22 May 2022 16:29:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350158AbiEVQ3X (ORCPT ); Sun, 22 May 2022 12:29:23 -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-media@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: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: 575894 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 63D66C38A06 for ; Sun, 22 May 2022 16:28:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349255AbiEVQ2l (ORCPT ); Sun, 22 May 2022 12:28:41 -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-media@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: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: 575893 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 7A450C433F5 for ; Sun, 22 May 2022 16:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349341AbiEVQ2m (ORCPT ); Sun, 22 May 2022 12:28:42 -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-media@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: 575891 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 CBCDEC43217 for ; Sun, 22 May 2022 16:30:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350172AbiEVQaC (ORCPT ); Sun, 22 May 2022 12:30:02 -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-media@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: 575895 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 23232C43217 for ; Sun, 22 May 2022 16:28:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349302AbiEVQ2g (ORCPT ); Sun, 22 May 2022 12:28:36 -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-media@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;