Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4471357imm; Mon, 25 Jun 2018 16:47:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLrnZtVjiU42PZ+C80YVuKDWi0eaNjqkDzhr3uwDU+B3Z6kobgrn1tpEhRVkvwHHHh7+YNO X-Received: by 2002:a17:902:294a:: with SMTP id g68-v6mr14682303plb.58.1529970444737; Mon, 25 Jun 2018 16:47:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529970444; cv=none; d=google.com; s=arc-20160816; b=eE6QFn+Q6MhaTEOEloXwSmiqzD+t0I9n2gfI9wePlQ6CTUM8iiOoWLvpy08ES/KV6v 7a67hpgRysOhT9kn9Uxt39qjBtCD9v1Zsjsiz+myD5prTBxxyTwl9wTEdnvHRzosa+Oz stc7mng2P8JdOAXEqZWW+C6j8PfkCGlq599zuOjXlx+C3q8h21aMpfEUdPtKe3pqRVcn EQL7psswqZWy2wxyUGdqUpgcbtC4IjrFGhm570x81+aP5i614MLSBT550nS1PuCsJCAa vFXFK3HE9WxWyCi3nrFUD7ILlIwCQNxLTtXjVoP8hpW0YBaG+ASRqXYxHHEdzWBXQah/ 9DJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=0MrOkIQ8kQ7wYp/llamHEXflCmnsS7MeyU/ipEjWCLU=; b=nfbehaMiXjNgVhB77V2zpAmL3weV2qiN9uAPumV/YP2wbg31zPhtlYZfWYDBw8wJT/ BW+xuvwyYPxVyuGx+GRhdk3oN3mDE1uioO96jB2RbQA8t6QQhYqwjD7zIOvOW3h+SjB3 +v9sPvuAuw0/dvYHJkfDj8xup4oKJ8U06wvix3D6ZIXJ8OJXDkqIRraSOWPTTlm280Bp Ws83r/nuo6J4Mb0Srk43A8xkaEjDJ6o1yGtuUUFJguB+ZjEkmiAVULx+YeDklSTh8tEG S4emnURW0DlioZafW4mHCUU4I5vzpFUfYY8PT/uyNQxDE4dk1O49DgpB5fdg83khxOdD jHJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tBVabdZ1; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i27-v6si213058pfd.117.2018.06.25.16.47.10; Mon, 25 Jun 2018 16:47:24 -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=@kernel.org header.s=default header.b=tBVabdZ1; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933730AbeFYXq1 (ORCPT + 99 others); Mon, 25 Jun 2018 19:46:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:43004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932249AbeFYXqZ (ORCPT ); Mon, 25 Jun 2018 19:46:25 -0400 Received: from localhost (unknown [104.132.1.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5C109262D3; Mon, 25 Jun 2018 23:46:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1529970385; bh=IApJM56opbXGllbkdJHlyxcSdyPgHuuMYaTJBbgXw8k=; h=To:From:In-Reply-To:Cc:References:Subject:Date:From; b=tBVabdZ1hzYIag9GWnpNk14giQsVKBNi6su3QlTPx+5u3b+362/xFzO5X/Jyc+/WM rhSJTEuAwSeiRv5W/Mvjwn4Shhlbwq0dA9F3+cQg1FKHfHt/dO0b2QPds655zp6Hxl LPGpybGKtirBIuyvHWcfrKnTut3w9bVEFGsRSv9M= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: Matti Vaittinen From: Stephen Boyd In-Reply-To: <20180613130338.GH20078@localhost.localdomain> Cc: Matti Vaittinen , broonie@kernel.org, lee.jones@linaro.org, lgirdwood@gmail.com, mark.rutland@arm.com, mturquette@baylibre.com, robh+dt@kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mikko.mutanen@fi.rohmeurope.com, heikki.haikola@fi.rohmeurope.com References: <152878945117.16708.12422348324182290971@swboyd.mtv.corp.google.com> <20180612082354.GG20078@localhost.localdomain> <20180613130338.GH20078@localhost.localdomain> Message-ID: <152997038474.143105.3390705878521933864@swboyd.mtv.corp.google.com> User-Agent: alot/0.7 Subject: Re: [PATCH v5 4/4] clk: bd71837: Add driver for BD71837 PMIC clock Date: Mon, 25 Jun 2018 16:46:24 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Matti Vaittinen (2018-06-13 06:03:38) > On Tue, Jun 12, 2018 at 11:23:54AM +0300, Matti Vaittinen wrote: > > = > > I see. This makes sense. I need to verify from HW colleagues whether > > this chip has internal oscillator or not. I originally thought we have > > on-chip oscillator - but as you say, we do have XIN pin in documentatio= n. > > So now I am not sure if the test board I have contains oscillator drivi= ng > > the clk on PMIC - or if the PMIC has internal oscillator. I'll clarify = this. > = > It really turned out that the PMIC just acts as a clock buffer. So I do > as you suggested and add lookup for parent clock to the driver. I > planned to do it so that if no parent is found from DT - then we assume > the 32.768KHz clock (as described in documentation). Eg, something along > the lines: > = > init.parent_names =3D of_clk_get_parent_name(pdev->dev.parent->of= _node, 0); > if (init.parent_names) { > init.num_parents =3D 1; > } else { > /* If parent is not given from DT we assume the typical u= se-case with > * 32.768 KHz oscillator for RTC (Maybe we could just err= or out here?) > */ > c->rate =3D BD71837_CLK_RATE; > bd71837_clk_ops.recalc_rate =3D &bd71837_clk_recalc_rate; > } You can also add a clk directly in this driver in that case there isn't one in DT with the rate and name of your choosing. Then the logic is the same and we don't need a c->rate variable.