linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/7] clk: mvebu: init all mvebu clock types from mvebu_clocks_init()
Date: Mon, 19 Nov 2012 19:25:13 +0100	[thread overview]
Message-ID: <20121119182513.GR14643@lunn.ch> (raw)
In-Reply-To: <1353343963-23034-2-git-send-email-thomas.petazzoni@free-electrons.com>

On Mon, Nov 19, 2012 at 05:52:37PM +0100, Thomas Petazzoni wrote:
> The mvebu_clocks_init() function should register all the mvebu clock
> types, so that all mvebu platforms only have to call
> mvebu_clocks_init().
> 
> This fixes mach-mvebu because mvebu_clk_gating_init() was never called
> and therefore none of the gating clocks were registered.
> 
> mach-kirkwood and mach-dove are updated to not call
> mvebu_clk_gating_init() a second time. Thanks to this, it is no longer
> necessary to expose mvebu_clk_gating_init() beyond the clock
> framework, so we get rid of its prototype in <linux/clk/mvebu.h> and
> we add it in a private drivers/clk/mvebu/clk-gating-ctrl.h header
> file.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  arch/arm/mach-dove/common.c         |    1 -
>  arch/arm/mach-kirkwood/board-dt.c   |    1 -
>  drivers/clk/mvebu/clk-gating-ctrl.h |   18 ++++++++++++++++++
>  drivers/clk/mvebu/clk.c             |    2 ++
>  include/linux/clk/mvebu.h           |    1 -
>  5 files changed, 20 insertions(+), 3 deletions(-)
>  create mode 100644 drivers/clk/mvebu/clk-gating-ctrl.h
> 
> diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
> index 4b09d12..6a2c4dc 100644
> --- a/arch/arm/mach-dove/common.c
> +++ b/arch/arm/mach-dove/common.c
> @@ -421,7 +421,6 @@ static void __init dove_legacy_clk_init(void)
>  static void __init dove_of_clk_init(void)
>  {
>  	mvebu_clocks_init();
> -	mvebu_clk_gating_init();
>  	dove_legacy_clk_init();
>  }
>  
> diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
> index f55393b..40db4a8 100644
> --- a/arch/arm/mach-kirkwood/board-dt.c
> +++ b/arch/arm/mach-kirkwood/board-dt.c
> @@ -80,7 +80,6 @@ static void __init kirkwood_legacy_clk_init(void)
>  static void __init kirkwood_of_clk_init(void)
>  {
>  	mvebu_clocks_init();
> -	mvebu_clk_gating_init();
>  	kirkwood_legacy_clk_init();
>  }
>  
> diff --git a/drivers/clk/mvebu/clk-gating-ctrl.h b/drivers/clk/mvebu/clk-gating-ctrl.h
> new file mode 100644
> index 0000000..20cc4ad
> --- /dev/null
> +++ b/drivers/clk/mvebu/clk-gating-ctrl.h
> @@ -0,0 +1,18 @@
> +/*
> + * Marvell EBU gating clock handling
> + *
> + * Copyright (C) 2012 Marvell
> + *
> + * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2.  This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + */
> +
> +#ifndef __MVEBU_CLK_GATING_H
> +#define __MVEBU_CLK_GATING_H
> +
> +void __init mvebu_clk_gating_init(void);
> +
> +#endif
> diff --git a/drivers/clk/mvebu/clk.c b/drivers/clk/mvebu/clk.c
> index dc310d6..3f0e43e 100644
> --- a/drivers/clk/mvebu/clk.c
> +++ b/drivers/clk/mvebu/clk.c
> @@ -17,6 +17,7 @@
>  #include <linux/of.h>
>  #include "clk-core.h"
>  #include "clk-cpu.h"
> +#include "clk-gating-ctrl.h"
>  
>  static const __initconst struct of_device_id clk_match[] = {
>  #ifdef CONFIG_MVEBU_CLK_CPU
> @@ -33,5 +34,6 @@ static const __initconst struct of_device_id clk_match[] = {
>  void __init mvebu_clocks_init(void)
>  {
>  	mvebu_core_clk_init();
> +	mvebu_clk_gating_init();
>  	of_clk_init(clk_match);
>  }

Hi Thomas

You have a minor problem here.

obj-$(CONFIG_MVEBU_CLK_GATING)  += clk-gating-ctrl.o

There is no guarantee mvebu_clk_gating_init() exists. In fact, orion5x
does not have gated clocks, so won't be selecting this option.

     Andrew

  reply	other threads:[~2012-11-19 18:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-19 16:52 arm: mvebu: Various mvebu clock fixes/improvements Thomas Petazzoni
2012-11-19 16:52 ` [PATCH 1/7] clk: mvebu: init all mvebu clock types from mvebu_clocks_init() Thomas Petazzoni
2012-11-19 18:25   ` Andrew Lunn [this message]
2012-11-19 18:44     ` Thomas Petazzoni
2012-11-19 16:52 ` [PATCH 2/7] clk: mvebu: move clk-cpu compatible strings into the clk-cpu driver Thomas Petazzoni
2012-11-19 16:52 ` [PATCH 3/7] clk: mvebu: rename mvebu_clk_gating_init() to mvebu_gating_clk_init() Thomas Petazzoni
2012-11-19 16:52 ` [PATCH 4/7] arm: mvebu: move DT cpu clock nodes to the Armada XP specific .dtsi Thomas Petazzoni
2012-11-19 18:38   ` Andrew Lunn
2012-11-19 18:50     ` Thomas Petazzoni
2012-11-19 16:52 ` [PATCH 5/7] clk: mvebu: rename *-core-clocks to *-core-clock Thomas Petazzoni
2012-11-19 16:52 ` [PATCH 6/7] clk: mvebu: rename armada-xp-cpu-clockctrl to armada-xp-cpu-clock Thomas Petazzoni
2012-11-19 16:52 ` [PATCH 7/7] arm: mvebu: fix SATA clocks on Armada 370/XP Thomas Petazzoni
2012-11-19 18:27 ` arm: mvebu: Various mvebu clock fixes/improvements Andrew Lunn
2012-11-19 18:46   ` Thomas Petazzoni
2012-11-20  9:40   ` Thomas Petazzoni
2012-11-20  9:43     ` Andrew Lunn
2012-11-20 10:06       ` Thomas Petazzoni
2012-11-20 10:50         ` Thomas Petazzoni
2012-11-20 16:22   ` Thomas Petazzoni

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=20121119182513.GR14643@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).