Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp644039ybg; Thu, 19 Mar 2020 06:19:07 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvJ47rV5u1HyTMBx23cILK8rkPatyu9cEAo3vuMJluy+0/M4BCWb+Xs6TVfhDoNaCR+ZqUy X-Received: by 2002:aca:f449:: with SMTP id s70mr2203481oih.86.1584623947584; Thu, 19 Mar 2020 06:19:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584623947; cv=none; d=google.com; s=arc-20160816; b=YtpHsbmXUfMK7jaJucisJdv3p3WtmFCK2JVBu2cqnqpGqPCwjZ5H1VmBBbzk7Owvw7 1o97wsBbL/OwD8eLah/qulAAcTGEnfDHAnaHHVI7bzR+/tbnELlrCQb02/XXNSId+zSr HWNNa5a8doo/oUeBf7sJD4atmd0jVkoI41P93j3ZP6qa4CGf/xt1wmn4hpGQmGRhGpIc hQff7LtMxBQqzX6vZRmgTPO0R7BJN/mZZ9qaQj2x6o/Mi8fgm86AtZSD4O8DbDbPCZQ9 UrYoAKMbagGZI233TiSr3KL+F8ndVPTnKOFLqDwOhXC0lCgE81HOzxq55pCV+KkpPG0Q RlYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qDQpti7t01GpCTV3F9lVKa0JXF79TC4yEbf9DOSPn8g=; b=KAmffAGoAxnz2Z8Xy9nlwf8ejSaW2M0Y6SK0uoC3OuC4zCXdYgkYVhwTzzXm+YsYWO bPxyqF0Kc9CiqCIGjqLbqKx1iqIwEXU5UG5zO4CFDd1x9kMKFzPjG5Ry4umxUIICrGwZ 2VpadqriZ744eYqaHnC9v/Y7pYDb+sT8i5eVlAHaSElXpk9z1K5HicBDwLRN/GFfQzwy 543nm0XRE+Ij4Ciq9LfVBrxxuN20E7k540AO1ZpRf+MdTUAEIM3MKw3ZYUXFBNbXbvfH BBZwSq3qI8Em5/eOOgkmni7FHSWoBREnYgzGX8WP6GLBpeA95iaQfdm2FyzsJKyOYCWx BwhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mcAQ0yZC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e193si1108452oib.276.2020.03.19.06.18.53; Thu, 19 Mar 2020 06:19:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mcAQ0yZC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729787AbgCSNS0 (ORCPT + 99 others); Thu, 19 Mar 2020 09:18:26 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:34576 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729763AbgCSNSS (ORCPT ); Thu, 19 Mar 2020 09:18:18 -0400 Received: by mail-oi1-f195.google.com with SMTP id j5so2634509oij.1; Thu, 19 Mar 2020 06:18:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qDQpti7t01GpCTV3F9lVKa0JXF79TC4yEbf9DOSPn8g=; b=mcAQ0yZCaJg48cbZ+UPok9xqwUcsLaZsb9fzmjLgeh8zdqkKXz81zq/ILbwNrBso2a MN4btAAs+YQirt8xgKGSVUBCNTD5zHSZMVoAo15X2tUTWsKNcvIDf9ULConjYj0Aprz0 bpiQ94KXoh7flze0IXswZPt+qyF2ZmgAi+FL55Ar139q+XJxp4ZasBrKaZYUwGFxD95X tRz65ibnOZuh9KDbSY3lfdkiqYrn9QcbjX/2NHFqETcoSloqNpfMtrf5PdxLbZOgMjA/ GFpujd6djm/SWaidRo4GwHfr2sGBvYlPciDOrkswyNdJYyeprCBX+oLvAN4PxdBkODDL lXEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qDQpti7t01GpCTV3F9lVKa0JXF79TC4yEbf9DOSPn8g=; b=NgK+Nb2BDfym+91DR2b7pBSA+2CY96Hu58aoFKaBGWv1hVxUi3LMHUIbeGKzWQfOTX cRj84OuHwjf7BcBJyUZy7/ApEnKoyjIOmlMuRZqm/cZDITEn9aPAzMjmfU3ew1OElFy5 V7nXWvK2wOdeyJpgoKWZ39QBV/W3ZI0dmfiuFKR+NCTnxgpXOMNkrOcEmC4GvzxgQz4D 6Ze6H/sdKpjGrYDoMC5/BjawN21XX1iTWSsNTCYtIQcVAvWt1YJp9JQdF+XXjgH1RLvH UPzUnfwG1RfHVMSnbserkpdWxnBkCOelT+igAGm8SF9nnWfc7+a+2/9ppZ1JxmmoWd6n tE5A== X-Gm-Message-State: ANhLgQ2mBDrS3Luc0AhFr5qD3BrVu8k55A+T7Ghmgudo91RxlO2ImPKb oUCJ9i4Kq1deKpE18kMynHlkL52yCsAat6jNb1A= X-Received: by 2002:aca:ac89:: with SMTP id v131mr2290732oie.7.1584623898057; Thu, 19 Mar 2020 06:18:18 -0700 (PDT) MIME-Version: 1.0 References: <1584133954-6953-1-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com> <1584133954-6953-2-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com> <20200319124452.3yfcvq754vi4q2rv@gilmour.lan> <20200319130348.GC4872@pendragon.ideasonboard.com> In-Reply-To: <20200319130348.GC4872@pendragon.ideasonboard.com> From: "Lad, Prabhakar" Date: Thu, 19 Mar 2020 13:17:51 +0000 Message-ID: Subject: Re: [PATCH v3 1/4] media: dt-bindings: media: i2c: Switch to assigned-clock-rates To: Laurent Pinchart Cc: Maxime Ripard , Mark Rutland , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Fabio Estevam , Sakari Ailus , Ezequiel Garcia , Sascha Hauer , Magnus Damm , Lad Prabhakar , LKML , Linux-Renesas , Rob Herring , Geert Uytterhoeven , NXP Linux Team , Pengutronix Kernel Team , Mauro Carvalho Chehab , Shawn Guo , LAK , linux-media Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Laurent, On Thu, Mar 19, 2020 at 1:04 PM Laurent Pinchart wrote: > > Hi Maxime, > > On Thu, Mar 19, 2020 at 01:44:52PM +0100, Maxime Ripard wrote: > > On Fri, Mar 13, 2020 at 09:12:31PM +0000, Lad Prabhakar wrote: > > > Use assigned-clock-rates to specify the clock rate. Also mark > > > clock-frequency property as deprecated. > > > > > > Signed-off-by: Lad Prabhakar > > > --- > > > Documentation/devicetree/bindings/media/i2c/ov5645.txt | 5 +++-- > > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > > > diff --git a/Documentation/devicetree/bindings/media/i2c/ov5645.txt b/Documentation/devicetree/bindings/media/i2c/ov5645.txt > > > index 72ad992..e62fe82 100644 > > > --- a/Documentation/devicetree/bindings/media/i2c/ov5645.txt > > > +++ b/Documentation/devicetree/bindings/media/i2c/ov5645.txt > > > @@ -8,7 +8,7 @@ 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. > > > +- clock-frequency (deprecated): 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 > > > @@ -37,7 +37,8 @@ Example: > > > > > > clocks = <&clks 200>; > > > clock-names = "xclk"; > > > - clock-frequency = <24000000>; > > > + assigned-clocks = <&clks 200>; > > > + assigned-clock-rates = <24000000>; > > > > > > vdddo-supply = <&camera_dovdd_1v8>; > > > vdda-supply = <&camera_avdd_2v8>; > > > > clock-frequency is quite different from assigned-clock-rates though, > > semantically speaking. clock-frequency is only about what the clock > > frequency is, while assigned-clock-rates will change the rate as well, > > and you have no idea how long it will last. > > The driver currently reads the clock-frequency property and then calls > clk_set_rate(). I agree tht assigned-clock-rates isn't a panacea, but I > think it's less of a hack than what we currently have. > > As discussed on IRC, maybe the best option in this specific case is to > drop clock-frequency and assigned-clok-rates, and call clk_set_rate() > with a hardcoded frequency of 24MHz in the driver, as that's the only > frequency the driver supports. > Does this mean any driver which has a fixed clock requirement shouldn't be a DT property and should be just handled by the drivers internally ? Cheers, --Prabhakar > > If you want to retrieve that through the clock framework, then just > > making clock-frequency optional is enough and falling back to > > clk_get_rate on the clocks property already provided is enough. > > -- > Regards, > > Laurent Pinchart > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel