All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Felipe Balbi <balbi@ti.com>
Cc: mturquette@linaro.org, james.hogan@imgtec.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux OMAP Mailing List <linux-omap@vger.kernel.org>,
	luca@coelho.fi,
	Linux ARM Kernel Mailing List
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] clk: add flags to distinguish xtal clocks
Date: Sun, 10 Nov 2013 12:37:16 +0100	[thread overview]
Message-ID: <20131110113716.GN26440@lukather> (raw)
In-Reply-To: <1383933648-28595-1-git-send-email-balbi@ti.com>

[-- Attachment #1: Type: text/plain, Size: 2477 bytes --]

Hi Felipe,

On Fri, Nov 08, 2013 at 12:00:48PM -0600, Felipe Balbi wrote:
> From: Luciano Coelho <luca@coelho.fi>
> 
> 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 <luca@coelho.fi>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> ---
> 
> 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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clk: add flags to distinguish xtal clocks
Date: Sun, 10 Nov 2013 12:37:16 +0100	[thread overview]
Message-ID: <20131110113716.GN26440@lukather> (raw)
In-Reply-To: <1383933648-28595-1-git-send-email-balbi@ti.com>

Hi Felipe,

On Fri, Nov 08, 2013 at 12:00:48PM -0600, Felipe Balbi wrote:
> From: Luciano Coelho <luca@coelho.fi>
> 
> 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 <luca@coelho.fi>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> ---
> 
> 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: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131110/85679620/attachment.sig>

  parent reply	other threads:[~2013-11-10 11:37 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-04 21:05 [RFC] clk: add flags to distinguish xtal clocks Luciano Coelho
2013-07-04 21:05 ` Luciano Coelho
2013-07-04 22:25 ` Mike Turquette
2013-07-04 22:37   ` Luciano Coelho
2013-07-04 22:37     ` Luciano Coelho
2013-07-04 23:19     ` Mike Turquette
2013-07-05  7:54       ` Luciano Coelho
2013-07-05  7:54         ` Luciano Coelho
2013-07-29 13:50         ` Luciano Coelho
2013-07-29 13:50           ` Luciano Coelho
2013-10-07  7:44           ` Mike Turquette
2013-10-08 15:27             ` Felipe Balbi
2013-10-08 15:27               ` Felipe Balbi
2013-10-16 10:24               ` Luca Coelho
2013-10-16 10:24                 ` Luca Coelho
2013-10-23  9:24                 ` Mike Turquette
2013-10-23  9:24                   ` Mike Turquette
2013-10-23 11:35                   ` Luca Coelho
2013-10-23 11:35                     ` Luca Coelho
2013-11-08 18:00                     ` [PATCH] " Felipe Balbi
2013-11-08 18:00                       ` Felipe Balbi
2013-11-08 18:00                       ` Felipe Balbi
2013-11-08 19:16                       ` Luca Coelho
2013-11-08 19:16                         ` Luca Coelho
2013-11-10 11:37                       ` Maxime Ripard [this message]
2013-11-10 11:37                         ` Maxime Ripard
2013-11-11 19:42                         ` Felipe Balbi
2013-11-11 19:42                           ` Felipe Balbi
2013-11-11 19:42                           ` Felipe Balbi
2013-11-11 19:50                           ` Luca Coelho
2013-11-11 19:50                             ` Luca Coelho
2013-11-11 20:59                             ` Maxime Ripard
2013-11-11 20:59                               ` Maxime Ripard
2013-11-12  8:05                               ` Luca Coelho
2013-11-12  8:05                                 ` Luca Coelho
2013-11-13 14:40                                 ` Maxime Ripard
2013-11-13 14:40                                   ` Maxime Ripard
2013-11-11 20:54                           ` Maxime Ripard
2013-11-11 20:54                             ` Maxime Ripard
2013-11-11 16:27                       ` Stephen Warren
2013-11-11 16:27                         ` Stephen Warren
2013-11-11 19:43                         ` Felipe Balbi
2013-11-11 19:43                           ` Felipe Balbi
2013-11-11 19:43                           ` Felipe Balbi
2013-07-05 13:12 ` [RFC] " James Hogan
2013-07-05 13:12   ` James Hogan
2013-07-05 13:21   ` Felipe Balbi
2013-07-05 13:21     ` Felipe Balbi
2013-07-05 13:22   ` Luciano Coelho
2013-07-05 13:22     ` Luciano Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131110113716.GN26440@lukather \
    --to=maxime.ripard@free-electrons.com \
    --cc=balbi@ti.com \
    --cc=james.hogan@imgtec.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=luca@coelho.fi \
    --cc=mturquette@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.