Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3638720rwb; Tue, 20 Sep 2022 02:30:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Y+yfYl1x9b/ipERfymF9ZWOEuIdIpXDH5Q1ET/sMn21TjFRblCmJhKv8wmCxTugSq4pTW X-Received: by 2002:a05:6402:298b:b0:44f:20a:2db2 with SMTP id eq11-20020a056402298b00b0044f020a2db2mr19432467edb.138.1663666220741; Tue, 20 Sep 2022 02:30:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663666220; cv=none; d=google.com; s=arc-20160816; b=JH8i2g6CZd6D1+uKgvRJUK6HCKj2bWwkaxVW65rwmcWVUPHZ82fWo3Kc7EFS21ZkMS eXODi0DhPtPNaJ1WJEa1X+v9UNeDk8FV5fe8DTbFtxUtrHXtKn46PF5vX5AJ1ChTlZaa 3Nh8lH/N7uc9PZ/uQZf0cg9UT5Jd3YHghhqDPQq42XhGd4//1FZ1o9+D5dsfcdenfjbn FR/gKDRlCWN030z7QE0CnvbbMNwcEWj1U9PH/NrAf2JWpFIYxmOlKzVyAQzFmzYu94hF f9fs2FVu087OWK2ngtPlvvZOhZn+h1o/rV3lC+BoLX4ds60e7FEBG5keALH1Ved1o0/o dXlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=9SFyxpheQa6F6i+/UXrHaEnpFfMPBgxcVDJQCX+dfms=; b=KDu3R0prkAzRjc3xEnxlLvoLb9vLmJ4NDTyttfDiUQBqM8pexKx4o++XUS16Kg7Gab ajHLwRrE9t8YLiZBRekBbCm1EAGsUdRE+OX2rQeubSoiKYsDU6hMl3Yegtf52m6B8k3a AF2iIfky/09keW6v0DORLwzdDS/6yppkXRmDR3ydESxM2xJWXD9ncSK7qU/Xx4yb1EnS U4LtV8m2wJuBlgS7sbsUKATCy+MlINgMV3XLENP85W9799iQjvR53NUKY3/rF0ruU2ky xtX3UuHs1z3sfzQtNgX44TJXvdm5RFBsx3OK6vIyHPyeQjKOUeYOBNnBu8v2uVyAzYPO asQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o14-20020a170906974e00b00771396445b2si1141230ejy.194.2022.09.20.02.29.55; Tue, 20 Sep 2022 02:30:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230323AbiITI4a (ORCPT + 99 others); Tue, 20 Sep 2022 04:56:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230359AbiITI42 (ORCPT ); Tue, 20 Sep 2022 04:56:28 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD3056B170 for ; Tue, 20 Sep 2022 01:56:26 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaZ3C-0008RQ-Ba; Tue, 20 Sep 2022 10:56:18 +0200 Received: from mfe by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1oaZ3B-0002kh-He; Tue, 20 Sep 2022 10:56:17 +0200 Date: Tue, 20 Sep 2022 10:56:17 +0200 From: Marco Felsch To: Sakari Ailus Cc: mchehab@kernel.org, laurent.pinchart+renesas@ideasonboard.com, akinobu.mita@gmail.com, jacopo+renesas@jmondi.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] media: mt9m111: add V4L2_CID_LINK_FREQ support Message-ID: <20220920085617.7cfflloegh7en4mj@pengutronix.de> References: <20220916135713.143890-1-m.felsch@pengutronix.de> <20220919130829.ddoe2ajnrarkywgy@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sakari, On 22-09-19, Sakari Ailus wrote: ... > > > > + ret = clk_prepare_enable(mt9m111->clk); > > > > + if (ret < 0) > > > > + return ret; > > > > + > > > > + extclk_rate = clk_get_rate(mt9m111->clk); > > > > + clk_disable_unprepare(mt9m111->clk); > > > > > > I don't think you'll need to enable a clock to just get its frequency. > > > > The official API states that you need to turn on the clk before > > requesting it and it makes sense. Also there is a new helper > > devm_clk_get_enabled() which addresses simple clk usage since most of > > drivers don't enable it before requesting the rate. > > I guess the rate could change in the meantime, unless exclusive access is > requested. Not only that, there are a bunch of clk provider hw around which may need to turned on first. Anyway, I really don't care on this topic. As I said I wanted to fullfil the API and if drop clk_prepare_enable() I don't. So if this okay for you I will go that way. > The clock framework currently doesn't offer a way to set the assigned > rate and prevent changing it. But above, couldn't the clock frequency > be changed again once the clock has been disabled? Yes it could. Regards, Marco