From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3650C10F27 for ; Tue, 10 Mar 2020 08:50:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D0F242051A for ; Tue, 10 Mar 2020 08:50:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726598AbgCJIug (ORCPT ); Tue, 10 Mar 2020 04:50:36 -0400 Received: from mga11.intel.com ([192.55.52.93]:47014 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726423AbgCJIue (ORCPT ); Tue, 10 Mar 2020 04:50:34 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Mar 2020 01:50:33 -0700 X-IronPort-AV: E=Sophos;i="5.70,535,1574150400"; d="scan'208";a="353571216" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Mar 2020 01:50:30 -0700 Received: by paasikivi.fi.intel.com (Postfix, from userid 1000) id 8506F209DF; Tue, 10 Mar 2020 10:50:27 +0200 (EET) Date: Tue, 10 Mar 2020 10:50:27 +0200 From: Sakari Ailus To: Lad Prabhakar Cc: Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Kieran Bingham , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Lad Prabhakar Subject: Re: [PATCH 2/2] media: i2c: ov5645: Switch to assigned-clock-rates Message-ID: <20200310085027.GA5379@paasikivi.fi.intel.com> References: <1583754373-16510-1-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com> <1583754373-16510-3-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1583754373-16510-3-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Prabhakar, On Mon, Mar 09, 2020 at 11:46:13AM +0000, Lad Prabhakar wrote: > This patch switches to assigned-clock-rates for specifying the clock rate. > The clk-conf.c internally handles setting the clock rate, as a result > setting the clk rate from the driver is dropped. > > Correspondingly imx6qdl-wandboard.dtsi which references to ov5645 has been > updated to use assigned-clock-rates in the same patch to avoid bisect > failures. > > Signed-off-by: Lad Prabhakar > --- > arch/arm/boot/dts/imx6qdl-wandboard.dtsi | 3 ++- > drivers/media/i2c/ov5645.c | 9 ++------- > 2 files changed, 4 insertions(+), 8 deletions(-) > > diff --git a/arch/arm/boot/dts/imx6qdl-wandboard.dtsi b/arch/arm/boot/dts/imx6qdl-wandboard.dtsi > index c070893..71f5f75 100644 > --- a/arch/arm/boot/dts/imx6qdl-wandboard.dtsi > +++ b/arch/arm/boot/dts/imx6qdl-wandboard.dtsi > @@ -126,7 +126,8 @@ > reg = <0x3c>; > clocks = <&clks IMX6QDL_CLK_CKO2>; > clock-names = "xclk"; > - clock-frequency = <24000000>; > + assigned-clocks = <&clks IMX6QDL_CLK_CKO2>; > + assigned-clock-rates = <24000000>; > vdddo-supply = <®_1p8v>; > vdda-supply = <®_2p8v>; > vddd-supply = <®_1p5v>; Shouldn't this be a separate patch? > diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c > index a6c17d1..2aa2677 100644 > --- a/drivers/media/i2c/ov5645.c > +++ b/drivers/media/i2c/ov5645.c > @@ -1094,7 +1094,8 @@ static int ov5645_probe(struct i2c_client *client) > return PTR_ERR(ov5645->xclk); > } > > - ret = of_property_read_u32(dev->of_node, "clock-frequency", &xclk_freq); > + ret = of_property_read_u32(dev->of_node, "assigned-clock-rates", > + &xclk_freq); I think you'd still need to check for clock-frequency to be compatible with existing DT binaries. > if (ret) { > dev_err(dev, "could not get xclk frequency\n"); > return ret; > @@ -1107,12 +1108,6 @@ static int ov5645_probe(struct i2c_client *client) > return -EINVAL; > } > > - ret = clk_set_rate(ov5645->xclk, xclk_freq); > - if (ret) { > - dev_err(dev, "could not set xclk frequency\n"); > - return ret; > - } > - > for (i = 0; i < OV5645_NUM_SUPPLIES; i++) > ov5645->supplies[i].supply = ov5645_supply_name[i]; > -- Regards, Sakari Ailus