Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2170711rwb; Mon, 19 Sep 2022 00:13:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM75CDe+w6tkRuSEYm3g9GhPPbTTgEwmMcnj/gbnJRsrvSLDzI7+Iu3bw7A1cdSX6seAh03p X-Received: by 2002:a05:6402:510c:b0:451:f363:24ee with SMTP id m12-20020a056402510c00b00451f36324eemr14568283edd.156.1663571606376; Mon, 19 Sep 2022 00:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663571606; cv=none; d=google.com; s=arc-20160816; b=kLTV4i9ET9Xlm0rzt2Jg5Kx8HFbzvLsz6LLpf1NPK90YQvXNBuI1Cs5ejyIVNbzpf5 EIbRdH1Wr87iGUChXnybCzw1rukeYatbeam2Fff/iWXYHeap63BdUVSY59gZHAaIU7G5 SQDS3cSifVfmy7L8Z8ctuRRLqf1Rgk+zlFKWPfJw0UzJIzNLreRNDp7HWAZEaqpyrA0E Q0kb1AuTm7oIGqD/nYfylbh3av5Zdt4C+B5n6Wvc/OXfOSH5D+FXSS8jVsOIpNjW2YyI L/qj3cFCC9QbXhSkxixK4B2sdbg7Y4T6HRZEtsaYGzxDwuyOhG/CiXPvtWgTBwiAkptg ZTFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4wVD206MlNrG7owFM1iZ0Ib6EcTARAetLsUgDza2gC0=; b=IpsTzMlzXmCmbJrkkllarSPzW/u31D9CsMC0Iqs/jPE22GhyZhwea5isyGjmmkuPBd GajlXVBM4NRStGZbcNXOnfoG0q6A2CRhwQlWsQ+ci8O4THbBYjjznDr2PQHS7GTxJy85 +ubWNKXz6JHM8DRUqycAr5jVqZMszoHln5Xpzmsj2FabL7wmaqE2/HTJVCRV5OMvD8ge w/5ninLY5OwQ7259fy3SawSB1ai2FkZ035PBIDV2UTOFtCGGu67g1UB673AY7AKrQBwI JOO+GfXqqy/dSM+3fWh2M1W6aVZb+ynxrETqakj236mU1cR/XYd5Cea1J8A0E4x/ZPrt 4MQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HfWiTD30; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020a056402270700b0045028bed6e7si9801027edd.600.2022.09.19.00.13.01; Mon, 19 Sep 2022 00:13:26 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=HfWiTD30; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229715AbiISGdX (ORCPT + 99 others); Mon, 19 Sep 2022 02:33:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbiISGdU (ORCPT ); Mon, 19 Sep 2022 02:33:20 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8244317A88; Sun, 18 Sep 2022 23:33:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663569199; x=1695105199; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=r0/uBQA5005Rs7fYs3jAa6s1cVz0tORDno4ZJmynCXc=; b=HfWiTD30ya3KzIEB5BzjcJzveFdfn3v6SzYSsLVyWN+WJJ5dN26yuCBt rD2Y+nR1XPoqOIinwkiWxIEf4Cqr/dljimBFkhVSIOOAd4vgjpn2MKEm5 gCxlYo1Y+Iix0yTx5/PTZFCeDt+LVZJPg4gRiH09HZFXgvJeFaBmFOb76 IRLN8cI4vGhZ7PfM7sBPzzGqEm9lGJ3BpizkJrcEEOlRralNUBFIF3oWe y7rq23XZ065biZfggxpTvcknQhLfuSJsMyTgnf+ceVeWyYMTZGXojftsz 70v3JOFGZ7DpGYFl2awewKsL/+EBeVvWlrx+Hw1zL4vm/kv1mjyC4ln5p A==; X-IronPort-AV: E=McAfee;i="6500,9779,10474"; a="282344198" X-IronPort-AV: E=Sophos;i="5.93,327,1654585200"; d="scan'208";a="282344198" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2022 23:33:19 -0700 X-IronPort-AV: E=Sophos;i="5.93,327,1654585200"; d="scan'208";a="760738803" Received: from punajuuri.fi.intel.com (HELO paasikivi.fi.intel.com) ([10.237.72.43]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2022 23:33:15 -0700 Received: from paasikivi.fi.intel.com (localhost [127.0.0.1]) by paasikivi.fi.intel.com (Postfix) with SMTP id BB04220078; Mon, 19 Sep 2022 09:33:12 +0300 (EEST) Date: Mon, 19 Sep 2022 06:33:12 +0000 From: Sakari Ailus To: Tommaso Merciai Cc: Mikhail Rudenko , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Hans Verkuil , Jacopo Mondi , Shawn Tu , Randy Dunlap , Daniel Scally , Christian Hemp , Laurent Pinchart , Marek Vasut , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] media: i2c: add support for ov4689 Message-ID: References: <20220911200147.375198-1-mike.rudenko@gmail.com> <20220911200147.375198-3-mike.rudenko@gmail.com> <20220914155122.GA9874@tom-ThinkPad-T14s-Gen-2i> <87k064pa2v.fsf@gmail.com> <20220916133401.GB2701@tom-ThinkPad-T14s-Gen-2i> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220916133401.GB2701@tom-ThinkPad-T14s-Gen-2i> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 Tommaso, On Fri, Sep 16, 2022 at 03:34:01PM +0200, Tommaso Merciai wrote: > > >> + ret = clk_set_rate(ov4689->xvclk, OV4689_XVCLK_FREQ); > > >> + if (ret < 0) { > > >> + dev_err(dev, "Failed to set xvclk rate (24MHz)\n"); > > >> + return ret; > > >> + } > > >> + if (clk_get_rate(ov4689->xvclk) != OV4689_XVCLK_FREQ) > > >> + dev_warn(dev, "xvclk mismatched, modes are based on 24MHz\n"); > > > > > > > > > What do you think about? > > > Thanks. > > > > Unfortunately, I have no experience with ACPI-based devices. :( > > > > Do you mean that in the case of an ACPI device and devm_clk_get_optional > > returning NULL we should assume that the clock is already enabled and > > will stay enabled during sensor operation? How should we distinguish it > > from the case of an OF-based system and clock just missing from device > > tree? > > Not exaclty :) > > I copy comment from [1] > > if you use ov5693->xvclk to identify the ACPI vs OF use case shouldn't > you use the get_optionl() version ? Otherwise in the ACPI case you will have > -ENOENT if there's not 'xvclk' property and bail out. > > Unless my understanding is wrong on ACPI we have "clock-frequency" and > on OF "xvclk" with an "assigned-clock-rates", Generally yes. It's also possible to have a clock in ACPI based system although those clocks do not come from ACPI. See e.g. drivers/platform/x86/intel/int3472/clk_and_regulator.c . -- Sakari Ailus