From patchwork Wed Oct 26 13:06:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 619371 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 71DE0FA373E for ; Wed, 26 Oct 2022 13:07:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233628AbiJZNHX (ORCPT ); Wed, 26 Oct 2022 09:07:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233044AbiJZNHV (ORCPT ); Wed, 26 Oct 2022 09:07:21 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3718FAE21C; Wed, 26 Oct 2022 06:07:18 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id bp11so25675177wrb.9; Wed, 26 Oct 2022 06:07:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nyVNISqKQi9jXd38wQpw8MDXfXd5f1BICV0pIG254pc=; b=U/tL7gRoPuAUkGJ6rjM8DuHdAsQkYwzQ6cXMYcI1bN3yzkj4m7DrrkVuRNujMOWmP6 cky4BTcDrY4w8N7ExDcfz4pdyc+/ir9rcUZUPfkW3atK5e2/NxqksC4tuVG5ylJ5DNSm Vg+W7KPYaPLk3oYsp8/+T34ReQ/w4itM5E9PQ+lVLArhrF58+g2QsMSsGwIKFTpzJe7W CR1kMgtPLTLanukzhavxHsRAexhFCOPruKYxK8f351dO0Boqjm9MUCZuVsUAeXQ71N6k G8+4gwGSKDlEM+m4Nonjj647CRiJzGW+x3wWq6FYln4NSQtZ8c6lKZVlMGXdAb2dE1sS Yd1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nyVNISqKQi9jXd38wQpw8MDXfXd5f1BICV0pIG254pc=; b=aUnSyTpD60+yMB7xEDFVmEcSPhCOcIJzz+kZxgPRHPg6hL1/BFdmyCK3VVSU7MwgDv AI7HnBpvZza0Ie0Kw2zZbIyN369yJbZ3Ng1L1hEL0wNlwiTCO0NfNiWu8it7g13YpDmK yeziIgAxgBbHduWo8rBW0c7m3OT8IxISSyQfgVK6IPaQgh4X/qySfqDxRSSKWbpmEqJ+ uNnQwZ/h5qQtxCv27seUyXcFK3ZYtYgrJb+gz6Q00v7K0jxHY82cXUr7AzU65geAZimE nA6fdIHpLGgb3hxHhg6161eDBA5bisyVR0PUxcTobOZ8mYPSObZ9iLjdjrO/MJDTfG+P mZrQ== X-Gm-Message-State: ACrzQf06N/5k2S0VBb83wMAFtxAAxF/BUPcmkiO3cPjDivAiSlQpJ8DP UI0ehJjrHK3kvsDdC+sfoGs= X-Google-Smtp-Source: AMsMyM6dkyokXKAuIfga7S2q7xmvYNtJBmrXeJK+/bn7qRQKvEt6c1fmeUaVN2JXqblEZTrTjUdFlQ== X-Received: by 2002:adf:e785:0:b0:236:5998:67a0 with SMTP id n5-20020adfe785000000b00236599867a0mr17412045wrm.414.1666789636745; Wed, 26 Oct 2022 06:07:16 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:cc:c67c:46e:319e]) by smtp.gmail.com with ESMTPSA id l3-20020adfa383000000b002366eb01e07sm5245433wrb.114.2022.10.26.06.07.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 06:07:16 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Geert Uytterhoeven , Magnus Damm , Hans Verkuil Cc: Shawn Tu , Jacopo Mondi , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Lad Prabhakar , Laurent Pinchart Subject: [PATCH v3 1/9] media: i2c: ov5645: Drop fetching the clk reference by name Date: Wed, 26 Oct 2022 14:06:50 +0100 Message-Id: <20221026130658.45601-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Lad Prabhakar The OV5645 sensor has a single clock source, so just drop fetching the clk reference by name. This is in preparation to drop the "clock-names" property from the DT binding. Suggested-by: Laurent Pinchart Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- v1->v3 * No change v1: https://patchwork.kernel.org/project/linux-media/patch/20220919143350.176746-1-prabhakar.mahadev-lad.rj@bp.renesas.com/ --- drivers/media/i2c/ov5645.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index 81e4e87e1821..47451238ca05 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -1090,7 +1090,7 @@ static int ov5645_probe(struct i2c_client *client) } /* get system clock (xclk) */ - ov5645->xclk = devm_clk_get(dev, "xclk"); + ov5645->xclk = devm_clk_get(dev, NULL); if (IS_ERR(ov5645->xclk)) { dev_err(dev, "could not get xclk"); return PTR_ERR(ov5645->xclk); From patchwork Wed Oct 26 13:06:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 619104 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 CC6DEFA3741 for ; Wed, 26 Oct 2022 13:07:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233845AbiJZNH3 (ORCPT ); Wed, 26 Oct 2022 09:07:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233044AbiJZNHZ (ORCPT ); Wed, 26 Oct 2022 09:07:25 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DA71FB701; Wed, 26 Oct 2022 06:07:19 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id c7-20020a05600c0ac700b003c6cad86f38so1451159wmr.2; Wed, 26 Oct 2022 06:07:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tf2UiB+zU3vDS2ZGfH6hKqDtwI6lpc4PY4He6vWYvz4=; b=aIxFQBtFoxypKmy5lP8Nk86z3bdDwR6XHd2uN35GLGvO4nMZmd2FErn67JwqbYpBWt +w/SOEytlOjUuruWyuUDKeVuPM/jN8PTP/9ZEg2L4iQGNe5RFifhUuM/B0PVNdYTa3aB RCuaRApl4YUM/Wh3oKFZ1ISx8D3j28ak+R9j1oXvWD/t3r7q4bg1r33D4LRyAXhS2f7O +Uu7eiwFTfBGK4z9rWApu8K8EQRNonxcVptAougeAOE+8JnGOnQVING/umzElmbhFOe3 xd2LrVB6wGxKCQ+OsP2QZ0gWCmePRIiaVFD181HMrWF9GloQ/YnJh/rzXHGkuJJ9FOJp PCsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tf2UiB+zU3vDS2ZGfH6hKqDtwI6lpc4PY4He6vWYvz4=; b=CoFFmPevnDSATjV0oR3Vv4JjZe5POZfaLZBKI4gOLtG8xKpkSkb1B1FSiChBFpAfop jh4Bgg0/gNr9uUTu6fdEuKmbYXNG6AUcQBqG6YCZqaJ5aImxCwU3jWBu6AYgV2msxEbZ gI+YtT6UIAl6gERFNpKZ6EkSD4fDJRwJx9esRxctzVKxayedu9mJidRBUfC/1EpvD/W6 8jMIrH4S/ytXnEZMoj+x3K9/lujOs7f6Qf26wAwnCe0+VaITfqH+gSDvSQxJkqxHuFiB MR+ia8G22K9stsEmzohB9fc7Atq05yotPAksgc69uJWxNrZbX1+WWXjhZgEIvpvmAhtg I+KA== X-Gm-Message-State: ACrzQf3Gjw+OqIv7qilpeZl6nM7STxJo2TcsFARaLUV+rAeh9VGN6jbK I053RTO9UgO2qvXObNxOaO0= X-Google-Smtp-Source: AMsMyM6nJq7LNPFc/VDVJBW42THSzVzYdGTV/smjB+OZhSvemg+8pvORx1sIduEukfTnMxeR5SiCpw== X-Received: by 2002:a05:600c:3548:b0:3c6:f7cb:1567 with SMTP id i8-20020a05600c354800b003c6f7cb1567mr2370839wmq.161.1666789638051; Wed, 26 Oct 2022 06:07:18 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:cc:c67c:46e:319e]) by smtp.gmail.com with ESMTPSA id l3-20020adfa383000000b002366eb01e07sm5245433wrb.114.2022.10.26.06.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 06:07:17 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Geert Uytterhoeven , Magnus Damm , Hans Verkuil Cc: Shawn Tu , Jacopo Mondi , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Lad Prabhakar Subject: [PATCH v3 2/9] ARM: dts: imx6qdl-pico: Drop clock-names property Date: Wed, 26 Oct 2022 14:06:51 +0100 Message-Id: <20221026130658.45601-3-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Lad Prabhakar Now that the driver has been updated to drop fetching the clk reference by name we no longer need the clock-names property in the ov5645 sensor node. This is in preparation for removal for clock-names property from the DT binding. Signed-off-by: Lad Prabhakar --- v3 * New patch --- arch/arm/boot/dts/imx6qdl-pico.dtsi | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/boot/dts/imx6qdl-pico.dtsi b/arch/arm/boot/dts/imx6qdl-pico.dtsi index f7a56d6b160c..c39a9ebdaba1 100644 --- a/arch/arm/boot/dts/imx6qdl-pico.dtsi +++ b/arch/arm/boot/dts/imx6qdl-pico.dtsi @@ -233,7 +233,6 @@ camera@3c { pinctrl-0 = <&pinctrl_ov5645>; reg = <0x3c>; clocks = <&clks IMX6QDL_CLK_CKO2>; - clock-names = "xclk"; clock-frequency = <24000000>; vdddo-supply = <®_1p8v>; vdda-supply = <®_2p8v>; From patchwork Wed Oct 26 13:06:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 619370 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 CE127FA3745 for ; Wed, 26 Oct 2022 13:07:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233650AbiJZNHZ (ORCPT ); Wed, 26 Oct 2022 09:07:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233633AbiJZNHX (ORCPT ); Wed, 26 Oct 2022 09:07:23 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1300CFB709; Wed, 26 Oct 2022 06:07:21 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id l32so10157156wms.2; Wed, 26 Oct 2022 06:07:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SIVy3GeRA5OkZZu6xDvDHdm1GOthqotFd5U/fgk56CY=; b=PC0PsXNpaGDc04Hd6MeOzRXUfr7dc58xEoLjm25RZbla2XenW7dqPyzgi4Ybnnr6PB Y7sQA9NPE9i+gORdw2J7k3jx1VIG8uBbhJzMFxLM0sJP5b2yu9C4T8iux39YOJgLAAzg 7S2TA1vaSGvXt2nyD4qDUO0qiyRKvyVMOoQyucHEQIaKMmd94+ocFfAIwrY4P88CAkis qpawzaU+7sYnMSCHJj4xNV0DftzA8w7jSZtCw+V+RuWKylc2ERdre6pYkyhhUoszd3ju 1lNDoq13+5THiZSh2N/hAlSBPqxEnH+rdseCpYVQt/j4P/Muld2eHZ29QMl519j2y5cx GgAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SIVy3GeRA5OkZZu6xDvDHdm1GOthqotFd5U/fgk56CY=; b=wsf1IaPNHeayyikFaj1oRzv+EHdCrsOifespcW4qsn8kYWBfJy/YrmY9Q7flRl92Nh WZ1csSIio76bHupnst/hMQQ9CXJwNl7CZBhE+YAm9XIEOKWdJwuXnBbiiPxA831MeC2U d+BRJqiMdAtgIgTt9yx9ydA+jxc0idnI3FbsjGGeKh3LvqSaM7xuAGXEz4TmfFd0PUU5 d2EfU2sM2sS+XWkL+ZxkwX4FKDUvjcijHkEXMSiaC2wwiLS75QD8ALWUXi1RQ+6hp3cI VvzQQosePayUhJc8makXMBDHWa9gDgnghKS+7dqG4JJ069Q0iymSQl4TIWK+mjxzjw7O 2VAA== X-Gm-Message-State: ACrzQf0aMq/ptDVArPtJ4Die0SQ+yDCO1SCdM+6FPa/wtGQ0rGQXIJv9 huM14KnaBwGLY0jl9av+LPs= X-Google-Smtp-Source: AMsMyM6BXVgmVVcTF7eixvSAbS1wL0OVZiVY3Q/JhtfJEZVGiXULG1OOLs18zbfllXGuFtCIDsZHKg== X-Received: by 2002:a05:600c:154a:b0:3c9:f0df:1cc with SMTP id f10-20020a05600c154a00b003c9f0df01ccmr2417925wmg.200.1666789639448; Wed, 26 Oct 2022 06:07:19 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:cc:c67c:46e:319e]) by smtp.gmail.com with ESMTPSA id l3-20020adfa383000000b002366eb01e07sm5245433wrb.114.2022.10.26.06.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 06:07:18 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Geert Uytterhoeven , Magnus Damm , Hans Verkuil Cc: Shawn Tu , Jacopo Mondi , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Lad Prabhakar Subject: [PATCH v3 3/9] ARM: dts: imx6qdl-wandboard: Drop clock-names property Date: Wed, 26 Oct 2022 14:06:52 +0100 Message-Id: <20221026130658.45601-4-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Lad Prabhakar Now that the driver has been updated to drop fetching the clk reference by name we no longer need the clock-names property in the ov5645 sensor node. This is in preparation for removal for clock-names property from the DT binding. Signed-off-by: Lad Prabhakar --- v3 * New patch --- arch/arm/boot/dts/imx6qdl-wandboard.dtsi | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/boot/dts/imx6qdl-wandboard.dtsi b/arch/arm/boot/dts/imx6qdl-wandboard.dtsi index ec6fba5ee8fd..e4f63423d8ee 100644 --- a/arch/arm/boot/dts/imx6qdl-wandboard.dtsi +++ b/arch/arm/boot/dts/imx6qdl-wandboard.dtsi @@ -131,7 +131,6 @@ camera@3c { pinctrl-0 = <&pinctrl_ov5645>; reg = <0x3c>; clocks = <&clks IMX6QDL_CLK_CKO2>; - clock-names = "xclk"; clock-frequency = <24000000>; vdddo-supply = <®_1p8v>; vdda-supply = <®_2p8v>; From patchwork Wed Oct 26 13:06:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 619369 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 07F9CFA3743 for ; Wed, 26 Oct 2022 13:07:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233607AbiJZNH2 (ORCPT ); Wed, 26 Oct 2022 09:07:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233783AbiJZNHZ (ORCPT ); Wed, 26 Oct 2022 09:07:25 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 423FAAE21C; Wed, 26 Oct 2022 06:07:22 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id v130-20020a1cac88000000b003bcde03bd44so1439333wme.5; Wed, 26 Oct 2022 06:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GE9e2apMACasyKGOaqFNr+Yuli9PwHdn/ViP61o5ChA=; b=DzuBSWVlLD7Oq2PImHUCrXgRbDGGp9aYU77BavLFQ3bCrrGI08yyDVWeHV2bS2gDS5 hOwzt8ovcCCRrwSqXCUvkeUJapL5tfr7FjzKiTZfYYXHj2MrGVM7593qH0kodTEUDT25 +J4OIQVXYJBc63ts7t/LtzOPKmx4zRHSRiIyOjnB5VIoNledCy4or+AOj444a/6LyEXt hPY3vXkLIK/DUZvA+aY78X5kHZy4Dca81o7U8lI63zBPteba+6PBo59xjkO+IZvF/40s NZGO9Bd3b8NcKtSi8+OVeX/c63kVVERbll9Mg/a93JP6Zl0FVS397/Q9+UtO4plX+cdl pm/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GE9e2apMACasyKGOaqFNr+Yuli9PwHdn/ViP61o5ChA=; b=vuejZa3jEQ4/6/yeX4KQuJ1rHNAUU7ojU8ztxZJbx6KUU/6a1Ub+8qRTcCKXh+p3qS YtRgrZgyo972F68e5puou+Yh5kVaIwhNlLZKf7zVZ/IaVU+WRrATi1FkAQyp9Zc6RTSV vXeI8u+BCij42IfB4Z6VAYYmtl5BlFn4ZibEm2OPccDpWXsMSWktZrS2zY4XAYrwpsya yGexymHlKT93Ym0VMbSlAG+WG0sEZKmHkeoAiHNPdVBgo9drU5gOTFfnTy8UVz/jePVq IBk9hkIukJsW6WFQqlHfEd+zrNfoQqwmQHkyj5gU5NP/fkH+J3qMJNLE5qqtbzFMANYy DWIw== X-Gm-Message-State: ACrzQf3pr+fJ+TBYH2I9q5PeklfAzjGaGCgAn60vSL/dUlPIPaTEN9S1 qNtLIziDKRtqG+f7+Du+Eqc= X-Google-Smtp-Source: AMsMyM4Wy+0BYeCpFF6l/kAV/9w1zSxx1LDnrH0dVe7Zmx/8AAQcEx+931gBjxR0/Tk1Xj4ND8ACxg== X-Received: by 2002:a05:600c:46ca:b0:3c6:f3e3:df99 with SMTP id q10-20020a05600c46ca00b003c6f3e3df99mr2409066wmo.77.1666789640706; Wed, 26 Oct 2022 06:07:20 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:cc:c67c:46e:319e]) by smtp.gmail.com with ESMTPSA id l3-20020adfa383000000b002366eb01e07sm5245433wrb.114.2022.10.26.06.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 06:07:20 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Geert Uytterhoeven , Magnus Damm , Hans Verkuil Cc: Shawn Tu , Jacopo Mondi , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Lad Prabhakar Subject: [PATCH v3 4/9] arm64: dts: renesas: aistarvision-mipi-adapter-2.1: Drop clock-names property Date: Wed, 26 Oct 2022 14:06:53 +0100 Message-Id: <20221026130658.45601-5-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Lad Prabhakar Now that the driver has been updated to drop fetching the clk reference by name we no longer need the clock-names property in the ov5645 sensor node. This is in preparation for removal for clock-names property from the DT binding. Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven --- v3 * New patch --- arch/arm64/boot/dts/renesas/aistarvision-mipi-adapter-2.1.dtsi | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm64/boot/dts/renesas/aistarvision-mipi-adapter-2.1.dtsi b/arch/arm64/boot/dts/renesas/aistarvision-mipi-adapter-2.1.dtsi index 7ce986f0a06f..7cb5c958aece 100644 --- a/arch/arm64/boot/dts/renesas/aistarvision-mipi-adapter-2.1.dtsi +++ b/arch/arm64/boot/dts/renesas/aistarvision-mipi-adapter-2.1.dtsi @@ -65,7 +65,6 @@ &MIPI_OV5645_PARENT_I2C { ov5645: ov5645@3c { compatible = "ovti,ov5645"; reg = <0x3c>; - clock-names = "xclk"; clocks = <&osc25250_clk>; clock-frequency = <24000000>; vdddo-supply = <&ov5645_vdddo_1v8>; From patchwork Wed Oct 26 13:06:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 619105 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 90F92C433FE for ; Wed, 26 Oct 2022 13:07:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233807AbiJZNH1 (ORCPT ); Wed, 26 Oct 2022 09:07:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233743AbiJZNHY (ORCPT ); Wed, 26 Oct 2022 09:07:24 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83A99FAA54; Wed, 26 Oct 2022 06:07:23 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id c7-20020a05600c0ac700b003c6cad86f38so1451308wmr.2; Wed, 26 Oct 2022 06:07:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lDixN45FQzRM4eL6eFYAjPKPemRI5INigTEGaTugYlA=; b=onkP9wdppZZacCT6Z9KKGtpAWE+hslCjl6YmzVIV0SCNTZAGYAqabtJiPPq5nVtkBz MmwQ7FtZFJ/uCrJs6mpT7Ow4hYymSAFoVB/L3ZampIybWfuCyYhYc7EhIPjJOXdCMKq9 fo5dCcibav3Rz8BxGsT+FOeJQFkJt8eaU6NuVuLWdOVYKyfo8wmvwI/TZC1QtPeFJ/9B +p7XHwFWg0ml3j/2mF4B3n4PX5XwbrhFQ4iIrKjcKT8YiirHgQ5gMcYYx+cKLzUW5nP1 x2fHhDPNIREUtXh8H9BKvxnzSxkf5hm0MEadc2Segk0KtSUWt1CHfrianxt9vFcA6VSf ACUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lDixN45FQzRM4eL6eFYAjPKPemRI5INigTEGaTugYlA=; b=cQtjkRqobnk3+hnxRme2ptPMgNvOD1Sz9TUoSfa4aE7fd1uWFwHXyq6OTYN5gVV4Si K5oH3F0q0wo7zMUvw0pJPyGdqZq8gj3Pu1txQpILTQn4aVyseJkgO9609wAus0fbDkmt c5h11kDO3gQOqLcw/LGfQNFMFDOw05RGUmgIy8QMh77vh0PprDereiSVHqsNsqlvIlD7 AXMbNFM9xY4s3g8WaAI4vrQijy8oSHsfQrw2ZrSWiJQIfXM5ASyrzdhrhEp3jxKK7z27 v53uFPQLUhiSv+xT31TwFvf1LDmX36bSH6vwTomwXgEwokWk0DBjtIiVvA5/K8Gy1oOP emYw== X-Gm-Message-State: ACrzQf2nzv0k1CMqe8FKvCG/vo3qNqAlkPujSkgHCA+Aoc5++TtAxElK Kb0Ef/yHGVmd6Jh3QKm64KI= X-Google-Smtp-Source: AMsMyM6u3Ye4gpQjONstdTJ8pbIJLJ8JFwU1jCjEQHFkurGFdJDlBdIiAzEQwwDWp2PlKdE9AGwhNQ== X-Received: by 2002:a05:600c:474a:b0:3c6:ff98:624c with SMTP id w10-20020a05600c474a00b003c6ff98624cmr2450917wmo.26.1666789641895; Wed, 26 Oct 2022 06:07:21 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:cc:c67c:46e:319e]) by smtp.gmail.com with ESMTPSA id l3-20020adfa383000000b002366eb01e07sm5245433wrb.114.2022.10.26.06.07.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 06:07:21 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Geert Uytterhoeven , Magnus Damm , Hans Verkuil Cc: Shawn Tu , Jacopo Mondi , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Lad Prabhakar Subject: [PATCH v3 5/9] media: dt-bindings: ov5645: Convert OV5645 binding to a schema Date: Wed, 26 Oct 2022 14:06:54 +0100 Message-Id: <20221026130658.45601-6-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Lad Prabhakar Convert the simple OV5645 Device Tree binding to json-schema. The previous binding marked the below properties as required which was a driver requirement and not the device requirement so just drop them from the required list during the conversion. - clock-frequency - enable-gpios - reset-gpios Also drop the "clock-names" property as we have a single clock source for the sensor and the driver has been updated to drop the clk referencing by name. Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- Resend v3: * No change v2 -> v3 * Dropped clock-names property * Marked power supplies as mandatory * Dropped the comment for voltage power supplies * Included RB tag from Laurent * Driver change to drop clock-names [0] [0] https://lore.kernel.org/linux-media/Yyh%2F3uzOJOu3drEB@pendragon.ideasonboard.com/T/#t v1 -> v2 * Dropped ref to video-interface-devices.yaml# * Dropped driver specific required items from the list * Updated commit message * Dropped clock-lanes and bus-type from the port and example node * Marked data-lanes as required in port node --- .../devicetree/bindings/media/i2c/ov5645.txt | 54 --------- .../bindings/media/i2c/ovti,ov5645.yaml | 104 ++++++++++++++++++ 2 files changed, 104 insertions(+), 54 deletions(-) delete mode 100644 Documentation/devicetree/bindings/media/i2c/ov5645.txt create mode 100644 Documentation/devicetree/bindings/media/i2c/ovti,ov5645.yaml diff --git a/Documentation/devicetree/bindings/media/i2c/ov5645.txt b/Documentation/devicetree/bindings/media/i2c/ov5645.txt deleted file mode 100644 index 72ad992f77be..000000000000 --- a/Documentation/devicetree/bindings/media/i2c/ov5645.txt +++ /dev/null @@ -1,54 +0,0 @@ -* Omnivision 1/4-Inch 5Mp CMOS Digital Image Sensor - -The Omnivision OV5645 is a 1/4-Inch CMOS active pixel digital image sensor with -an active array size of 2592H x 1944V. It is programmable through a serial I2C -interface. - -Required Properties: -- compatible: Value should be "ovti,ov5645". -- clocks: Reference to the xclk clock. -- clock-names: Should be "xclk". -- clock-frequency: Frequency of the xclk clock. -- enable-gpios: Chip enable GPIO. Polarity is GPIO_ACTIVE_HIGH. This corresponds - to the hardware pin PWDNB which is physically active low. -- reset-gpios: Chip reset GPIO. Polarity is GPIO_ACTIVE_LOW. This corresponds to - the hardware pin RESETB. -- vdddo-supply: Chip digital IO regulator. -- vdda-supply: Chip analog regulator. -- vddd-supply: Chip digital core regulator. - -The device node must contain one 'port' child node for its digital output -video port, in accordance with the video interface bindings defined in -Documentation/devicetree/bindings/media/video-interfaces.txt. - -Example: - - &i2c1 { - ... - - ov5645: ov5645@3c { - compatible = "ovti,ov5645"; - reg = <0x3c>; - - enable-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>; - reset-gpios = <&gpio5 20 GPIO_ACTIVE_LOW>; - pinctrl-names = "default"; - pinctrl-0 = <&camera_rear_default>; - - clocks = <&clks 200>; - clock-names = "xclk"; - clock-frequency = <24000000>; - - vdddo-supply = <&camera_dovdd_1v8>; - vdda-supply = <&camera_avdd_2v8>; - vddd-supply = <&camera_dvdd_1v2>; - - port { - ov5645_ep: endpoint { - clock-lanes = <1>; - data-lanes = <0 2>; - remote-endpoint = <&csi0_ep>; - }; - }; - }; - }; diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov5645.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov5645.yaml new file mode 100644 index 000000000000..0b10483cd267 --- /dev/null +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov5645.yaml @@ -0,0 +1,104 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/i2c/ovti,ov5645.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: OmniVision OV5645 Image Sensor Device Tree Bindings + +maintainers: + - Lad Prabhakar + +properties: + compatible: + const: ovti,ov5645 + + reg: + maxItems: 1 + + clocks: + description: XCLK Input Clock + + clock-frequency: + description: Frequency of the xclk clock in Hz. + + vdda-supply: + description: Analog voltage supply, 2.8 volts + + vddd-supply: + description: Digital core voltage supply, 1.5 volts + + vdddo-supply: + description: Digital I/O voltage supply, 1.8 volts + + enable-gpios: + maxItems: 1 + description: + Reference to the GPIO connected to the PWDNB pin, if any. + + reset-gpios: + maxItems: 1 + description: + Reference to the GPIO connected to the RESETB pin, if any. + + port: + description: Digital Output Port + $ref: /schemas/graph.yaml#/$defs/port-base + additionalProperties: false + + properties: + endpoint: + $ref: /schemas/media/video-interfaces.yaml# + unevaluatedProperties: false + + properties: + data-lanes: + minItems: 1 + maxItems: 2 + items: + enum: [1, 2] + + required: + - data-lanes + +required: + - compatible + - reg + - clocks + - vdddo-supply + - vdda-supply + - vddd-supply + - port + +additionalProperties: false + +examples: + - | + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + camera@3c { + compatible = "ovti,ov5645"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ov5645>; + reg = <0x3c>; + clocks = <&clks 1>; + clock-frequency = <24000000>; + vdddo-supply = <&ov5645_vdddo_1v8>; + vdda-supply = <&ov5645_vdda_2v8>; + vddd-supply = <&ov5645_vddd_1v5>; + enable-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio1 20 GPIO_ACTIVE_LOW>; + + port { + ov5645_ep: endpoint { + remote-endpoint = <&csi0_ep>; + data-lanes = <1 2>; + }; + }; + }; + }; +... From patchwork Wed Oct 26 13:06:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 619368 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 0A268FA373E for ; Wed, 26 Oct 2022 13:07:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233885AbiJZNHb (ORCPT ); Wed, 26 Oct 2022 09:07:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233612AbiJZNH0 (ORCPT ); Wed, 26 Oct 2022 09:07:26 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1C80FAE56; Wed, 26 Oct 2022 06:07:24 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id v130-20020a1cac88000000b003bcde03bd44so1439421wme.5; Wed, 26 Oct 2022 06:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CwvKLKSqMthyzzSWLO4mWRJEjUUkvsBl0HFYEMFrtl0=; b=Lux9WNWaO3jnUVWbhgyhcrkig3UpivW3J9wVcoltiaG/W6o1IYnIXW64vq+K5iK/Ug lpcxSN0mKNVkBOPBR4mQ7R8j1C9PFHpxcPaMhSPvlGneg6qH4RYkmRqAYiqqOWbjWBXV tDOPasbvF3kqD56iR7g3lLgiD0V4U3lRN8QOWYZfKS0tsRH8+Y4VL3dVoB0u5/X5l0e2 wsMqfwsduBi42yKR1tP3lvXwV/enznejPV/kvfC3Ad6toweGDBIzGA9yJqAu5lZ3zG9w Gr7LsiHQ8CcNDXnG0uXR9S0jzsAxRrZtLjuMX4JU76DWuhrZuptzO6Zcw1JfCvyC7+xo e02w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CwvKLKSqMthyzzSWLO4mWRJEjUUkvsBl0HFYEMFrtl0=; b=Ky3tk+8N97EO5vHxx46m20OJykiyOxPD3BqOR9JM9RRY/uUN1D+ezUJJpz4YDtkfLh PBrgrCqgcJcCxCZOVLzgJCz0nUsfIhl5YlEgxGZI6oxQ2x1DUMr4/7LAvmukv3rdgF5N f8cImQh54D079UulV/2nwBNSW3oyj7+tQSpxbB20EnVet7RvU4k5C8VfznDmtOpGjch5 WIohzecuJDaFrtHV1P8k6QDf+VbooLz9QTY8jwn/iwi0lqsWo+LuQk9xwRf66dCIL0Xi UkOvz8dFdvSdYLkqWYAeW6WQmsreddDUdornnvYo98wv+H1yXeFFyzQv3jYR4w/Phdsh 3d7g== X-Gm-Message-State: ACrzQf3ds1eWp//VjRLhwmOWvlvQqqA0agu8eiJ6lnabVm7dYIWxTyYA 3Qn0P3ZQUUeTjbDWujsRTrI= X-Google-Smtp-Source: AMsMyM7ABNHOTdbIJgsES00b8S9pBsZ9IQRs992cklo3xcmKPbAQViEsmxyeW42rtTbihUPLW9nYPQ== X-Received: by 2002:a05:600c:6019:b0:3c6:e21e:4e9d with SMTP id az25-20020a05600c601900b003c6e21e4e9dmr2439315wmb.53.1666789643160; Wed, 26 Oct 2022 06:07:23 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:cc:c67c:46e:319e]) by smtp.gmail.com with ESMTPSA id l3-20020adfa383000000b002366eb01e07sm5245433wrb.114.2022.10.26.06.07.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 06:07:22 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Geert Uytterhoeven , Magnus Damm , Hans Verkuil Cc: Shawn Tu , Jacopo Mondi , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Lad Prabhakar Subject: [PATCH v3 6/9] media: i2c: ov5645: Use runtime PM Date: Wed, 26 Oct 2022 14:06:55 +0100 Message-Id: <20221026130658.45601-7-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Lad Prabhakar Switch to using runtime PM for power management. Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- v2->v3 * Jumped to err_pm_runtime label in case of sd register failure * Now calling pm_runtime_mark_last_busy() before pm_runtime_put_autosuspend() call * Now calling pm_runtime_put_sync() in case s_stream(1) fails * In s_stream(0) no calling pm_runtime_mark_last_busy() and pm_runtime_put_autosuspend() * Included RB tag from Laurent. v1->v2 * Moved pm_runtime_*_autosuspend() calls after registering the subdev. --- drivers/media/i2c/Kconfig | 2 +- drivers/media/i2c/ov5645.c | 141 +++++++++++++++++++------------------ 2 files changed, 73 insertions(+), 70 deletions(-) diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig index 7806d4b81716..c0edd1017fe8 100644 --- a/drivers/media/i2c/Kconfig +++ b/drivers/media/i2c/Kconfig @@ -459,7 +459,7 @@ config VIDEO_OV5640 config VIDEO_OV5645 tristate "OmniVision OV5645 sensor support" depends on OF - depends on I2C && VIDEO_DEV + depends on I2C && PM && VIDEO_DEV select MEDIA_CONTROLLER select VIDEO_V4L2_SUBDEV_API select V4L2_FWNODE diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index 47451238ca05..4438dc91b82a 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -108,7 +109,6 @@ struct ov5645 { u8 timing_tc_reg21; struct mutex power_lock; /* lock to protect power state */ - int power_count; struct gpio_desc *enable_gpio; struct gpio_desc *rst_gpio; @@ -635,8 +635,24 @@ static int ov5645_set_register_array(struct ov5645 *ov5645, return 0; } -static int ov5645_set_power_on(struct ov5645 *ov5645) +static int ov5645_set_power_off(struct device *dev) { + struct v4l2_subdev *sd = dev_get_drvdata(dev); + struct ov5645 *ov5645 = to_ov5645(sd); + + ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x58); + gpiod_set_value_cansleep(ov5645->rst_gpio, 1); + gpiod_set_value_cansleep(ov5645->enable_gpio, 0); + clk_disable_unprepare(ov5645->xclk); + regulator_bulk_disable(OV5645_NUM_SUPPLIES, ov5645->supplies); + + return 0; +} + +static int ov5645_set_power_on(struct device *dev) +{ + struct v4l2_subdev *sd = dev_get_drvdata(dev); + struct ov5645 *ov5645 = to_ov5645(sd); int ret; ret = regulator_bulk_enable(OV5645_NUM_SUPPLIES, ov5645->supplies); @@ -658,57 +674,19 @@ static int ov5645_set_power_on(struct ov5645 *ov5645) msleep(20); - return 0; -} - -static void ov5645_set_power_off(struct ov5645 *ov5645) -{ - gpiod_set_value_cansleep(ov5645->rst_gpio, 1); - gpiod_set_value_cansleep(ov5645->enable_gpio, 0); - clk_disable_unprepare(ov5645->xclk); - regulator_bulk_disable(OV5645_NUM_SUPPLIES, ov5645->supplies); -} - -static int ov5645_s_power(struct v4l2_subdev *sd, int on) -{ - struct ov5645 *ov5645 = to_ov5645(sd); - int ret = 0; - - mutex_lock(&ov5645->power_lock); - - /* If the power count is modified from 0 to != 0 or from != 0 to 0, - * update the power state. - */ - if (ov5645->power_count == !on) { - if (on) { - ret = ov5645_set_power_on(ov5645); - if (ret < 0) - goto exit; - - ret = ov5645_set_register_array(ov5645, - ov5645_global_init_setting, + ret = ov5645_set_register_array(ov5645, ov5645_global_init_setting, ARRAY_SIZE(ov5645_global_init_setting)); - if (ret < 0) { - dev_err(ov5645->dev, - "could not set init registers\n"); - ov5645_set_power_off(ov5645); - goto exit; - } - - usleep_range(500, 1000); - } else { - ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x58); - ov5645_set_power_off(ov5645); - } + if (ret < 0) { + dev_err(ov5645->dev, "could not set init registers\n"); + goto exit; } - /* Update the power count. */ - ov5645->power_count += on ? 1 : -1; - WARN_ON(ov5645->power_count < 0); + usleep_range(500, 1000); -exit: - mutex_unlock(&ov5645->power_lock); + return 0; +exit: + ov5645_set_power_off(dev); return ret; } @@ -795,7 +773,7 @@ static int ov5645_s_ctrl(struct v4l2_ctrl *ctrl) int ret; mutex_lock(&ov5645->power_lock); - if (!ov5645->power_count) { + if (!pm_runtime_get_if_in_use(ov5645->dev)) { mutex_unlock(&ov5645->power_lock); return 0; } @@ -827,6 +805,8 @@ static int ov5645_s_ctrl(struct v4l2_ctrl *ctrl) break; } + pm_runtime_mark_last_busy(ov5645->dev); + pm_runtime_put_autosuspend(ov5645->dev); mutex_unlock(&ov5645->power_lock); return ret; @@ -991,6 +971,10 @@ static int ov5645_s_stream(struct v4l2_subdev *subdev, int enable) int ret; if (enable) { + ret = pm_runtime_resume_and_get(ov5645->dev); + if (ret < 0) + return ret; + ret = ov5645_set_register_array(ov5645, ov5645->current_mode->data, ov5645->current_mode->data_size); @@ -998,22 +982,22 @@ static int ov5645_s_stream(struct v4l2_subdev *subdev, int enable) dev_err(ov5645->dev, "could not set mode %dx%d\n", ov5645->current_mode->width, ov5645->current_mode->height); - return ret; + goto err_rpm_put; } ret = v4l2_ctrl_handler_setup(&ov5645->ctrls); if (ret < 0) { dev_err(ov5645->dev, "could not sync v4l2 controls\n"); - return ret; + goto err_rpm_put; } ret = ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x45); if (ret < 0) - return ret; + goto err_rpm_put; ret = ov5645_write_reg(ov5645, OV5645_SYSTEM_CTRL0, OV5645_SYSTEM_CTRL0_START); if (ret < 0) - return ret; + goto err_rpm_put; } else { ret = ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x40); if (ret < 0) @@ -1023,14 +1007,17 @@ static int ov5645_s_stream(struct v4l2_subdev *subdev, int enable) OV5645_SYSTEM_CTRL0_STOP); if (ret < 0) return ret; + + pm_runtime_mark_last_busy(ov5645->dev); + pm_runtime_put_autosuspend(ov5645->dev); } return 0; -} -static const struct v4l2_subdev_core_ops ov5645_core_ops = { - .s_power = ov5645_s_power, -}; +err_rpm_put: + pm_runtime_put_sync(ov5645->dev); + return ret; +} static const struct v4l2_subdev_video_ops ov5645_video_ops = { .s_stream = ov5645_s_stream, @@ -1046,7 +1033,6 @@ static const struct v4l2_subdev_pad_ops ov5645_subdev_pad_ops = { }; static const struct v4l2_subdev_ops ov5645_subdev_ops = { - .core = &ov5645_core_ops, .video = &ov5645_video_ops, .pad = &ov5645_subdev_pad_ops, }; @@ -1188,11 +1174,9 @@ static int ov5645_probe(struct i2c_client *client) goto free_ctrl; } - ret = ov5645_s_power(&ov5645->sd, true); - if (ret < 0) { - dev_err(dev, "could not power up OV5645\n"); + ret = ov5645_set_power_on(dev); + if (ret) goto free_entity; - } ret = ov5645_read_reg(ov5645, OV5645_CHIP_ID_HIGH, &chip_id_high); if (ret < 0 || chip_id_high != OV5645_CHIP_ID_HIGH_BYTE) { @@ -1209,12 +1193,16 @@ static int ov5645_probe(struct i2c_client *client) dev_info(dev, "OV5645 detected at address 0x%02x\n", client->addr); + pm_runtime_set_active(dev); + pm_runtime_get_noresume(dev); + pm_runtime_enable(dev); + ret = ov5645_read_reg(ov5645, OV5645_AEC_PK_MANUAL, &ov5645->aec_pk_manual); if (ret < 0) { dev_err(dev, "could not read AEC/AGC mode\n"); ret = -ENODEV; - goto power_down; + goto err_pm_runtime; } ret = ov5645_read_reg(ov5645, OV5645_TIMING_TC_REG20, @@ -1222,7 +1210,7 @@ static int ov5645_probe(struct i2c_client *client) if (ret < 0) { dev_err(dev, "could not read vflip value\n"); ret = -ENODEV; - goto power_down; + goto err_pm_runtime; } ret = ov5645_read_reg(ov5645, OV5645_TIMING_TC_REG21, @@ -1230,23 +1218,29 @@ static int ov5645_probe(struct i2c_client *client) if (ret < 0) { dev_err(dev, "could not read hflip value\n"); ret = -ENODEV; - goto power_down; + goto err_pm_runtime; } - ov5645_s_power(&ov5645->sd, false); - ret = v4l2_async_register_subdev(&ov5645->sd); if (ret < 0) { dev_err(dev, "could not register v4l2 device\n"); - goto free_entity; + goto err_pm_runtime; } + pm_runtime_set_autosuspend_delay(dev, 1000); + pm_runtime_use_autosuspend(dev); + pm_runtime_mark_last_busy(dev); + pm_runtime_put_autosuspend(dev); + ov5645_entity_init_cfg(&ov5645->sd, NULL); return 0; +err_pm_runtime: + pm_runtime_disable(dev); + pm_runtime_put_noidle(dev); power_down: - ov5645_s_power(&ov5645->sd, false); + ov5645_set_power_off(dev); free_entity: media_entity_cleanup(&ov5645->sd.entity); free_ctrl: @@ -1264,6 +1258,10 @@ static void ov5645_remove(struct i2c_client *client) v4l2_async_unregister_subdev(&ov5645->sd); media_entity_cleanup(&ov5645->sd.entity); v4l2_ctrl_handler_free(&ov5645->ctrls); + pm_runtime_disable(ov5645->dev); + if (!pm_runtime_status_suspended(ov5645->dev)) + ov5645_set_power_off(ov5645->dev); + pm_runtime_set_suspended(ov5645->dev); mutex_destroy(&ov5645->power_lock); } @@ -1279,10 +1277,15 @@ static const struct of_device_id ov5645_of_match[] = { }; MODULE_DEVICE_TABLE(of, ov5645_of_match); +static const struct dev_pm_ops ov5645_pm_ops = { + SET_RUNTIME_PM_OPS(ov5645_set_power_off, ov5645_set_power_on, NULL) +}; + static struct i2c_driver ov5645_i2c_driver = { .driver = { .of_match_table = ov5645_of_match, .name = "ov5645", + .pm = &ov5645_pm_ops, }, .probe_new = ov5645_probe, .remove = ov5645_remove, From patchwork Wed Oct 26 13:06:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 619103 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 70426FA3742 for ; Wed, 26 Oct 2022 13:07:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233702AbiJZNHd (ORCPT ); Wed, 26 Oct 2022 09:07:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233489AbiJZNHa (ORCPT ); Wed, 26 Oct 2022 09:07:30 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30E84FAA7C; Wed, 26 Oct 2022 06:07:26 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id v130-20020a1cac88000000b003bcde03bd44so1439463wme.5; Wed, 26 Oct 2022 06:07:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wxRC9RqaS1c9UqAzgAjR/6HB40jvkl82ja8m7OxvWYI=; b=b9CHI4NyN6AJ5o3IRt1rX44jbx9hcjoCG9050hdq7BJLXQTaJmDsPCktJXfbZ1sg6S aZMubcJ1MxV9Tl2ebZgpE/ES/ypJp6DGYcWW2rtwvYH8aYfY8TQzd00b/V3OHspGT1r1 04GNZsdDqwD1rTgDCXEqamnPGENFwD02z0Uwe383xNhfrrhAPLYHfu4zDO88fwkzHuDf pWP4nddoqqDuJ+g4ZfIDhWW9jKkIdb7pRgJC0RgNAIgcudRAO3kbOBYvQrx7qQsRU35J S5A5VTzeEMYtJ/uAeUst3JUIZWNeCMbWq0loeIwjGHw/TKLOIAT8x1vFJLVpXV5lSpjc 7tUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wxRC9RqaS1c9UqAzgAjR/6HB40jvkl82ja8m7OxvWYI=; b=4RwFH5cdxLSdsP62kJ2X7f+6dlpOLb9M8mbl/4xrfRmQuGjOpTdwwtt0aNRgIwk1MV ve8Mh9My7XeR/57u2msVqeI0iaZ30U+c2WRVXLKapdInesa3Fz7ZeLb40K3xumOz8490 q+u55qmDHVNSVCNsW07pqeLR8itF2SUiq/hVmGpXYXQE14wwW5ptm5c2ye5G9u0heWar j6yNAikdtSofr3cZvODplj+TGF9g+J1CFQPN8fdxnG4nReJXreQyQ3DjXJ7w8PgMyVPY nt8nVWO/CTA/pfLLQbbhpDjlPMzAvHlWABynBBnQYopgv7SLFdGW7AkFkoXL0o7H6Vbl Hn/g== X-Gm-Message-State: ACrzQf1PB8HKxq7idpaYXL5ZmXRqAY/4JZHzsz9SPJptZWPc1t2V7U46 /EZ4n+AKJQ/6KJ+qVkvi0W0= X-Google-Smtp-Source: AMsMyM4reJ5wMrEmwNg10iO1tCZCR+GX/b7zV+73elxVnOvmcKJhdIg2cgqJLHgdcy53oG7GZKkC8w== X-Received: by 2002:a05:600c:502c:b0:3ce:794f:d664 with SMTP id n44-20020a05600c502c00b003ce794fd664mr2416031wmr.33.1666789644646; Wed, 26 Oct 2022 06:07:24 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:cc:c67c:46e:319e]) by smtp.gmail.com with ESMTPSA id l3-20020adfa383000000b002366eb01e07sm5245433wrb.114.2022.10.26.06.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 06:07:23 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Geert Uytterhoeven , Magnus Damm , Hans Verkuil Cc: Shawn Tu , Jacopo Mondi , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Lad Prabhakar Subject: [PATCH v3 7/9] media: i2c: ov5645: Drop empty comment Date: Wed, 26 Oct 2022 14:06:56 +0100 Message-Id: <20221026130658.45601-8-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Lad Prabhakar Drop empty multiline comment. Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- v2->v3 * Included RB tag from Laurent. v1->v2 * No change --- drivers/media/i2c/ov5645.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index 4438dc91b82a..eea3067ddc8b 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -14,9 +14,6 @@ * https://www.mail-archive.com/linux-media%40vger.kernel.org/msg92671.html */ -/* - */ - #include #include #include From patchwork Wed Oct 26 13:06:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 619367 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 56014FA3741 for ; Wed, 26 Oct 2022 13:07:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233998AbiJZNHt (ORCPT ); Wed, 26 Oct 2022 09:07:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233890AbiJZNHc (ORCPT ); Wed, 26 Oct 2022 09:07:32 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7886AFAE72; Wed, 26 Oct 2022 06:07:27 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id i5-20020a1c3b05000000b003cf47dcd316so1443737wma.4; Wed, 26 Oct 2022 06:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mEu7I9A+1d1yBU6Am+OewhMcYYZSOczpTnlVQrd1DYM=; b=cjJngFxaJaLl708ZHAdh+fxZXdLGT/ZiLDibcXXYBuerYzqM9/tyfJBWfNrMzuNe9z T973GjsyzcMJcuDxy1bfyy0r3+27tKl1mU7rOPvIL0E+L70YfuVk5qQX4GS8n3xrD5BL 7SLD3WnQZmINrOU90gL3aMB1ylLzppKrD+1WhOhtRLOngmLO91oNbeB4nH9i/2jVCKR0 cjoJ2OVRresDZKJWx93l14R8dMGAEZRJAfPSFRQETjHB69lWPdW75cHwsVK2iO6BqLFe KXEZuD+DRc7jbNHxSF56p33bZPIwKo2u3AhKMshoNYfdHMjdT6RJTZt7EOrGVf5uX3Wh /vrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mEu7I9A+1d1yBU6Am+OewhMcYYZSOczpTnlVQrd1DYM=; b=l7udgUfNgHzsxdoefOFyYx5b+8KecTlYMMi9I6AghecrLGp3GzDo8eE+CUqM3DsxFX +LejW3e2ygRK6wx4jMW8O79IYo5FPADiryNuBNaeH2vzAIMC23ne/AD24VVkJada3+Qj mDCy6awrfetRCg9xh6lmd7f5WXqLcMLQwWMBQn6antoz6r+c8RKiEMmW1o7WfqLRDNrf 27zP3PPNQpgqMWFkRcI5I9LflieNaXMWdQnnXATCt0y1wHXCTLX4SdaTLqhH/zz77Zi8 /60rRtiKVXkOv/g+ZBWYmMGiGHEy6krAbJuVuHZ2CskXNmHsi5USizaV8q6Yq01SZ1DC 66pg== X-Gm-Message-State: ACrzQf2UioojMZI9ECBK7JXh2+of8GJxmBgkyFM/ZmcLjajoowQ2tPWY IwQULA6Zff17bdMc14g9yzg= X-Google-Smtp-Source: AMsMyM5cKNni+vS1VdAMcU0kGbWUB5mxeo7A5g4R+eDKuIjEUyZL8tXaPGk7kVdX3RAfayb2IlMuEQ== X-Received: by 2002:a05:600c:3d08:b0:3c6:fb56:ac9f with SMTP id bh8-20020a05600c3d0800b003c6fb56ac9fmr2471277wmb.193.1666789645913; Wed, 26 Oct 2022 06:07:25 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:cc:c67c:46e:319e]) by smtp.gmail.com with ESMTPSA id l3-20020adfa383000000b002366eb01e07sm5245433wrb.114.2022.10.26.06.07.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 06:07:25 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Geert Uytterhoeven , Magnus Damm , Hans Verkuil Cc: Shawn Tu , Jacopo Mondi , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Lad Prabhakar Subject: [PATCH v3 8/9] media: i2c: ov5645: Don't return early on failures for s_stream(0) Date: Wed, 26 Oct 2022 14:06:57 +0100 Message-Id: <20221026130658.45601-9-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Lad Prabhakar Make sure we dont stop the code flow in case of errors while stopping the stream and return the error code of the first error case if any. v4l2-core takes care of warning the user so no need to add a warning message in the driver. Suggested-by: Sakari Ailus Signed-off-by: Lad Prabhakar --- v2->v3 * Now propagating the first error code in case of failure. v1->v2 * New patch --- drivers/media/i2c/ov5645.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index eea3067ddc8b..5702a55607fc 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -996,17 +996,22 @@ static int ov5645_s_stream(struct v4l2_subdev *subdev, int enable) if (ret < 0) goto err_rpm_put; } else { + int stream_off_ret = 0; + ret = ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x40); if (ret < 0) - return ret; + stream_off_ret = ret; ret = ov5645_write_reg(ov5645, OV5645_SYSTEM_CTRL0, OV5645_SYSTEM_CTRL0_STOP); - if (ret < 0) - return ret; + if (ret < 0 && !stream_off_ret) + stream_off_ret = ret; pm_runtime_mark_last_busy(ov5645->dev); pm_runtime_put_autosuspend(ov5645->dev); + + if (stream_off_ret) + return stream_off_ret; } return 0; From patchwork Wed Oct 26 13:06:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 619102 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 45BBBFA3741 for ; Wed, 26 Oct 2022 13:08:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233513AbiJZNID (ORCPT ); Wed, 26 Oct 2022 09:08:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233962AbiJZNH6 (ORCPT ); Wed, 26 Oct 2022 09:07:58 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED10BFB735; Wed, 26 Oct 2022 06:07:28 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id az22-20020a05600c601600b003c6b72797fdso1506926wmb.5; Wed, 26 Oct 2022 06:07:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=L0jiMTSBmquugDzo1rVzLGgWnpe8YQDdbS4JQdF2oe0=; b=MAVaFUOx/nc/Tlqs7/GJJy2togIYrAqyxRla3MZEdmldp/7TOH4Md8XmrKIeB/407T 9CWwhffHjgDpoUKCpncsUNQrdagWzmOe66eZ0cyF7snK/oWaSZiVjF5lJe9syxJUPrUz 974mpN3MP9cVl1wZbtP4LgrW1s+S42bj39pf9dcGd7sGdbg5Rzt4+D64OyspzVMNGJ5w ZSHQ3EHZrdeenCXSWz+g3VLb4y68jzy+HWOHsPs6PkCejoG2uEBXVVrLdTKev8ColhpT KBmMh1+F/EWcipKHI5UauJUQecTdeaBNP2z+a/aoTmWdtFqH8gxsqDh7ffHUQQlXtUv1 Ue7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L0jiMTSBmquugDzo1rVzLGgWnpe8YQDdbS4JQdF2oe0=; b=GfoGfzAzpBIuAo5NpYbxzSxysit41sWPELslvtGPgt4QZaWRYgSAfx6nDGYs4vKmmO R1jG5OAZ+kdvbV3Fmt7xkAfJduP4TVmMi3/s+SmSDI8ePJtus5qf42U2fpsTPpnogPTU d29pobY8jq9jlMPT6nin2XebRYUkk/5cKw6iVFdwvy+cnENnai16q4K9QzAfTnEX7V8Y mV1U3gx4kxB6R2OFTAACCI0IF7Fi17HfwLpP7ca8XfHSXMaa0VH00ZdnX7ajUFcj26Au hMZSnjSjkj5TJaf2O6PnNSFBUncxOWMvPqy/oYIGm2X59zU9qlMapjikjHAoSmyAYI1U eacA== X-Gm-Message-State: ACrzQf1pNZ42PUn14YCNByof2YPCwJ+AWRYmGyHd1DILVcsJZ2cn/IgT 0xd2OyN4yMYZMYISW8GWyyQ= X-Google-Smtp-Source: AMsMyM4Er4WKAbIRWgF2gLUapvRVsqBjj5aTQoG1761EBBrIC+UZB72u0L0sSE79mM2YekoYDezymg== X-Received: by 2002:a05:600c:16c7:b0:3cf:4dbf:f360 with SMTP id l7-20020a05600c16c700b003cf4dbff360mr1218450wmn.74.1666789647537; Wed, 26 Oct 2022 06:07:27 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:cc:c67c:46e:319e]) by smtp.gmail.com with ESMTPSA id l3-20020adfa383000000b002366eb01e07sm5245433wrb.114.2022.10.26.06.07.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 06:07:26 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Geert Uytterhoeven , Magnus Damm , Hans Verkuil Cc: Shawn Tu , Jacopo Mondi , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Lad Prabhakar Subject: [PATCH v3 9/9] media: i2c: ov5645: Call ov5645_entity_init_cfg() before registering the subdev Date: Wed, 26 Oct 2022 14:06:58 +0100 Message-Id: <20221026130658.45601-10-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221026130658.45601-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Lad Prabhakar Make sure we call ov5645_entity_init_cfg() before registering the subdev to make sure default formats are set up. Suggested-by: Sakari Ailus Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- v2->v3 * Included RB tag from Laurent. v1->v2 * New patch --- drivers/media/i2c/ov5645.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index 5702a55607fc..73cf6716f3ed 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -1223,6 +1223,8 @@ static int ov5645_probe(struct i2c_client *client) goto err_pm_runtime; } + ov5645_entity_init_cfg(&ov5645->sd, NULL); + ret = v4l2_async_register_subdev(&ov5645->sd); if (ret < 0) { dev_err(dev, "could not register v4l2 device\n"); @@ -1234,8 +1236,6 @@ static int ov5645_probe(struct i2c_client *client) pm_runtime_mark_last_busy(dev); pm_runtime_put_autosuspend(dev); - ov5645_entity_init_cfg(&ov5645->sd, NULL); - return 0; err_pm_runtime: