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: 575293 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 69C82C43219 for ; Sun, 22 May 2022 16:28:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245400AbiEVQ2Z (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: devicetree@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: 575292 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 0BCD7C41535 for ; Sun, 22 May 2022 16:28:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348285AbiEVQ22 (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: devicetree@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 --- 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: 575286 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 5E263C433EF for ; Sun, 22 May 2022 16:30:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349658AbiEVQaX (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: devicetree@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 --- 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: 575288 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 A53E1C43217 for ; Sun, 22 May 2022 16:29:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350073AbiEVQ3T (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: devicetree@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 --- 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: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: 575290 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 7F9BEC433EF for ; Sun, 22 May 2022 16:28:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349014AbiEVQ2c (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: devicetree@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: 575289 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 50421C4167D for ; Sun, 22 May 2022 16:28:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349168AbiEVQ2e (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: devicetree@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: 575287 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 2A78DC433F5 for ; Sun, 22 May 2022 16:30:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349760AbiEVQaA (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: devicetree@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: 575291 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 68EC6C433F5 for ; Sun, 22 May 2022 16:28:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348750AbiEVQ2b (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: devicetree@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;