From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Ripard Subject: Re: [PATCH] clk: add flags to distinguish xtal clocks Date: Sun, 10 Nov 2013 12:37:16 +0100 Message-ID: <20131110113716.GN26440@lukather> References: <1382528150.21526.25.camel@porter.coelho.fi> <1383933648-28595-1-git-send-email-balbi@ti.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Rnz0oC2K6vQ5doJs" Return-path: Content-Disposition: inline In-Reply-To: <1383933648-28595-1-git-send-email-balbi@ti.com> Sender: linux-kernel-owner@vger.kernel.org To: Felipe Balbi Cc: mturquette@linaro.org, james.hogan@imgtec.com, Linux Kernel Mailing List , Linux OMAP Mailing List , luca@coelho.fi, Linux ARM Kernel Mailing List List-Id: linux-omap@vger.kernel.org --Rnz0oC2K6vQ5doJs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Felipe, 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/Do= cumentation/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 pin. > - 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; > + Introducing a new compatible instead of a property would make more sense here I think. Do you have a reason not to do so? Thanks, Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com --Rnz0oC2K6vQ5doJs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJSf2/rAAoJEBx+YmzsjxAgojgP/RUNKa+E7DiHN4gNIIWMUqwv AdFxrEEfFsQPy1poEnr5bkWTlelAl9tPXEh4CRQOXaLDhB/kbYCHXLRn+zsk1jQJ 7amnv9L7HWWjtQemwgwssaQ02KVzlDG8LcreWDlCZp31dcE7CjF+2WOqPMYJoEcp /m6TThZBa5NW+b314DileNM+XGmhkW7XAL/AFkKJBRDlTAxpXfx/WT+ahCSFabSE I90pWk33nR4Vech1mJZ+btmA9mxxNZhd8MrIyCVcKbeUJdjRhYtlWqEqEwjlaDtg /5FJzSsv+Dd8S2TWmT8xv/DUD5i7CMmwQqit1RffJo5Wem0i9Ljo8MkpdN3q6txE 4L0vcbN7pxx3u8aBtYYcHgTHR9xQJ6uw92eyq92+8oyJuQKYurHEBkSn8PmMZ3OE LE2cmDIeCs7tbsaNrQdy02DCyjKIWcm81PZ3Plq6R4Ph7s1WK/oyMQrodn87fIMc I0nQvz3sMEGpSJG5+53jgyDT4Re/mrdYwouP9/qRbf7EdmGxnEuwjH21SfvHVwJe X6z9CU4dvMVWCEuKrZ0b+0u/g8eUntagxn5/JZ4J1FW3+W4pB2bpOWLlhJchYca3 n/3U49smArCLXVxPGExEq8QB1f8YqzGXFoKc88diBKkNdvYOWwKxJn6vOjkpSgg7 I5w4rsSTBztyKPBAlc+k =bTHE -----END PGP SIGNATURE----- --Rnz0oC2K6vQ5doJs-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: maxime.ripard@free-electrons.com (Maxime Ripard) Date: Sun, 10 Nov 2013 12:37:16 +0100 Subject: [PATCH] clk: add flags to distinguish xtal clocks In-Reply-To: <1383933648-28595-1-git-send-email-balbi@ti.com> References: <1382528150.21526.25.camel@porter.coelho.fi> <1383933648-28595-1-git-send-email-balbi@ti.com> Message-ID: <20131110113716.GN26440@lukather> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Felipe, On Fri, Nov 08, 2013 at 12:00:48PM -0600, Felipe Balbi wrote: > From: Luciano Coelho > > Add a flag that indicate whether the clock is a crystal or not. > > Additionally, parse a new device tree binding in clk-fixed-rate to set > this flag. > > 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. > > Signed-off-by: Luciano Coelho > Signed-off-by: Felipe Balbi > --- > > Dropped CLK_IS_TYPE_DEFINED flag and just assume that if the flag > isn't there, default behavior will be taken. > > 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(-) > > 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 pin. > - clock-output-names : From common clock binding. > +- clock-xtal: true when a clock is provided by a crystal > > 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 = node->name; > u32 rate; > + unsigned long flags = CLK_IS_ROOT; > > if (of_property_read_u32(node, "clock-frequency", &rate)) > return; > > + if (of_property_read_bool(node, "clock-xtal")) > + flags |= CLK_IS_TYPE_XTAL; > + Introducing a new compatible instead of a property would make more sense here I think. Do you have a reason not to do so? Thanks, Maxime -- Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: