1 From be0804513a506de96925f9ed1aa8dc1facd4c180 Mon Sep 17 00:00:00 2001
2 From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
3 Date: Fri, 6 Sep 2013 14:59:57 +0200
4 Subject: [PATCH] clk: sunxi: declare OF clock provider
6 Common clock framework allows to register clock providers to get called
7 on of_clk_init() by using CLK_OF_DECLARE. This converts sunxi clock
8 providers to make use of it and get rid of the mach specific clk init
9 call. As sunxi has a bunch of independent clk provider nodes, we hook
10 current clock init to board compatible to make it called once.
12 Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
13 Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
14 Acked-by: Mike Turquette <mturquette@linaro.org>
16 arch/arm/mach-sunxi/sunxi.c | 4 +---
17 drivers/clk/sunxi/clk-sunxi.c | 11 ++++++-----
18 include/linux/clk/sunxi.h | 22 ----------------------
19 3 files changed, 7 insertions(+), 30 deletions(-)
20 delete mode 100644 include/linux/clk/sunxi.h
22 diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
23 index e79fb34..e5a6975 100644
24 --- a/arch/arm/mach-sunxi/sunxi.c
25 +++ b/arch/arm/mach-sunxi/sunxi.c
28 #include <linux/reboot.h>
30 -#include <linux/clk/sunxi.h>
32 #include <asm/mach/arch.h>
33 #include <asm/mach/map.h>
34 #include <asm/system_misc.h>
35 @@ -118,7 +116,7 @@ static void sunxi_setup_restart(void)
37 static void __init sunxi_timer_init(void)
39 - sunxi_init_clocks();
41 clocksource_of_init();
44 diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
45 index 34ee69f..9bbd035 100644
46 --- a/drivers/clk/sunxi/clk-sunxi.c
47 +++ b/drivers/clk/sunxi/clk-sunxi.c
50 #include <linux/clk-provider.h>
51 #include <linux/clkdev.h>
52 -#include <linux/clk/sunxi.h>
54 #include <linux/of_address.h>
56 @@ -617,11 +616,8 @@ static void __init of_sunxi_table_clock_setup(const struct of_device_id *clk_mat
60 -void __init sunxi_init_clocks(void)
61 +static void __init sunxi_init_clocks(struct device_node *np)
63 - /* Register all the simple and basic clocks on DT */
66 /* Register factor clocks */
67 of_sunxi_table_clock_setup(clk_factors_match, sunxi_factors_clk_setup);
69 @@ -634,3 +630,8 @@ void __init sunxi_init_clocks(void)
70 /* Register gate clocks */
71 of_sunxi_table_clock_setup(clk_gates_match, sunxi_gates_clk_setup);
73 +CLK_OF_DECLARE(sun4i_a10_clk_init, "allwinner,sun4i-a10", sunxi_init_clocks);
74 +CLK_OF_DECLARE(sun5i_a10s_clk_init, "allwinner,sun5i-a10s", sunxi_init_clocks);
75 +CLK_OF_DECLARE(sun5i_a13_clk_init, "allwinner,sun5i-a13", sunxi_init_clocks);
76 +CLK_OF_DECLARE(sun6i_a31_clk_init, "allwinner,sun6i-a31", sunxi_init_clocks);
77 +CLK_OF_DECLARE(sun7i_a20_clk_init, "allwinner,sun7i-a20", sunxi_init_clocks);
78 diff --git a/include/linux/clk/sunxi.h b/include/linux/clk/sunxi.h
79 deleted file mode 100644
80 index e074fdd..0000000
81 --- a/include/linux/clk/sunxi.h
85 - * Copyright 2012 Maxime Ripard
87 - * Maxime Ripard <maxime.ripard@free-electrons.com>
89 - * This program is free software; you can redistribute it and/or modify
90 - * it under the terms of the GNU General Public License as published by
91 - * the Free Software Foundation; either version 2 of the License, or
92 - * (at your option) any later version.
94 - * This program is distributed in the hope that it will be useful,
95 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
96 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
97 - * GNU General Public License for more details.
100 -#ifndef __LINUX_CLK_SUNXI_H_
101 -#define __LINUX_CLK_SUNXI_H_
103 -void __init sunxi_init_clocks(void);