From mboxrd@z Thu Jan 1 00:00:00 1970 From: Felipe Balbi Subject: Re: [PATCH] clk: add flags to distinguish xtal clocks Date: Mon, 11 Nov 2013 13:42:47 -0600 Message-ID: <20131111194247.GB19212@saruman.home> References: <1382528150.21526.25.camel@porter.coelho.fi> <1383933648-28595-1-git-send-email-balbi@ti.com> <20131110113716.GN26440@lukather> Reply-To: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Fba/0zbH8Xs+Fj9o" Return-path: Received: from devils.ext.ti.com ([198.47.26.153]:47939 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754323Ab3KKTnm (ORCPT ); Mon, 11 Nov 2013 14:43:42 -0500 Content-Disposition: inline In-Reply-To: <20131110113716.GN26440@lukather> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Maxime Ripard Cc: Felipe Balbi , mturquette@linaro.org, james.hogan@imgtec.com, Linux Kernel Mailing List , Linux OMAP Mailing List , luca@coelho.fi, Linux ARM Kernel Mailing List --Fba/0zbH8Xs+Fj9o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Sun, Nov 10, 2013 at 12:37:16PM +0100, Maxime Ripard wrote: > Hi Felipe, >=20 > On Fri, Nov 08, 2013 at 12:00:48PM -0600, Felipe Balbi wrote: > > From: Luciano Coelho > >=20 > > Add a flag that indicate whether the clock is a crystal or not. > >=20 > > Additionally, parse a new device tree binding in clk-fixed-rate to set > > this flag. > >=20 > > If clock-xtal isn't set, the clock framework will assume clock to be > > generated by an oscillator. There's only one user for this binding > > right now which is Texas Instruments' WiLink devices which need to know > > details about the clock in order to initialize the underlying WiFi HW > > correctly. > >=20 > > Signed-off-by: Luciano Coelho > > Signed-off-by: Felipe Balbi > > --- > >=20 > > Dropped CLK_IS_TYPE_DEFINED flag and just assume that if the flag > > isn't there, default behavior will be taken. > >=20 > > Documentation/devicetree/bindings/clock/fixed-clock.txt | 1 + > > drivers/clk/clk-fixed-rate.c | 6 +++++- > > include/linux/clk-provider.h | 1 + > > 3 files changed, 7 insertions(+), 1 deletion(-) > >=20 > > diff --git a/Documentation/devicetree/bindings/clock/fixed-clock.txt b/= Documentation/devicetree/bindings/clock/fixed-clock.txt > > index 0b1fe78..3036dfe 100644 > > --- a/Documentation/devicetree/bindings/clock/fixed-clock.txt > > +++ b/Documentation/devicetree/bindings/clock/fixed-clock.txt > > @@ -12,6 +12,7 @@ Required properties: > > Optional properties: > > - gpios : From common gpio binding; gpio connection to clock enable pi= n. > > - clock-output-names : From common clock binding. > > +- clock-xtal: true when a clock is provided by a crystal > > =20 > > Example: > > clock { > > diff --git a/drivers/clk/clk-fixed-rate.c b/drivers/clk/clk-fixed-rate.c > > index 1ed591a..5db9bf0 100644 > > --- a/drivers/clk/clk-fixed-rate.c > > +++ b/drivers/clk/clk-fixed-rate.c > > @@ -91,13 +91,17 @@ void of_fixed_clk_setup(struct device_node *node) > > struct clk *clk; > > const char *clk_name =3D node->name; > > u32 rate; > > + unsigned long flags =3D CLK_IS_ROOT; > > =20 > > if (of_property_read_u32(node, "clock-frequency", &rate)) > > return; > > =20 > > + if (of_property_read_bool(node, "clock-xtal")) > > + flags |=3D CLK_IS_TYPE_XTAL; > > + >=20 > Introducing a new compatible instead of a property would make more > sense here I think. >=20 > Do you have a reason not to do so? As you can see, this is original work from Luca but I disagree that adding a new compatible makes more sense. This still related to a fixed rate clock, we're just giving it one extra metadata which will differentiate between crystal and oscilator fixed rate clocks. --=20 balbi --Fba/0zbH8Xs+Fj9o Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) iQIcBAEBAgAGBQJSgTM3AAoJEIaOsuA1yqREI9wQAKb8luTtqRqzci4iZXe3qHx3 6nbM3qtDE67TcoMr5wSt/rQk27lnhO1RRw7HxOqHFkrq9BSzJMJBda4gJdnYteD1 fGuKTn+nK0lF8kJbyI9fsnVna3D3gULXN/vnzCKhQ50Yw2wpkIakmq+eLCmLy93a ahEmjswG9GKDHdAG3A6KtY9BKvLNKrNK+Ev8xH5i4HTKn/9WVGyj7eVhCFRdFC/U 8elbFdBPOQwb9IhreY/c7s81MGgEU9n/ahQ14GKFcmMYPFVYxLn2IHLJOuHoKh5b 5TMT7n1WJ2Z/azckO9Zh0UzDQVKvNcGxJfOxfa6Ny7O7f1nJW4gxMluvCQU2Xl7P VhwLZjunwQ4SWkzMoRVju+7lN4LpZVPQYtXfGWgv/K0W1Kh6axrnF5z2m2/TpZ9M HNaKZineupE2wnRa4RH6Nl8350UR5qen8f3AobplY6+q2XHvsNHOLo0xmarGfE++ 8pmVpEP0PFI/qALrdSs1rqviqv+nXdRG5AY/6c0DN4pXerT4E2TnQ+CPUAcKAVo5 1XAZjTC7joanrgjL/YZoFydUQeDYOcZolNAxN7R2dFZk80pBvKADjwZJRsbhzuLF 9sCCOmVhJVtGScZMo6eanKJEVExC/EbfJo0kJE4Xn92uYqOo8lGr+TWcDFGcvohK gp04MArxiDrhk1qN0rc5 =oiBX -----END PGP SIGNATURE----- --Fba/0zbH8Xs+Fj9o--