aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk
diff options
context:
space:
mode:
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>2013-09-04 08:21:18 -0400
committerSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>2013-09-29 15:07:12 -0400
commit27966ffe43d412483f0823b15b8c035db04969c7 (patch)
treec6446aae17aae65f22db819cfcfcddf0341f3261 /drivers/clk
parent74227e65f9742f559f6e243ba2c9a983e1f1221d (diff)
clk: prima2: declare OF clock provider
Common clock framework allows to register clock providers to get called on of_clk_init() by using CLK_OF_DECLARE. This converts prima2 clock provider to make use of it and get rid of the mach specific clk init call. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Acked-by: Barry Song <baohua.song@csr.com> Acked-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/clk-prima2.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/drivers/clk/clk-prima2.c b/drivers/clk/clk-prima2.c
index 5ab95f1ad579..6c15e3316137 100644
--- a/drivers/clk/clk-prima2.c
+++ b/drivers/clk/clk-prima2.c
@@ -1015,16 +1015,6 @@ static struct clk_std clk_usb1 = {
1015 }, 1015 },
1016}; 1016};
1017 1017
1018static struct of_device_id clkc_ids[] = {
1019 { .compatible = "sirf,prima2-clkc" },
1020 {},
1021};
1022
1023static struct of_device_id rsc_ids[] = {
1024 { .compatible = "sirf,prima2-rsc" },
1025 {},
1026};
1027
1028enum prima2_clk_index { 1018enum prima2_clk_index {
1029 /* 0 1 2 3 4 5 6 7 8 9 */ 1019 /* 0 1 2 3 4 5 6 7 8 9 */
1030 rtc, osc, pll1, pll2, pll3, mem, sys, security, dsp, gps, 1020 rtc, osc, pll1, pll2, pll3, mem, sys, security, dsp, gps,
@@ -1082,24 +1072,16 @@ static struct clk_hw *prima2_clk_hw_array[maxclk] __initdata = {
1082static struct clk *prima2_clks[maxclk]; 1072static struct clk *prima2_clks[maxclk];
1083static struct clk_onecell_data clk_data; 1073static struct clk_onecell_data clk_data;
1084 1074
1085void __init sirfsoc_of_clk_init(void) 1075static void __init sirfsoc_clk_init(struct device_node *np)
1086{ 1076{
1087 struct device_node *np; 1077 struct device_node *rscnp;
1088 int i; 1078 int i;
1089 1079
1090 np = of_find_matching_node(NULL, rsc_ids); 1080 rscnp = of_find_compatible_node(NULL, NULL, "sirf,prima2-rsc");
1091 if (!np) 1081 sirfsoc_rsc_vbase = of_iomap(rscnp, 0);
1092 panic("unable to find compatible rsc node in dtb\n");
1093
1094 sirfsoc_rsc_vbase = of_iomap(np, 0);
1095 if (!sirfsoc_rsc_vbase) 1082 if (!sirfsoc_rsc_vbase)
1096 panic("unable to map rsc registers\n"); 1083 panic("unable to map rsc registers\n");
1097 1084 of_node_put(rscnp);
1098 of_node_put(np);
1099
1100 np = of_find_matching_node(NULL, clkc_ids);
1101 if (!np)
1102 return;
1103 1085
1104 sirfsoc_clk_vbase = of_iomap(np, 0); 1086 sirfsoc_clk_vbase = of_iomap(np, 0);
1105 if (!sirfsoc_clk_vbase) 1087 if (!sirfsoc_clk_vbase)
@@ -1124,3 +1106,4 @@ void __init sirfsoc_of_clk_init(void)
1124 1106
1125 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data); 1107 of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
1126} 1108}
1109CLK_OF_DECLARE(sirfsoc_clk, "sirf,prima2-clkc", sirfsoc_clk_init);