aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2013-04-02 07:02:36 -0400
committerMike Turquette <mturquette@linaro.org>2013-04-03 15:55:31 -0400
commitf640c0fad698c0e4b07e05373681d3681125d6af (patch)
treed5806255d66f425eba40b29362e648aa241237b2
parent3566d40c1a4617461b38c82059bdc41d622faa8b (diff)
clk: mvebu: Use common of_clk_init() function
The use common of_clk_init() function simplifies the clock initialization and adds handling of the DT "fixed-clock". Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mike Turquette <mturquette@linaro.org> [mturquette@linaro.org: fixed $SUBJECT to reflect correct file path]
-rw-r--r--drivers/clk/mvebu/clk-cpu.c17
-rw-r--r--drivers/clk/mvebu/clk-cpu.h22
-rw-r--r--drivers/clk/mvebu/clk.c6
3 files changed, 3 insertions, 42 deletions
diff --git a/drivers/clk/mvebu/clk-cpu.c b/drivers/clk/mvebu/clk-cpu.c
index 9dd2551a0a41..b0fbc0715491 100644
--- a/drivers/clk/mvebu/clk-cpu.c
+++ b/drivers/clk/mvebu/clk-cpu.c
@@ -16,7 +16,6 @@
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/of.h> 17#include <linux/of.h>
18#include <linux/delay.h> 18#include <linux/delay.h>
19#include "clk-cpu.h"
20 19
21#define SYS_CTRL_CLK_DIVIDER_CTRL_OFFSET 0x0 20#define SYS_CTRL_CLK_DIVIDER_CTRL_OFFSET 0x0
22#define SYS_CTRL_CLK_DIVIDER_VALUE_OFFSET 0xC 21#define SYS_CTRL_CLK_DIVIDER_VALUE_OFFSET 0xC
@@ -173,17 +172,5 @@ clks_out:
173 kfree(cpuclk); 172 kfree(cpuclk);
174} 173}
175 174
176static const __initconst struct of_device_id clk_cpu_match[] = { 175CLK_OF_DECLARE(armada_xp_cpu_clock, "marvell,armada-xp-cpu-clock",
177 { 176 of_cpu_clk_setup);
178 .compatible = "marvell,armada-xp-cpu-clock",
179 .data = of_cpu_clk_setup,
180 },
181 {
182 /* sentinel */
183 },
184};
185
186void __init mvebu_cpu_clk_init(void)
187{
188 of_clk_init(clk_cpu_match);
189}
diff --git a/drivers/clk/mvebu/clk-cpu.h b/drivers/clk/mvebu/clk-cpu.h
deleted file mode 100644
index 08e2affba4e6..000000000000
--- a/drivers/clk/mvebu/clk-cpu.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * Marvell MVEBU CPU clock handling.
3 *
4 * Copyright (C) 2012 Marvell
5 *
6 * Gregory CLEMENT <gregory.clement@free-electrons.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#ifndef __MVEBU_CLK_CPU_H
14#define __MVEBU_CLK_CPU_H
15
16#ifdef CONFIG_MVEBU_CLK_CPU
17void __init mvebu_cpu_clk_init(void);
18#else
19static inline void mvebu_cpu_clk_init(void) {}
20#endif
21
22#endif
diff --git a/drivers/clk/mvebu/clk.c b/drivers/clk/mvebu/clk.c
index 855681b8a9dc..29f10fb3006c 100644
--- a/drivers/clk/mvebu/clk.c
+++ b/drivers/clk/mvebu/clk.c
@@ -10,18 +10,14 @@
10 * warranty of any kind, whether express or implied. 10 * warranty of any kind, whether express or implied.
11 */ 11 */
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/clk.h>
14#include <linux/clk-provider.h> 13#include <linux/clk-provider.h>
15#include <linux/of_address.h>
16#include <linux/clk/mvebu.h>
17#include <linux/of.h> 14#include <linux/of.h>
18#include "clk-core.h" 15#include "clk-core.h"
19#include "clk-cpu.h"
20#include "clk-gating-ctrl.h" 16#include "clk-gating-ctrl.h"
21 17
22void __init mvebu_clocks_init(void) 18void __init mvebu_clocks_init(void)
23{ 19{
24 mvebu_core_clk_init(); 20 mvebu_core_clk_init();
25 mvebu_gating_clk_init(); 21 mvebu_gating_clk_init();
26 mvebu_cpu_clk_init(); 22 of_clk_init(NULL);
27} 23}