From patchwork Mon Oct 31 23:21: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: 13026458 X-Patchwork-Delegate: kieran@bingham.xyz 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 8E7C5FA3747 for ; Mon, 31 Oct 2022 23:22:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229761AbiJaXWL (ORCPT ); Mon, 31 Oct 2022 19:22:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229641AbiJaXWK (ORCPT ); Mon, 31 Oct 2022 19:22:10 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0B9E14D04; Mon, 31 Oct 2022 16:22:09 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id m29-20020a05600c3b1d00b003c6bf423c71so11830703wms.0; Mon, 31 Oct 2022 16:22:09 -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=TEzFrhTkWeCjs8Cm9lOhIpriWE8/5AdjGdiuH64P3Yc=; b=PT4L1vjavEaxPRpEIodvzJuUESfGuBT+zTCjle8LroCDLCvGpDzrHsmG1iz+HP6zRQ e2TtL68l9ZunbfMLuwYnWdlE84NwQmn+cMaNPBNXjqglleM2mF36fGuIxynWrisPAaON +kakU5urRZqjz7wdXuiMQDg2jVrRshNJX/OaCzTqhmkklmrcm6PAO+F/9QStgaUojnmF vOc9Nm4pr+dQisstoXvDA6CENVYvuXkUKJQH1wK/63O7yyEkTBwg0/Ydzhl6LRSO+/c1 rTn4r/AkrcHR7Cw8K6k3grk2FAgQKbkzoUkXlGr2hyVaLdRcLY5oAMY6JfBxr/JxIdjw hMsw== 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=TEzFrhTkWeCjs8Cm9lOhIpriWE8/5AdjGdiuH64P3Yc=; b=epvcAbM58ddr2+CxhmFb2m6Ndl6YaZd7gPxx2n9IvH0I/im8GziiQV2ZwgcKorkUa0 Y13LAns9ENVhZBHBkCT0vHBfHOODacq/09Y2kq4piXvpcm7lycG+3Ny0egQbvua41QYc uNHiyEdR6zNpIXAe5kWQncDNhl5ysZ3uUnFKFCK789E1Qa6ilc+Mcu82IrIOy+meCMYF ImNAdjZRa8pMLWk9NTIWcoPDazIg1Lq+s/QMbqhCh83afM9vkQZHryl5AT/2AKo2edOk M1J4dzEmzcTLrgd738QEjou6ZOY6fmdRRkZAnWLVMfG7DNiIwrcjqo83ovcu4EcXWqSS dBew== X-Gm-Message-State: ACrzQf384pQDoW8Xpvtfs8zlrlvdOvQoSkTF1ffa2IYy8I5yXn53j2Ni EU9heW7aaWUkx31EdE2gKrE= X-Google-Smtp-Source: AMsMyM5TismXTZIFkjjeFN7VZPXoAt37JH4GYKLKFt9pAmo6rv7ZxGtL94Tp26DOy9ExUOUf5NAeoQ== X-Received: by 2002:a05:600c:46ce:b0:3c6:f274:33b2 with SMTP id q14-20020a05600c46ce00b003c6f27433b2mr9790385wmo.27.1667258528012; Mon, 31 Oct 2022 16:22:08 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:15da:d6ab:ec79:436]) by smtp.gmail.com with ESMTPSA id l24-20020a1c7918000000b003cf7928e731sm2190343wme.9.2022.10.31.16.22.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 16:22:07 -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 v4 1/9] media: i2c: ov5645: Drop fetching the clk reference by name Date: Mon, 31 Oct 2022 23:21:54 +0000 Message-Id: <20221031232202.131945-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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 --- v3->v4 * No change 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 Mon Oct 31 23:21: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: 13026459 X-Patchwork-Delegate: geert@linux-m68k.org 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 AC1B4FA3746 for ; Mon, 31 Oct 2022 23:22:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229787AbiJaXWN (ORCPT ); Mon, 31 Oct 2022 19:22:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229781AbiJaXWM (ORCPT ); Mon, 31 Oct 2022 19:22:12 -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 A828115731; Mon, 31 Oct 2022 16:22:10 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id v7so2220127wmn.0; Mon, 31 Oct 2022 16:22:10 -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=+MdUt/iNt9/kTh817Rsfi87nfiZ1a+43i2ZO2yuH5Cg=; b=jTVLX6Bj322sv3oFouLXybUnw9DkS2lMpgMu6sR2Z4/4QVL7Z+30E/OUf74oytw9rw 9SpEv+OgwDZbj3wvJ1ZWj/6alqMFz7EGU53qPlHUE9llmzddo8WPTgS+h/zKaMjqZGXS VHLDyKimZ/2AZ8uviDEeQ/Ocpi4rdPJAzGDSJNgoqdOBQPk/HwiqOiYDADcfwodcTb7d lr2O8nKDsNyNxP8v0GmablOlrX1pL/+EnMUOVPz1Tx4LUtUFdFY0jclVeZzu8YVn25Ey ci2mRQqRUyzxxugA1Nhy5hlIAG4gdbgZSe3M96P/Fw6nUgw0PcbmKO9IyMrChaKQLKtH 8/1Q== 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=+MdUt/iNt9/kTh817Rsfi87nfiZ1a+43i2ZO2yuH5Cg=; b=FI6438eEP7qbYH2dIjZshX5TyYvyklFXfbx+PDr/SFFOwM6GmqmOX2g8y5c/euiu1X gnnwAvqKCkC2vLCTemSXumg3J4lv2CZywNHLYe5mYb1dhiP6XTclFNMTnvVVcavKA1rB pLx95SFWsNw7LOnzOQMEGWw7I+bsRB8jVy/TQgQtLJIDHtyFqinIITBos9sqR1EvGOCM g43lv+Fgz4TAFhS9gnMNtvCxxGbhghMI97Sla5rJnkAvdg+AXU50oH0vF6BGsHebLOBQ H0ax5nbKSKm6Mgs8c/U/YhCZ8im4UDKEXLA2vtvek3zFL8gIc/y20J9/cjtyWz0E6deN bqlg== X-Gm-Message-State: ACrzQf3xrRF7Qz/ifbWuxAXOI9P4BU5ud5XvCeak/dX0MCeIp+6+QrBO oq17SOsE7qC0KTKwBEKL3Js= X-Google-Smtp-Source: AMsMyM4Mg3gghsP5pWgmFsT2XFdnBmf6Abctn4YIlTztqIGN2AwFewk/aTLlAZMdHs85kMJMq/QNQA== X-Received: by 2002:a05:600c:6023:b0:3cf:7dc1:e08e with SMTP id az35-20020a05600c602300b003cf7dc1e08emr456974wmb.154.1667258529235; Mon, 31 Oct 2022 16:22:09 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:15da:d6ab:ec79:436]) by smtp.gmail.com with ESMTPSA id l24-20020a1c7918000000b003cf7928e731sm2190343wme.9.2022.10.31.16.22.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 16:22:08 -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 v4 2/9] ARM: dts: imx6qdl-pico: Drop clock-names property Date: Mon, 31 Oct 2022 23:21:55 +0000 Message-Id: <20221031232202.131945-3-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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 Acked-by: Shawn Guo --- v3->V4 * Included Ack from Shawn 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 Mon Oct 31 23:21: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: 13026460 X-Patchwork-Delegate: geert@linux-m68k.org 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 15BA2FA3741 for ; Mon, 31 Oct 2022 23:22:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbiJaXWO (ORCPT ); Mon, 31 Oct 2022 19:22:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229798AbiJaXWN (ORCPT ); Mon, 31 Oct 2022 19:22:13 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0429915808; Mon, 31 Oct 2022 16:22:12 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id a14so18049534wru.5; Mon, 31 Oct 2022 16:22:11 -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=kyD58U8XfTPLhP8L6dYQRdSftQvUir8wfXrJ1EL57to=; b=TNYP7upQ+XliKy6Oy7PDt04rpganc5iZE4z0navqKYlnSR/R7ix1GtEMsNLSqDj2QI AmXDEXzES5/rm9GUZmpRVlG+ZQhuTCFtsOQZUnqU2EJ6vEN7ShTffbPl91t58QJSb/8J kZQk8XH8CzIxBQf9OxHSxdyz0FAMuyyZqLTvCcd2oDa656OiEFZp/lwgyl2aI3Gtpmti rgiPkhc8Ok6ayKY8i0evCl7Mhp/flXoBlBlrdR3HDVFjPEB99hEX0ZnYOvm9EPx/iKur XuCMtg+RKWWU3UpoAcQoD43iZ9IBy3I7jMAe9ViZ/TLqB0cyDwt5ZLaGN+YxHSYjXdY4 Mn5w== 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=kyD58U8XfTPLhP8L6dYQRdSftQvUir8wfXrJ1EL57to=; b=LcHPQY0YQ83/LNb2f68u9LANbOVoe0W4YLij8JCqzhB+3RZRyTRweTw55y63xyrmNO vbGnSVKBm16XJMts6BcurY0Zeyjt2M5TsOJwOr7SJNXqmUcLn3cZlvWjApeOANdAqaAc j8D1HwBjc0eHV+ZUibu20w80lOQ5+uJNKlkEoEauBEQ4PKOkYQ+2RwOWZqHVfBeztXJU 2UAmyDigNSTbQthL5skKKWjUI+Fe/fC7/+0ov/sAqNQ/E0yUHcWeZlI6LNYHl0goyzoq JKUlfHiA35IVo5GJP/XzixTM6dosnW9AQjLBD5UWzcEETeKGduLZhBpswk2p8hc7EXzK 97YA== X-Gm-Message-State: ACrzQf2dAhK4cj4uD+fYB6OgCcdhzp8T/TVvuNKHKSliiaIzOHUlU2+d jiqhmTQkZdE/BjiMx9JJ498= X-Google-Smtp-Source: AMsMyM4+nWVJ22rNl4L7Cw61VJfAK+GGQ3uEGtoGTMf8OXpswZoCAsaKIvLrAZEGv01WVC3JFOsbVw== X-Received: by 2002:a5d:44d2:0:b0:236:d8c5:122e with SMTP id z18-20020a5d44d2000000b00236d8c5122emr3142672wrr.611.1667258530433; Mon, 31 Oct 2022 16:22:10 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:15da:d6ab:ec79:436]) by smtp.gmail.com with ESMTPSA id l24-20020a1c7918000000b003cf7928e731sm2190343wme.9.2022.10.31.16.22.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 16:22:09 -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 v4 3/9] ARM: dts: imx6qdl-wandboard: Drop clock-names property Date: Mon, 31 Oct 2022 23:21:56 +0000 Message-Id: <20221031232202.131945-4-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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 Acked-by: Shawn Guo --- v3->V4 * Included Ack from Shawn 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 Mon Oct 31 23:21: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: 13026461 X-Patchwork-Delegate: geert@linux-m68k.org 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 72BBFFA3746 for ; Mon, 31 Oct 2022 23:22:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229872AbiJaXWR (ORCPT ); Mon, 31 Oct 2022 19:22:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229846AbiJaXWO (ORCPT ); Mon, 31 Oct 2022 19:22:14 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33B2C15810; Mon, 31 Oct 2022 16:22:13 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id y16so18011105wrt.12; Mon, 31 Oct 2022 16:22:13 -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=r9VHYXuPl7lW+Y4lOtJuafMlo94cKBcVsHf9qYkj+B8=; b=qf0tMMl7snTqw2mpt9fryEeYpgvyZJbJ0NM8T0rxZudbdjYlSSzz2Y/dp35RwtmISC up1dW4cn2X+ky4dtt75aP5ApvwXapf8dnzExcC6lwQ/PhSIMXfy5YVBjt0tcbZCp5f5J CbsWgcSeYSkWwZihcpbq/7ycY1sT63Ppdt5oaHWPbBWuzfGScxt/9S1Yj7We+BAbZEaT gOtp3Y3mLD+pfcFrNMpijr5V6FbCf7J6J2xwDMFraC/B/eTWTwKjGp/3cuSo9dTHL9HD XCq8jqtREWmnYLszNnJsTQMNx748mzLtK0DtQM10PWho2gJE0+Y5yfC74H7Bw3Jsb4eu Lo2A== 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=r9VHYXuPl7lW+Y4lOtJuafMlo94cKBcVsHf9qYkj+B8=; b=jV/oKax3QRoOVFAtvBAAwXnBIvr3jhbeSi58iVqmYwpipKlb0Ub6DnBO7u5QoCvO6Y zEqOqPcp/f8Y+CzaV4PQd573f/l97iGTkOAPayboz/1/N+w6TVoet/0BjmJRuXq440fc b8ynSidvl8W5U88LX6aOFE32dT/yLu7+l5d4T/30gq6Oo/bBFYQrARg+YSCz7j6v35lZ gxWW64PmauD+VEWbCEFJTYzdCr2l4h5pixY0gZT8WoQvZXw32clv6FEMlyj8I6qlcM27 3aJ5Xmg8e2M4wYLORbiEbp8/v/PJUBpx0VSQOpFrIpCRw3l9NeUavVzQQZd40Sfpii25 ncEg== X-Gm-Message-State: ACrzQf22JeF7KPl3wYs7dlKM6t6w57MvckltUNj8aKVME0CBx/iPgi/m 4JzOEhtDjC9Akg362M/UP0Y= X-Google-Smtp-Source: AMsMyM5232K+NHOFlqCTn5WLGMbE8QDMZMvrRDvJqDG488x9XN1/k8JSsvrExIamD5sOLVNyAJzIwQ== X-Received: by 2002:adf:cd86:0:b0:236:6056:14d3 with SMTP id q6-20020adfcd86000000b00236605614d3mr10035142wrj.30.1667258531659; Mon, 31 Oct 2022 16:22:11 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:15da:d6ab:ec79:436]) by smtp.gmail.com with ESMTPSA id l24-20020a1c7918000000b003cf7928e731sm2190343wme.9.2022.10.31.16.22.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 16:22:11 -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 v4 4/9] arm64: dts: renesas: aistarvision-mipi-adapter-2.1: Drop clock-names property Date: Mon, 31 Oct 2022 23:21:57 +0000 Message-Id: <20221031232202.131945-5-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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->V4 * Included Ack/RB from Geert 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 Mon Oct 31 23:21: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: 13026462 X-Patchwork-Delegate: kieran@bingham.xyz 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 E69A8FA3747 for ; Mon, 31 Oct 2022 23:22:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229889AbiJaXWS (ORCPT ); Mon, 31 Oct 2022 19:22:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbiJaXWP (ORCPT ); Mon, 31 Oct 2022 19:22:15 -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 9525A15801; Mon, 31 Oct 2022 16:22:14 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id l16-20020a05600c4f1000b003c6c0d2a445so8966767wmq.4; Mon, 31 Oct 2022 16:22:14 -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=GVip8IOpyMxjep2B0xWdSusXNinq79sxctTxO3WsNTg=; b=BzOiQz3khhlS5lwRxTlUiNaP3JUy9XE1LhgHHLsBVOw6sL/p87LQ+Qsqi2W9tvNeS9 BQ9bf9XauoB/Vgo6HYbv1vz6piBl5ejpynsBdKkjopYw2pDyOnqL7H08+BvWZ6ZHPDkz SR1AbURGF7IU7xe9VQVKcvdaDBNBZtPlL016XZN+gX+6CBr3P0aA2QlPP/prtz5FtvWN oqIRld7CdDNMPSuDXHu48dxOJlXos6INLT8nT5gv0pgS2kSAqZbgmT+KQN71yls3oMOA 2ELVPDwz7yzuv0Oh4KALqv5Lcpmp7mJeUB27m5XIsOQjfZKq7NU+Q3OK86gulNauC2Q3 HjxQ== 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=GVip8IOpyMxjep2B0xWdSusXNinq79sxctTxO3WsNTg=; b=QEBDbPim+9ilEVtDJUf1Gh9HTDccEq4B5hj2L8EfcxGiHcpeYYz5vrY5vKwb/LzCSl 2bDBod12viRFg3JP3zNkjoSCXNcMOVIfafOIUEt8HirLOB9BWrsPh5iJ870+yn0vjcgj iG4U0TkTFz7IS5fMw2epUSIlKQWhVz1mvN86wGKZX/GZmu158MAa0WrIkB1/uBoOv5hW ylEKexs4wgXSBesAEStT3RMLma+ERB04aNh57xu6mRDfwHnBpaHKEme/L0QzO75g35Zh rvbm8v/UTsaltYKaSp6TiFEiWlU3S8SJPMZzhs/ihbkJoHZFsKBXfBtaRD5DWCp4S0Mi mCKg== X-Gm-Message-State: ACrzQf1R49ax4XxeBxxqZ68zGFVJJsYMtrloJSW/0Y7Ubu01PWqACykc +uj7e8OLY0OM0yd8OLmskV8= X-Google-Smtp-Source: AMsMyM4gjZCg3yaqoXhBgzxKHeJrqOi9G7ZHu6ppPxCLtaiNRJW1cZ+9wi/YYVNX4sVQUZubQNtiXQ== X-Received: by 2002:a05:600c:4f04:b0:3c6:fae5:b4d4 with SMTP id l4-20020a05600c4f0400b003c6fae5b4d4mr9897262wmq.103.1667258532998; Mon, 31 Oct 2022 16:22:12 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:15da:d6ab:ec79:436]) by smtp.gmail.com with ESMTPSA id l24-20020a1c7918000000b003cf7928e731sm2190343wme.9.2022.10.31.16.22.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 16:22:12 -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 v4 5/9] media: dt-bindings: ov5645: Convert OV5645 binding to a schema Date: Mon, 31 Oct 2022 23:21:58 +0000 Message-Id: <20221031232202.131945-6-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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 Reviewed-by: Rob Herring --- v3->v4: * Used 4 spaces for example node * Added reg property after compatible 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..52c6281a6684 --- /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"; + 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>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ov5645>; + + port { + ov5645_ep: endpoint { + remote-endpoint = <&csi0_ep>; + data-lanes = <1 2>; + }; + }; + }; + }; +... From patchwork Mon Oct 31 23:21:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13026463 X-Patchwork-Delegate: kieran@bingham.xyz 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 877D2FA3741 for ; Mon, 31 Oct 2022 23:22:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229912AbiJaXWi (ORCPT ); Mon, 31 Oct 2022 19:22:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbiJaXWS (ORCPT ); Mon, 31 Oct 2022 19:22:18 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 004BD15819; Mon, 31 Oct 2022 16:22:15 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id b20-20020a05600c4e1400b003cc28585e2fso8985693wmq.1; Mon, 31 Oct 2022 16:22:15 -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=JdWVp8VKApnfegQEOrjaVUnNIwV9nr2tqU0d5pk0pbY=; b=aVYZykcQRdCNhljn6y2lG2hREcVaK6h7Y9tlwECutf18hy2Xq5a2QfW1vMzgeV9mKw 1mTjtFHPy836OtHRKd93eUAE5yKBfocaQETKWEilmEW0yN2DRSGoKx/98blsReyBZxtg rhD3xPrM3DYzaX4uxQFuYkFH+XMHsI+11OSuCSbYzvqjvfpbrtJULWjlYJ5YlZkwJQ77 DkXm1o+8BvuBW0EGeMhh0t3FJhCGFfiF5JB7aGNSBaFB+arnCyCtj1EFtQBuQsEmU3x2 KelZrDwwaeZc4mxMVuNLprEf/y+G9PDySKogLFJ35fwCs6LI8lvYcXKxiU1MXTuvt5RT +zzA== 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=JdWVp8VKApnfegQEOrjaVUnNIwV9nr2tqU0d5pk0pbY=; b=V2JLpOpyYD3xuMHxdlSDbeDX652EeyupdhMeTS7gRm8f6Iy3E3n/NomLsneIjjbYqm g1bh/edQVI7UvnBHzoc/qZYbKG9W0i2zYN9KrJaD76kRULexPs8xt9kJ/t7pRqG748l7 xJqVskCEnyX9ppy34dnTNqI2i4HJqsBTDYQY6Rmn++UmLXjhEzX4vTmd4FbOfXZjKJAW KLG/Ta30BrDxxrRnggLsl3i8S5NpQGzUsuoTxp+c4kO1OLEJ/B2OmwgOG4xRhDCvZ9Wt S+uYYKUOW6hHoAVI5tTcTc0PotTeSckUJZn0KyEr5hJ37wdKJpaAgUVQZb4IzejvVaYa FCPA== X-Gm-Message-State: ACrzQf2vyoRFrVDybxEOolAVmlPhWo5sG5G1absZuYD/A2CWaMjCKE/N RRausqT1IJCoCp9AqoRhpgM= X-Google-Smtp-Source: AMsMyM55AZpk7lKS6zqkZ5m+nxrCYfO5A1HzB5ycOj0l2bC7+SYyD6GBmeVHyjlI4YCVxe8b/oWIkA== X-Received: by 2002:a05:600c:2150:b0:3cf:6c05:b4ab with SMTP id v16-20020a05600c215000b003cf6c05b4abmr6846876wml.161.1667258534320; Mon, 31 Oct 2022 16:22:14 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:15da:d6ab:ec79:436]) by smtp.gmail.com with ESMTPSA id l24-20020a1c7918000000b003cf7928e731sm2190343wme.9.2022.10.31.16.22.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 16:22:13 -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 v4 6/9] media: i2c: ov5645: Use runtime PM Date: Mon, 31 Oct 2022 23:21:59 +0000 Message-Id: <20221031232202.131945-7-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Lad Prabhakar Switch to using runtime PM for power management. Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- v3->v4 * Fixed comments pointed by Sakari 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/ov5645.c | 133 +++++++++++++++++++------------------ 1 file changed, 68 insertions(+), 65 deletions(-) diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index 47451238ca05..2e6135d0a31a 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) { @@ -1233,20 +1217,30 @@ static int ov5645_probe(struct i2c_client *client) goto power_down; } - ov5645_s_power(&ov5645->sd, false); + pm_runtime_set_active(dev); + pm_runtime_get_noresume(dev); + pm_runtime_enable(dev); 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 Mon Oct 31 23:22:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13026464 X-Patchwork-Delegate: kieran@bingham.xyz 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 9945CFA3748 for ; Mon, 31 Oct 2022 23:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229681AbiJaXWj (ORCPT ); Mon, 31 Oct 2022 19:22:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbiJaXWS (ORCPT ); Mon, 31 Oct 2022 19:22:18 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FF9015831; Mon, 31 Oct 2022 16:22:17 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id cl5so6397330wrb.9; Mon, 31 Oct 2022 16:22:17 -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=fJBWoy7TJ47MfKlpeijbPHMAr4KHuBmcOIWaFpNesOo=; b=RF79MqPp6/jwnF0C2Wz9VR92XLalmz4Kv5718fsA8GaNwxe/y9LDw6Ar7MQ+7SPbx1 4/vfpxIE9A/klzv9jdUckFRYf/IAq4IIYcc7MtfmFoA3P0g79UBDfMble2aN+h6kKVcZ 4HWBQczK3nu/pRJHTI76YVlpKeB32xmA0PBiNLIkCHexeu57n9l79INx8D5Dqm9jZ/Iw y0N3TMwOu4jzTzNEoVmjert64dHTzYVd0MH8wKf+MH8M9JSbevpZkH/Gze2Agr1qLNU8 YgzDDgbY4H/sZiSkD/8GEEHozPG+/AAaQ6BQk5uaTjCmhsA8BVrWcobHePPHhjfRRKdX iDQQ== 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=fJBWoy7TJ47MfKlpeijbPHMAr4KHuBmcOIWaFpNesOo=; b=JeznquZCFxE4+9iigQKrymAd39RyM2JaXkXdLVuAQhMLrYHw1wguIRmo9X/a48dnQf VpU+9dt6rxVS1laYuPJj6li1HdPhDEccGSg0B5QaWV95Cq+HkO+vHvY5mr8h/wPWe0Cd 4VFQQv9inT530FQpea3Pr3adcZ47XbFsotEsBKGQlQOSeDheVu4TW5zrkJV/G2Ehid6s F0p2im5RGJ/gORACp4G7mIIW5JOPDbr05udVOx2+gXNWPa1Fx3czCGbO9nLR43TEx9R0 w3CKLrzuWV0wS18pUMSHcsB71P4gqYgGrHP+BfK60SpFwsLTx2UFlm0RcscxxS+YM7Am oBgQ== X-Gm-Message-State: ACrzQf0RBAdUy750KGsgvM4IUdKsgq6qSMX7byuc414uvB2v2PAfg/mC mQFQx+fo+JovwjqeVGe0i5Q= X-Google-Smtp-Source: AMsMyM79W/pa8L0mk+53L9ve6nBRik58aJo+npJd7mdZsnrVFKc4XVCuByLE1Y8QVs/egaaHybsPaA== X-Received: by 2002:adf:e2c8:0:b0:230:ba81:cf0c with SMTP id d8-20020adfe2c8000000b00230ba81cf0cmr10102710wrj.357.1667258535600; Mon, 31 Oct 2022 16:22:15 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:15da:d6ab:ec79:436]) by smtp.gmail.com with ESMTPSA id l24-20020a1c7918000000b003cf7928e731sm2190343wme.9.2022.10.31.16.22.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 16:22:14 -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 v4 7/9] media: i2c: ov5645: Drop empty comment Date: Mon, 31 Oct 2022 23:22:00 +0000 Message-Id: <20221031232202.131945-8-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Lad Prabhakar Drop empty multiline comment. Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- v3->v4 * No change 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 2e6135d0a31a..6897f542737a 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 Mon Oct 31 23:22:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13026465 X-Patchwork-Delegate: kieran@bingham.xyz 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 3CA27FA3741 for ; Mon, 31 Oct 2022 23:23:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229961AbiJaXW5 (ORCPT ); Mon, 31 Oct 2022 19:22:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229917AbiJaXWi (ORCPT ); Mon, 31 Oct 2022 19:22:38 -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 06ED715A10; Mon, 31 Oct 2022 16:22:18 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id ja4-20020a05600c556400b003cf6e77f89cso236915wmb.0; Mon, 31 Oct 2022 16:22: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=d4LiAqleogBkG8NOm3VowQ575ICtW67soXi7PB0llYs=; b=cJK+/X3jEyeQ2Es1QFj2uoZp4BYmhWP4k+uzNhatrXacbRSw8ei+x9SzH+tX6LHt47 K7gUQPZCZ3+sptPPay8wgi2hNjQOQxQRF19KcxDIvek4UsSGXL/uAdZRlAHaLcHIV+I/ jJ5rULwV0ifD5e56vOt4a5LkbbbJsmoNcaGib5WIRQXGJt7iE453Fx2Sre0cAuISGAT5 alT9LvH5LgXUSIzJh6WLlO6ni1ZpuJKqhBVB1nJH4kvswHH+G2TUBi9UDrVg349YORUI Z1cL5q3KHLphyRQTRyRyKA7buTwK0muwHIVQmSUS5GehZ43ZDQZIpg2XdeNJ/qTv1fLy sd7A== 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=d4LiAqleogBkG8NOm3VowQ575ICtW67soXi7PB0llYs=; b=qNVibSlG2HHLzwRlKZZJOUCsdcKKyUE/9o16Yw9s/+VukkCud64voG5h4MGI8Nf7Vo hqy3q4dvrH3rn2kniM4e480FQvhSwlPs5mYCKhpSBXUPHES50cbtsfm19vxgQHBG4cjk rbDsH9xFe5hWYzOeUbuqBKE1a786Lz7q3GT6UrTSSYcpv8xN1vTZ31uU6QLaHMo6pa75 C6io1WqnTCUjJBHL6dXpUGUZTvFxSgsNy/dC7TkMfAgRbE5VR7a8ePEoWOMB24eRqyU5 b650papZhEd5Fwf0XL01SFhvIkm2S5LSl6xbu6vwtTus7AXsLrJanekwTky6vHTSmSgs W5pQ== X-Gm-Message-State: ACrzQf2066chCo994PDUAKfgalQbe12j+mGO51gF341vchTTX5OYVDPi ONvIeJe+oeteFa2Gpn8D6iuxPsPXE2cQc2JY X-Google-Smtp-Source: AMsMyM6R2VdJ2gyF7g8C0Bh7WSaajyMcwehD1icOTPDlj8Zv096mXbB349vLgpuktAsZBY4NnR6kVg== X-Received: by 2002:a05:600c:4e45:b0:3cd:f141:b7d8 with SMTP id e5-20020a05600c4e4500b003cdf141b7d8mr9768739wmq.196.1667258536834; Mon, 31 Oct 2022 16:22:16 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:15da:d6ab:ec79:436]) by smtp.gmail.com with ESMTPSA id l24-20020a1c7918000000b003cf7928e731sm2190343wme.9.2022.10.31.16.22.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 16:22: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 Subject: [PATCH v4 8/9] media: i2c: ov5645: Make sure to call PM functions Date: Mon, 31 Oct 2022 23:22:01 +0000 Message-Id: <20221031232202.131945-9-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org From: Lad Prabhakar Make sure we call the PM functions while s_stream(0) even in case of errors in the code flow. 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 --- v3->v4 * Fixed comments pointed by Marco v2->v3 * Now propagating the first error code in case of failure. v1->v2 * New patch --- drivers/media/i2c/ov5645.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index 6897f542737a..0a889283da36 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -998,15 +998,12 @@ static int ov5645_s_stream(struct v4l2_subdev *subdev, int enable) } else { ret = ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x40); if (ret < 0) - return ret; + goto stream_off_rpm_put; ret = ov5645_write_reg(ov5645, OV5645_SYSTEM_CTRL0, OV5645_SYSTEM_CTRL0_STOP); - if (ret < 0) - return ret; - pm_runtime_mark_last_busy(ov5645->dev); - pm_runtime_put_autosuspend(ov5645->dev); + goto stream_off_rpm_put; } return 0; @@ -1014,6 +1011,11 @@ static int ov5645_s_stream(struct v4l2_subdev *subdev, int enable) err_rpm_put: pm_runtime_put_sync(ov5645->dev); return ret; + +stream_off_rpm_put: + pm_runtime_mark_last_busy(ov5645->dev); + pm_runtime_put_autosuspend(ov5645->dev); + return ret; } static const struct v4l2_subdev_video_ops ov5645_video_ops = { From patchwork Mon Oct 31 23:22:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13026466 X-Patchwork-Delegate: kieran@bingham.xyz 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 E254EECAAA1 for ; Mon, 31 Oct 2022 23:23:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230008AbiJaXXC (ORCPT ); Mon, 31 Oct 2022 19:23:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229938AbiJaXWl (ORCPT ); Mon, 31 Oct 2022 19:22:41 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0EE015821; Mon, 31 Oct 2022 16:22:19 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id v1so18027624wrt.11; Mon, 31 Oct 2022 16:22: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=w4n/PVXJaI0AZ90mJ+ujyPK1tladHQFvLZoHvifyNgE=; b=iriYmRi7F+gUWdk3CPDtwYWNytgMeCCV/+jNmQm6VV/pFm3r10jPG3b9nufXlYb46A r8nnGnkDk/PB4ktZNp5DFh+M3g9gSt9alapkjnhh96+ew4Yjuxtfv4b9fv8G0+Iv1jnf 90bEyDhop8d1D+CE3TihTTtp5mlp8Kpl/Rrl0DMCXYLgpdw/eFeUDYYwcEb+PK7jcnTE Zf5nRXuLiod6Pe4Cgqb48vJnkjpcT5YQEtBgW7zbQCbL2zNo0LsSeLwEUgOXfRWtSbCz hHvR7V6fWN0uylB3E+Hf80ugSYzmjZaUBhcWYRx/lXQccg88/fG/GvSwLJwV1dypLY6m T3YQ== 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=w4n/PVXJaI0AZ90mJ+ujyPK1tladHQFvLZoHvifyNgE=; b=rfzOm1zO0b471p2GhDzzMDl6LsyxtkhYYVWrW1g+1LEonR+ycMYNGBaoWdzRDPh5d8 Itrh63dzq8xsur0yntdJybApRZhtuH7IpPziU28fd6vgYoZni5JRh4MuurzNQxOO09rk doZYEBKcFuerBw2xDr4ZB4ycAI08FK19aTFKQ8AMB6RTAuFWIhKDKKn3O8AJloXt4VjF In9I9UmB5d0LP9h7EqI+iUEBOxthIsAO38+m2AyytDS6jToOI45aALPrfrnf8bMexrvz 36CJwcoLpR6yaXYp5Jdz0ppUsc49t1Vja9Qm85zFmRVxFkU9V4SVdFrogtpfSwsULYmg XOKw== X-Gm-Message-State: ACrzQf1IpXvfi8mlL7SFbufbtx/T85dgnsYjO8VyGVCLup2vHOTj7zJM q54pdQ1Glcalt9SvCLGNg1U= X-Google-Smtp-Source: AMsMyM6TyZvntfj8dZLfSz4qg5QK2s6ccmOhWhLCF/L7jN7iiEWR70pxBXfHuyGjjbod1jZaStISWQ== X-Received: by 2002:adf:ed01:0:b0:230:d7c8:9a91 with SMTP id a1-20020adfed01000000b00230d7c89a91mr9737366wro.511.1667258538245; Mon, 31 Oct 2022 16:22:18 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2501:c701:15da:d6ab:ec79:436]) by smtp.gmail.com with ESMTPSA id l24-20020a1c7918000000b003cf7928e731sm2190343wme.9.2022.10.31.16.22.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 16:22: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 v4 9/9] media: i2c: ov5645: Call ov5645_entity_init_cfg() before registering the subdev Date: Mon, 31 Oct 2022 23:22:02 +0000 Message-Id: <20221031232202.131945-10-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20221031232202.131945-1-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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 --- v3->v4 * No change 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 0a889283da36..c8999fc4f26f 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -1220,6 +1220,8 @@ static int ov5645_probe(struct i2c_client *client) pm_runtime_get_noresume(dev); pm_runtime_enable(dev); + 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"); @@ -1231,8 +1233,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: