From patchwork Tue May 24 14:02:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 575766 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 D542AC433F5 for ; Tue, 24 May 2022 14:02:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238078AbiEXOCR (ORCPT ); Tue, 24 May 2022 10:02:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231281AbiEXOCO (ORCPT ); Tue, 24 May 2022 10:02:14 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AA6841316 for ; Tue, 24 May 2022 07:02:13 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id c190-20020a1c35c7000000b0038e37907b5bso1503221wma.0 for ; Tue, 24 May 2022 07:02:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5mhXJbAqcgTA4KWN8H8AXnpke49ZRdi4wrpj76K6Kgc=; b=G4IYSvljgIaJ8D7CbXZ8ZTGNlBhC8ZJEkiFFe4/VgEZ4ayxT9sz/RUrl+u+mGqF6D7 pX+r4VIucEoGZ+xWS5l71vorfyTLIRDipriFyM7i08So4Po/MDdKVnLoHm0W3MF7d2Ja 8286NQ7ZOwCXSTklo9hRhkdd5b1DWPy55Tj6sDAn7W6jFeHYHC8hS/NBUVkBtiBvGZa7 kFKvZK8tWbOsCjcUIqhng4VhdIrW2mXtqFYEHaOFHlwkEqUdVS/SyHkplXO3bQ6BILAX tN85jZ6H5Yd/lLpipDHEItXggB1uewAL6vm4ew3kold8e3q9Lt1U+XCEUy9e6wN9pcBg sfqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5mhXJbAqcgTA4KWN8H8AXnpke49ZRdi4wrpj76K6Kgc=; b=z3DSW6Pg9YsxbvGmS3+JuYLUK192jmbZCkYl4d+zoQskbvUB1f4aCZYg5uEky/OnA2 LV/CW1PCG0hdWQ1BbP1HxUfJxv7HUJK5n7QcXrEfJ+tKARb6XEPEpHOZtSpK8xTHqgXq vFWofzMZpsFFXz0/ERdHjsSMKTyb/dn6hXdQGfNxtkAold+oE4TseIDgXEgrsLybrHkx LTYiPNOokBchH0V3AmDKXwCU431Pug+n8qObH65o5eFFVMv4y3GSi2ch/q4NII1wD+Zb eW+OF8WWWXdnM9fQWbZHo6FPlnSIzHxwCOZtpiiQg78if11WtQby8euxll5K/E8LCLSl pu3w== X-Gm-Message-State: AOAM533sBKVB3kVbUtXJHAcjzWkKt1qWG4bap1tpSlXow4MK5DryBsp6 f6bBI/lqeYKyaWmKCe06em5u5g== X-Google-Smtp-Source: ABdhPJxGjXM5D1+3NyM22sjywl+lIjmmgPdGLTImyxax0NR8FmreG4ZYBqLqU8ZJPz38USbY0UUT/Q== X-Received: by 2002:a05:600c:4fcc:b0:397:5a83:fac5 with SMTP id o12-20020a05600c4fcc00b003975a83fac5mr3435937wmq.107.1653400931852; Tue, 24 May 2022 07:02:11 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id f9-20020adfc989000000b0020c5253d8e0sm12829030wrh.44.2022.05.24.07.02.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 07:02:11 -0700 (PDT) From: Bryan O'Donoghue To: robert.foss@linaro.org, todor.too@gmail.com, agross@kernel.org, bjorn.andersson@linaro.org Cc: vladimir.zapolskiy@linaro.org, mchehab@kernel.org, robh+dt@kernel.org, krzk+dt@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mmitkov@quicinc.com, jgrahsl@snap.com, hfink@snap.com, Bryan O'Donoghue Subject: [PATCH v2 1/4] i2c: qcom-cci: Fix ordering of pm_runtime_xx and i2c_add_adapter Date: Tue, 24 May 2022 15:02:04 +0100 Message-Id: <20220524140207.2758605-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220524140207.2758605-1-bryan.odonoghue@linaro.org> References: <20220524140207.2758605-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org When we compile-in the CCI along with the imx412 driver and run on the RB5 we see that i2c_add_adapter() causes the probe of the imx412 driver to happen. This probe tries to perform an i2c xfer() and the xfer() in i2c-qcom-cci.c fails on pm_runtime_get() because the i2c-qcom-cci.c::probe() function has not completed to pm_runtime_enable(dev). Fix this sequence by ensuring pm_runtime_xxx() calls happen prior to adding the i2c adapter. Fixes: e517526195de ("i2c: Add Qualcomm CCI I2C driver") Reported-by: Vladimir Zapolskiy Signed-off-by: Bryan O'Donoghue --- drivers/i2c/busses/i2c-qcom-cci.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c index 5c7cc862f08f..90d02effeae9 100644 --- a/drivers/i2c/busses/i2c-qcom-cci.c +++ b/drivers/i2c/busses/i2c-qcom-cci.c @@ -638,6 +638,11 @@ static int cci_probe(struct platform_device *pdev) if (ret < 0) goto error; + pm_runtime_set_autosuspend_delay(dev, MSEC_PER_SEC); + pm_runtime_use_autosuspend(dev); + pm_runtime_set_active(dev); + pm_runtime_enable(dev); + for (i = 0; i < cci->data->num_masters; i++) { if (!cci->master[i].cci) continue; @@ -649,14 +654,13 @@ static int cci_probe(struct platform_device *pdev) } } - pm_runtime_set_autosuspend_delay(dev, MSEC_PER_SEC); - pm_runtime_use_autosuspend(dev); - pm_runtime_set_active(dev); - pm_runtime_enable(dev); - return 0; error_i2c: + pm_runtime_put(dev); + pm_runtime_disable(dev); + pm_runtime_dont_use_autosuspend(dev); + for (--i ; i >= 0; i--) { if (cci->master[i].cci) { i2c_del_adapter(&cci->master[i].adap); From patchwork Tue May 24 14:02:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 575765 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 0FC7FC433F5 for ; Tue, 24 May 2022 14:02:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238070AbiEXOCW (ORCPT ); Tue, 24 May 2022 10:02:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238079AbiEXOCR (ORCPT ); Tue, 24 May 2022 10:02:17 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13FA03FDBB for ; Tue, 24 May 2022 07:02:15 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id u27so25038544wru.8 for ; Tue, 24 May 2022 07:02:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sgUjeNlYCE2nYrQ7xP8GeK8Sj5Es/x6D2DUJducPl+M=; b=ULzV1Hc8Tsz7s8NR1qeuBqJZjnNMjGDsSk1eh67MSsDYWMG8uAWOUMzkGnIi9gLEqW aGx3UOuXgJXBr6Vq70q9DqLuFprSw+U/2Wbl5OuTdAxylt6/r9cz2HL+eh9Xq8RX52C+ p3GCYt4Fd1D2rti++gjT8J+qNF9awwCgu0Pm4D4ccrgYiXTF8OXAe+hyYKG5nyYB/v5g i2pGMs30/9plGElLHTRf9/rWOVbWfb2avMYoF8l/PsOa6doETPXO7bZBpV/O+6xgWBYs K01xufFo6SGSET0vnshmGF1XrlTdZiwtt+JKtT6zgX9lkpGISin62Jc4GpIy2PUUZz9D 4neA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sgUjeNlYCE2nYrQ7xP8GeK8Sj5Es/x6D2DUJducPl+M=; b=eU0+pOo/Qq1zsvWbqH+bqKMMzhuh7QKUpaQ7BDM54czND7iv/RkBE9UEVH53y1WlUa ptOyLh459kUf9efX6QTbIsKgQUEkiCr1H2NxmL2JXzgcOP9KoeZHT8SmYpAI7nrcihEC /ZL1f+gLTo3XJvhiFiB9nb6oIK5CzU1KrKk7rzZwpGdPIFildaIMg4eHKOIqOHY0CWet VScRElet+oVzfq9vFVO6QdZImymNoHOlTndCIZZftDDBq8p3/d0/n1Hpo6Ssjmqb+SID mreMH4yz4pRwYCuj81oP62IjiAr1qXQxyWaku3SzGDxhwj6N+D5rYKZ/d0NZKxtdxQ7S 7jog== X-Gm-Message-State: AOAM533gsOxt2J0c0afRoYBb6WxjrILJEIrVX5cQ9g2Rndvcjccw6++G kArLTVrTmrMpq1ICIKZ7fRlcTw== X-Google-Smtp-Source: ABdhPJyAzPo3Qyl20Ytz0mMvnvs68j4Zrn+qxWtypGt2QO0yt6mFQJz/zTX/wgyb7luUvzEQuf4FoQ== X-Received: by 2002:a5d:4529:0:b0:20d:1108:8d76 with SMTP id j9-20020a5d4529000000b0020d11088d76mr23186161wra.60.1653400933501; Tue, 24 May 2022 07:02:13 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id f9-20020adfc989000000b0020c5253d8e0sm12829030wrh.44.2022.05.24.07.02.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 07:02:12 -0700 (PDT) From: Bryan O'Donoghue To: robert.foss@linaro.org, todor.too@gmail.com, agross@kernel.org, bjorn.andersson@linaro.org Cc: vladimir.zapolskiy@linaro.org, mchehab@kernel.org, robh+dt@kernel.org, krzk+dt@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mmitkov@quicinc.com, jgrahsl@snap.com, hfink@snap.com, Bryan O'Donoghue Subject: [PATCH v2 2/4] arm64: dts: qcom: sm8250: Disable camcc by default Date: Tue, 24 May 2022 15:02:05 +0100 Message-Id: <20220524140207.2758605-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220524140207.2758605-1-bryan.odonoghue@linaro.org> References: <20220524140207.2758605-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Vladimir Zapolskiy At the moment there are no changes in SM8250 board files, which require camera clock controller to run, whenever it is needed for a particular board, the status of camcc device node will be changed in a board file. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Bryan O'Donoghue --- arch/arm64/boot/dts/qcom/sm8250.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi index cf0c97bd5ad3..2bc11cad3a44 100644 --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi @@ -3407,6 +3407,7 @@ camcc: clock-controller@ad00000 { clock-names = "iface", "bi_tcxo", "bi_tcxo_ao", "sleep_clk"; power-domains = <&rpmhpd SM8250_MMCX>; required-opps = <&rpmhpd_opp_low_svs>; + status = "disabled"; #clock-cells = <1>; #reset-cells = <1>; #power-domain-cells = <1>; From patchwork Tue May 24 14:02:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 576982 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 37EB1C4332F for ; Tue, 24 May 2022 14:02:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238111AbiEXOCX (ORCPT ); Tue, 24 May 2022 10:02:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238073AbiEXOCU (ORCPT ); Tue, 24 May 2022 10:02:20 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C6DA424A1 for ; Tue, 24 May 2022 07:02:16 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id z15so2025621wrg.11 for ; Tue, 24 May 2022 07:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iOhlZe5zCVmYqBGljaijQc2OGjPeMPWPgYrBs59bbm4=; b=yqKOOJqY/NOa/iYzr91FpndxRRx9L28WZXl4VwIAluIkeBoEN5QtTqOdRRA5K1i3Y3 41AV9MizZ1iqBTg0zSMFMXvKWA9TvsTx0y/wrqn3vvDa7k/zrIkLui3jUD/jNtYUXdyg x4d5D+6n5/ysmBqf7uSPG4Umkrw9mUiiAUkMIfCML6GqjHtLKETUWaXXYlMZCkv0Bq0d 06y2fPC8+jF3RqSzRUKJ4xBSOL9w/XDl54ln3H7uUGyD/2o1/rrkmohLOXD8fDRp3i+l Lt+hfkPWApIQndgCL0FsDntugNOeJE9pxNaa6Ipg6mY/bMzQNqv08MOLVvueXWTiu9Ne uspQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iOhlZe5zCVmYqBGljaijQc2OGjPeMPWPgYrBs59bbm4=; b=AgV/eI+noCLF4WCDrzweBdiK1tHoLdIWN9DQXAqfRjw3BOXZOd+hTV8Xd6dMMrA0PH J2X9twXg/WdZHtwkJlxsMp/DIArF84SWbhMl6UYAAVAhgOqcn65viZfb6x8DY3HBcw4/ c9eQBydlZGBcgl24J5Nvmb2gvSufRpyRB4mF83fUJj6vvL4Xdi8eNZTTMYqvLgc8ckkv bi0OpKx7qNFADG2zOwWL3GViF8ApTEb0dxEbVg2avdnWZot1gnb5G2sBKfpYVBwQsU+5 qkMCAK5it1MU2DEjJ4OkLf09M+5qIqs5z2qkl5rz8alJbRhFmLV+s0N1PD1toUoMhNbh 8zaA== X-Gm-Message-State: AOAM531gb7HgHSLSlyrzfkJZhP5k422TAzNUIrHkfpo8HcSD6Fpj9kVr /nHN+x/fjz0cVG93CEViVQiO6Q== X-Google-Smtp-Source: ABdhPJxsBiRddg1DEe4aG4uBTDCiR18r3Fl1JyKj2bcWFO70KrwQvBxG9nNeeflZ8giiCgi9HQw0Gw== X-Received: by 2002:adf:ffd2:0:b0:20e:60ec:c37b with SMTP id x18-20020adfffd2000000b0020e60ecc37bmr23149636wrs.348.1653400934754; Tue, 24 May 2022 07:02:14 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id f9-20020adfc989000000b0020c5253d8e0sm12829030wrh.44.2022.05.24.07.02.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 07:02:14 -0700 (PDT) From: Bryan O'Donoghue To: robert.foss@linaro.org, todor.too@gmail.com, agross@kernel.org, bjorn.andersson@linaro.org Cc: vladimir.zapolskiy@linaro.org, mchehab@kernel.org, robh+dt@kernel.org, krzk+dt@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mmitkov@quicinc.com, jgrahsl@snap.com, hfink@snap.com, Bryan O'Donoghue , Konrad Dybcio Subject: [PATCH v2 3/4] arm64: dts: qcom: sm8250: camss: Define ports address/size cells Date: Tue, 24 May 2022 15:02:06 +0100 Message-Id: <20220524140207.2758605-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220524140207.2758605-1-bryan.odonoghue@linaro.org> References: <20220524140207.2758605-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The ports {} address and size cells definition is the same for every derived 8250 board so, we should define it in the core sm8250.dtsi. Suggested-by: Konrad Dybcio Signed-off-by: Bryan O'Donoghue --- arch/arm64/boot/dts/qcom/sm8250.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi index 2bc11cad3a44..aa9a13364865 100644 --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi @@ -3395,6 +3395,11 @@ camss: camss@ac6a000 { "cam_hf_0_mnoc", "cam_sf_0_mnoc", "cam_sf_icp_mnoc"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + }; }; camcc: clock-controller@ad00000 { From patchwork Tue May 24 14:02:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 576981 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 1EFE1C433EF for ; Tue, 24 May 2022 14:02:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238072AbiEXOC1 (ORCPT ); Tue, 24 May 2022 10:02:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238084AbiEXOCV (ORCPT ); Tue, 24 May 2022 10:02:21 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 828A04476E for ; Tue, 24 May 2022 07:02:17 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id e2so14247762wrc.1 for ; Tue, 24 May 2022 07:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iXbAKg7nw/YPVpQzpMSW7CFDer8OTk9OFR3468QMlVU=; b=wRRSomMBWyLZtSm2GUksoxH8N5afcVR+fFJzKt0dzUhOp2edGNa6q92q+5LfkFoJIB c3wQ0YXdqN7uy65UARftVHRryTFY1eH/vM6a1zd+RXV3iM1rTQAmXvVMrsVJdKinpLxi 3Qg/FF7C9DXilpHYaMvGdzhqBOv9ycLVstHi0xl5cNPZgkYBMEeWHSwxkZwtw/zFlCHk Ziuby3RJsNzJNFcyut5fQzqotk2AweF9ErmV9rRrhP3rv8N2lhPMKmPygvjUdE0PrT9Z kYctfvfN7TfiPRjhtd52Eo+OpbD5V68MMTwnLEC6H7R27fqSwjcDoHaF5pWYUdQ3HDEy 1o9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iXbAKg7nw/YPVpQzpMSW7CFDer8OTk9OFR3468QMlVU=; b=59ZlxZJX29R8vOGCDn6IN6260aJ0rZszevQtPDOgr2FzDrl/qcjwROp9m+LoNrSHR9 AHZ1No7qa9AudEGuSQdkfzcT8ySzq6jCRVSlNKrtRehtIcxpx9vZW1SkSF4SlegBNC93 l2lpsEKe6zYQHfplEETMI6KbHaGJw2cvSj+HKRj5H9P4GP72JQL5epX2Zu9bVsjJxBnJ YQ+iY1G/9SDFaeELGEkZWy3bci9GxhHjz7Jwef991eQfDldl3LGJqebfK/eLFwAvtcrk IH73KIv+lXlc/AWFoOHpPjeBRHNXjG1bQJv1eAmqGdIrgQ7C0x8TK+U2ubi4qoIf7lNy AHSQ== X-Gm-Message-State: AOAM533QmmrLLGXjV4sFGOGq9U1mBr/3Fkus7xAJsFS9pmU5Si+F+dZX MJhIreYsfw95jA2en8Lqm9KrmA== X-Google-Smtp-Source: ABdhPJzRAOMMaVGBLAFkdiNofBhPnbs39YQqKXkic4KUDYR0N2nuJv43ZCMpgcG+fzpbHenTIJ+s6A== X-Received: by 2002:adf:d1ec:0:b0:20e:58c3:6998 with SMTP id g12-20020adfd1ec000000b0020e58c36998mr23067468wrd.280.1653400936241; Tue, 24 May 2022 07:02:16 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id f9-20020adfc989000000b0020c5253d8e0sm12829030wrh.44.2022.05.24.07.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 07:02:15 -0700 (PDT) From: Bryan O'Donoghue To: robert.foss@linaro.org, todor.too@gmail.com, agross@kernel.org, bjorn.andersson@linaro.org Cc: vladimir.zapolskiy@linaro.org, mchehab@kernel.org, robh+dt@kernel.org, krzk+dt@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, mmitkov@quicinc.com, jgrahsl@snap.com, hfink@snap.com, Bryan O'Donoghue Subject: [PATCH v2 4/4] arm64: dts: qcom: qrb5165-rb5: Enable the IMX577 on cam2 Date: Tue, 24 May 2022 15:02:07 +0100 Message-Id: <20220524140207.2758605-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220524140207.2758605-1-bryan.odonoghue@linaro.org> References: <20220524140207.2758605-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The IMX577 is on CCI1/CSI2 providing four lanes of camera data. An example media-ctl pipeline is: media-ctl --reset media-ctl -v -d /dev/media0 -V '"imx412 '20-001a'":0[fmt:SRGGB10/4056x3040 field:none]' media-ctl -V '"msm_csiphy2":0[fmt:SRGGB10/4056x3040]' media-ctl -V '"msm_csid0":0[fmt:SRGGB10/4056x3040]' media-ctl -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/4056x3040]' media-ctl -l '"msm_csiphy2":1->"msm_csid0":0[1]' media-ctl -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]' yavta -B capture-mplane -c -I -n 5 -f SRGGB10P -s 4056x3040 -F /dev/video0 Signed-off-by: Bryan O'Donoghue --- arch/arm64/boot/dts/qcom/qrb5165-rb5.dts | 60 ++++++++++++++++++++++++ arch/arm64/boot/dts/qcom/sm8250.dtsi | 33 +++++++++++++ 2 files changed, 93 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts index 0e63f707b911..756ddeb7530b 100644 --- a/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts +++ b/arch/arm64/boot/dts/qcom/qrb5165-rb5.dts @@ -1294,3 +1294,63 @@ &qup_spi0_data_clk { drive-strength = <6>; bias-disable; }; + +&camcc { + status = "okay"; +}; + +&camss { + status = "okay"; + vdda-phy-supply = <&vreg_l5a_0p88>; + vdda-pll-supply = <&vreg_l9a_1p2>; + + ports { + /* The port index denotes CSIPHY id i.e. csiphy2 */ + port@2 { + reg = <2>; + csiphy2_ep: endpoint { + clock-lanes = <7>; + data-lanes = <0 1 2 3>; + remote-endpoint = <&imx412_ep>; + }; + + }; + }; +}; + +&cci1 { + status = "okay"; +}; + +&cci1_i2c0 { + camera@1a { + /* + * rb5 ships with an imx577. camx code from qcom treats imx412 + * and imx577 the same way. Absent better data do the same here. + */ + compatible = "sony,imx412"; + reg = <0x1a>; + + reset-gpios = <&tlmm 78 GPIO_ACTIVE_LOW>; + pinctrl-names = "default", "suspend"; + pinctrl-0 = <&cam2_default>; + pinctrl-1 = <&cam2_suspend>; + + clocks = <&camcc CAM_CC_MCLK2_CLK>; + assigned-clocks = <&camcc CAM_CC_MCLK2_CLK>; + assigned-clock-rates = <24000000>; + + dovdd-supply = <&vreg_l7f_1p8>; + avdd-supply = <&vdc_5v>; + dvdd-supply = <&vdc_5v>; + + port { + imx412_ep: endpoint { + clock-lanes = <1>; + link-frequencies = /bits/ 64 <600000000>; + data-lanes = <1 2 3 4>; + remote-endpoint = <&csiphy2_ep>; + }; + }; + }; +}; diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi index aa9a13364865..2b65ec2806d0 100644 --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi @@ -3788,6 +3788,39 @@ tlmm: pinctrl@f100000 { gpio-ranges = <&tlmm 0 0 181>; wakeup-parent = <&pdc>; + cam2_default: cam2-default { + rst { + pins = "gpio78"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + mclk { + pins = "gpio96"; + function = "cam_mclk"; + drive-strength = <16>; + bias-disable; + }; + }; + + cam2_suspend: cam2-suspend { + rst { + pins = "gpio78"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + output-low; + }; + + mclk { + pins = "gpio96"; + function = "cam_mclk"; + drive-strength = <2>; + bias-disable; + }; + }; + cci0_default: cci0-default { cci0_i2c0_default: cci0-i2c0-default { /* SDA, SCL */