From: sebastian.hesselbarth@gmail.com (Sebastian Hesselbarth)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 03/26] clk: nomadik: declare OF clock provider
Date: Sun, 22 Sep 2013 18:46:22 +0200 [thread overview]
Message-ID: <1379868382-2877-1-git-send-email-sebastian.hesselbarth@gmail.com> (raw)
In-Reply-To: <1379526839-14798-4-git-send-email-sebastian.hesselbarth@gmail.com>
Common clock framework allows to register clock providers to get called
on of_clk_init() by using CLK_OF_DECLARE. This converts nomadik clock
provider to make use of it and get rid of the mach specific clk init
call. As clocks require system reset controller base address to be
initialized each clock driver checks src_base and calls new
nomadik_src_init if required.
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
Changelog:
v1->v2:
- adapt to clk-nomadik changes
Cc: Olof Johansson <olof@lixom.net>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Alessandro Rubini <rubini@unipv.it>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: STEricsson <STEricsson_nomadik_linux@list.st.com>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
---
arch/arm/mach-nomadik/cpu-8815.c | 5 ++--
drivers/clk/clk-nomadik.c | 45 ++++++++++-------------------
include/linux/platform_data/clk-nomadik.h | 2 --
3 files changed, 17 insertions(+), 35 deletions(-)
delete mode 100644 include/linux/platform_data/clk-nomadik.h
diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c
index 0fcb149..2be38a0 100644
--- a/arch/arm/mach-nomadik/cpu-8815.c
+++ b/arch/arm/mach-nomadik/cpu-8815.c
@@ -25,7 +25,7 @@
#include <linux/slab.h>
#include <linux/irq.h>
#include <linux/dma-mapping.h>
-#include <linux/platform_data/clk-nomadik.h>
+#include <linux/clk-provider.h>
#include <linux/clocksource.h>
#include <linux/of_irq.h>
#include <linux/of_gpio.h>
@@ -115,8 +115,7 @@ static void cpu8815_restart(enum reboot_mode mode, const char *cmd)
static void __init cpu8815_timer_init_of(void)
{
- /* We need this to be up now */
- nomadik_clk_init();
+ of_clk_init(NULL);
clocksource_of_init();
}
diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c
index 06b29c26..ce2d6b3 100644
--- a/drivers/clk/clk-nomadik.c
+++ b/drivers/clk/clk-nomadik.c
@@ -512,6 +512,9 @@ static void __init of_nomadik_pll_setup(struct device_node *np)
const char *parent_name;
u32 pll_id;
+ if (!src_base)
+ nomadik_src_init();
+
if (of_property_read_u32(np, "pll-id", &pll_id)) {
pr_err("%s: PLL \"%s\" missing pll-id property\n",
__func__, clk_name);
@@ -522,6 +525,8 @@ static void __init of_nomadik_pll_setup(struct device_node *np)
if (!IS_ERR(clk))
of_clk_add_provider(np, of_clk_src_simple_get, clk);
}
+CLK_OF_DECLARE(nomadik_pll_clk,
+ "st,nomadik-pll-clock", of_nomadik_pll_setup);
static void __init of_nomadik_hclk_setup(struct device_node *np)
{
@@ -529,6 +534,9 @@ static void __init of_nomadik_hclk_setup(struct device_node *np)
const char *clk_name = np->name;
const char *parent_name;
+ if (!src_base)
+ nomadik_src_init();
+
parent_name = of_clk_get_parent_name(np, 0);
/*
* The HCLK divides PLL1 with 1 (passthru), 2, 3 or 4.
@@ -541,6 +549,8 @@ static void __init of_nomadik_hclk_setup(struct device_node *np)
if (!IS_ERR(clk))
of_clk_add_provider(np, of_clk_src_simple_get, clk);
}
+CLK_OF_DECLARE(nomadik_hclk_clk,
+ "st,nomadik-hclk-clock", of_nomadik_hclk_setup);
static void __init of_nomadik_src_clk_setup(struct device_node *np)
{
@@ -549,6 +559,9 @@ static void __init of_nomadik_src_clk_setup(struct device_node *np)
const char *parent_name;
u32 clk_id;
+ if (!src_base)
+ nomadik_src_init();
+
if (of_property_read_u32(np, "clock-id", &clk_id)) {
pr_err("%s: SRC clock \"%s\" missing clock-id property\n",
__func__, clk_name);
@@ -559,33 +572,5 @@ static void __init of_nomadik_src_clk_setup(struct device_node *np)
if (!IS_ERR(clk))
of_clk_add_provider(np, of_clk_src_simple_get, clk);
}
-
-static const struct of_device_id nomadik_src_clk_match[] __initconst = {
- {
- .compatible = "fixed-clock",
- .data = of_fixed_clk_setup,
- },
- {
- .compatible = "fixed-factor-clock",
- .data = of_fixed_factor_clk_setup,
- },
- {
- .compatible = "st,nomadik-pll-clock",
- .data = of_nomadik_pll_setup,
- },
- {
- .compatible = "st,nomadik-hclk-clock",
- .data = of_nomadik_hclk_setup,
- },
- {
- .compatible = "st,nomadik-src-clock",
- .data = of_nomadik_src_clk_setup,
- },
- { /* sentinel */ }
-};
-
-void __init nomadik_clk_init(void)
-{
- nomadik_src_init();
- of_clk_init(nomadik_src_clk_match);
-}
+CLK_OF_DECLARE(nomadik_src_clk,
+ "st,nomadik-src-clock", of_nomadik_src_clk_setup);
diff --git a/include/linux/platform_data/clk-nomadik.h b/include/linux/platform_data/clk-nomadik.h
deleted file mode 100644
index 5713c87..0000000
--- a/include/linux/platform_data/clk-nomadik.h
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Minimal platform data header */
-void nomadik_clk_init(void);
--
1.7.10.4
next prev parent reply other threads:[~2013-09-22 16:46 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-18 17:53 [PATCH 00/26] ARM: provide common arch init for DT clocks Sebastian Hesselbarth
2013-09-18 17:53 ` [PATCH 01/26] ARM: nomadik: move mtu setup to clocksource init Sebastian Hesselbarth
2013-09-20 20:49 ` Linus Walleij
2013-09-20 20:51 ` Linus Walleij
2013-09-20 21:08 ` Sebastian Hesselbarth
2013-09-20 21:11 ` Linus Walleij
2013-09-20 21:13 ` Sebastian Hesselbarth
2013-09-20 21:22 ` Linus Walleij
2013-09-22 12:18 ` Sebastian Hesselbarth
2013-09-20 21:37 ` [PATCH v2 01/26] ARM: nomadik: remove mtu initalization from .init_time Sebastian Hesselbarth
2013-09-18 17:53 ` [PATCH 02/26] clk: nomadik: move src init out of nomadik_clk_init Sebastian Hesselbarth
2013-09-20 20:54 ` Linus Walleij
2013-09-22 16:45 ` [PATCH v2 " Sebastian Hesselbarth
2013-09-18 17:53 ` [PATCH 03/26] clk: nomadik: declare OF clock provider Sebastian Hesselbarth
2013-09-20 20:55 ` Linus Walleij
2013-09-22 16:46 ` Sebastian Hesselbarth [this message]
2013-09-18 17:53 ` [PATCH 04/26] clk: prima2: " Sebastian Hesselbarth
2013-09-19 8:45 ` Barry Song
2013-09-19 8:48 ` Sebastian Hesselbarth
2013-09-22 12:12 ` Sebastian Hesselbarth
2013-09-22 10:37 ` Barry Song
2013-09-27 18:21 ` Sebastian Hesselbarth
2013-09-29 4:49 ` Barry Song
2013-09-18 17:53 ` [PATCH 05/26] ARM: socfgpa: prepare for arch-wide .init_time callback Sebastian Hesselbarth
2013-09-26 6:12 ` Sebastian Hesselbarth
2013-09-26 13:06 ` Dinh Nguyen
2013-09-18 17:53 ` [PATCH 06/26] clk: sunxi: declare OF clock provider Sebastian Hesselbarth
2013-09-25 20:03 ` Maxime Ripard
2013-09-18 17:53 ` [PATCH 07/26] clk: vt8500: parse pmc_base from clock driver Sebastian Hesselbarth
2013-09-19 19:02 ` Tony Prisk
2013-09-19 19:12 ` Sebastian Hesselbarth
2013-09-20 4:51 ` Tony Prisk
2013-09-20 6:23 ` Sebastian Hesselbarth
2013-09-20 18:23 ` Tony Prisk
2013-09-20 6:22 ` [PATCH v2 " Sebastian Hesselbarth
2013-09-18 17:53 ` [PATCH 08/26] ARM: vt8500: prepare for arch-wide .init_time callback Sebastian Hesselbarth
2013-09-18 17:53 ` [PATCH 09/26] ARM: call of_clk_init from default time_init handler Sebastian Hesselbarth
2013-09-23 7:54 ` [PATCH v2 " Sebastian Hesselbarth
2013-09-18 17:53 ` [PATCH 10/26] ARM: bcm2835: remove custom .init_time hook Sebastian Hesselbarth
2013-09-18 19:37 ` Stephen Warren
2013-09-18 17:53 ` [PATCH 11/26] ARM: dove: " Sebastian Hesselbarth
2013-09-21 12:22 ` Andrew Lunn
2013-09-22 12:20 ` Sebastian Hesselbarth
2013-09-23 9:10 ` Andrew Lunn
2013-09-23 13:32 ` Jason Cooper
2013-09-23 17:46 ` Sebastian Hesselbarth
2013-09-18 17:53 ` [PATCH 12/26] ARM: exynos: " Sebastian Hesselbarth
2013-09-26 6:21 ` Sebastian Hesselbarth
2013-09-26 8:08 ` Tomasz Figa
2013-09-18 17:53 ` [PATCH 13/26] ARM: highbank: " Sebastian Hesselbarth
2013-09-18 17:53 ` [PATCH 14/26] ARM: imx: " Sebastian Hesselbarth
2013-09-18 17:53 ` [PATCH 15/26] ARM: kirkwood: " Sebastian Hesselbarth
2013-09-21 20:27 ` Andrew Lunn
2013-09-23 13:32 ` Jason Cooper
2013-09-18 17:53 ` [PATCH 16/26] ARM: mxs: " Sebastian Hesselbarth
2013-09-20 8:57 ` Shawn Guo
2013-09-18 17:53 ` [PATCH 17/26] ARM: nomadik: " Sebastian Hesselbarth
2013-09-20 20:56 ` Linus Walleij
2013-09-18 17:53 ` [PATCH 18/26] ARM: nspire: " Sebastian Hesselbarth
2013-09-18 17:53 ` [PATCH 19/26] ARM: prima2: " Sebastian Hesselbarth
2013-09-18 17:53 ` [PATCH 20/26] ARM: rockchip: " Sebastian Hesselbarth
2013-09-19 8:40 ` Heiko Stübner
2013-09-18 17:53 ` [PATCH 21/26] ARM: socfpga: " Sebastian Hesselbarth
2013-09-26 13:07 ` Dinh Nguyen
2013-09-18 17:53 ` [PATCH 22/26] ARM: sti: " Sebastian Hesselbarth
2013-09-18 17:53 ` [PATCH 23/26] ARM: sunxi: " Sebastian Hesselbarth
2013-09-25 20:07 ` Maxime Ripard
2013-09-26 6:15 ` Sebastian Hesselbarth
2013-09-27 17:02 ` Maxime Ripard
2013-09-18 17:53 ` [PATCH 24/26] ARM: tegra: " Sebastian Hesselbarth
2013-09-18 19:38 ` Stephen Warren
2013-09-18 17:53 ` [PATCH 25/26] ARM: vexpress: " Sebastian Hesselbarth
2013-09-19 13:34 ` Pawel Moll
2013-09-18 17:53 ` [PATCH 26/26] ARM: vt8500: " Sebastian Hesselbarth
2013-09-18 19:47 ` [PATCH 00/26] ARM: provide common arch init for DT clocks Jason Cooper
2013-09-18 19:52 ` Sebastian Hesselbarth
2013-09-18 20:45 ` Stephen Warren
2013-09-18 20:48 ` Olof Johansson
2013-09-18 21:04 ` Sebastian Hesselbarth
2013-09-20 19:16 ` Matt Porter
2013-09-22 12:14 ` Sebastian Hesselbarth
2013-09-23 17:45 ` Matt Porter
2013-09-23 18:41 ` Christian Daudt
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=1379868382-2877-1-git-send-email-sebastian.hesselbarth@gmail.com \
--to=sebastian.hesselbarth@gmail.com \
--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).