diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-03-29 04:10:06 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-03-29 04:10:06 -0400 |
commit | c55fbdd3f97a468d51cbdb03bb7c9c7287fbda2f (patch) | |
tree | 0686a6e20a86b1dd79929a4f7b571dff479bbb2d /arch/sh/kernel | |
parent | e21d2aa76e1fc91cbf18c4b593d32112d954fab5 (diff) |
sh: sh7785 clkdev lookups.
Convert to TMU clock lookups for SH7785.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh7785.c | 39 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 6 |
2 files changed, 38 insertions, 7 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c index 6061c736c281..28de049a59b1 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * SH7785 support for the clock framework | 4 | * SH7785 support for the clock framework |
5 | * | 5 | * |
6 | * Copyright (C) 2007 - 2009 Paul Mundt | 6 | * Copyright (C) 2007 - 2010 Paul Mundt |
7 | * | 7 | * |
8 | * This file is subject to the terms and conditions of the GNU General Public | 8 | * This file is subject to the terms and conditions of the GNU General Public |
9 | * License. See the file "COPYING" in the main directory of this archive | 9 | * License. See the file "COPYING" in the main directory of this archive |
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/clk.h> | 14 | #include <linux/clk.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/cpufreq.h> | 16 | #include <linux/cpufreq.h> |
17 | #include <asm/clkdev.h> | ||
17 | #include <asm/clock.h> | 18 | #include <asm/clock.h> |
18 | #include <asm/freq.h> | 19 | #include <asm/freq.h> |
19 | #include <cpu/sh7785.h> | 20 | #include <cpu/sh7785.h> |
@@ -113,12 +114,48 @@ static struct clk mstp_clks[] = { | |||
113 | SH_CLK_MSTP32("gdta_fck", -1, NULL, MSTPCR1, 0, 0), | 114 | SH_CLK_MSTP32("gdta_fck", -1, NULL, MSTPCR1, 0, 0), |
114 | }; | 115 | }; |
115 | 116 | ||
117 | static struct clk_lookup lookups[] = { | ||
118 | { | ||
119 | /* TMU0 */ | ||
120 | .dev_id = "sh_tmu.0", | ||
121 | .con_id = "tmu_fck", | ||
122 | .clk = &mstp_clks[13], /* tmu012_fck */ | ||
123 | }, { | ||
124 | /* TMU1 */ | ||
125 | .dev_id = "sh_tmu.1", | ||
126 | .con_id = "tmu_fck", | ||
127 | .clk = &mstp_clks[13], | ||
128 | }, { | ||
129 | /* TMU2 */ | ||
130 | .dev_id = "sh_tmu.2", | ||
131 | .con_id = "tmu_fck", | ||
132 | .clk = &mstp_clks[13], | ||
133 | }, { | ||
134 | /* TMU3 */ | ||
135 | .dev_id = "sh_tmu.3", | ||
136 | .con_id = "tmu_fck", | ||
137 | .clk = &mstp_clks[12], /* tmu345_fck */ | ||
138 | }, { | ||
139 | /* TMU4 */ | ||
140 | .dev_id = "sh_tmu.4", | ||
141 | .con_id = "tmu_fck", | ||
142 | .clk = &mstp_clks[12], | ||
143 | }, { | ||
144 | /* TMU5 */ | ||
145 | .dev_id = "sh_tmu.5", | ||
146 | .con_id = "tmu_fck", | ||
147 | .clk = &mstp_clks[12], | ||
148 | }, | ||
149 | }; | ||
150 | |||
116 | int __init arch_clk_init(void) | 151 | int __init arch_clk_init(void) |
117 | { | 152 | { |
118 | int i, ret = 0; | 153 | int i, ret = 0; |
119 | 154 | ||
120 | for (i = 0; i < ARRAY_SIZE(clks); i++) | 155 | for (i = 0; i < ARRAY_SIZE(clks); i++) |
121 | ret |= clk_register(clks[i]); | 156 | ret |= clk_register(clks[i]); |
157 | for (i = 0; i < ARRAY_SIZE(lookups); i++) | ||
158 | clkdev_add(&lookups[i]); | ||
122 | 159 | ||
123 | if (!ret) | 160 | if (!ret) |
124 | ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), | 161 | ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c index 76afe571f3a2..07bb2d4619f8 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c | |||
@@ -113,7 +113,6 @@ static struct platform_device scif5_device = { | |||
113 | static struct sh_timer_config tmu0_platform_data = { | 113 | static struct sh_timer_config tmu0_platform_data = { |
114 | .channel_offset = 0x04, | 114 | .channel_offset = 0x04, |
115 | .timer_bit = 0, | 115 | .timer_bit = 0, |
116 | .clk = "tmu012_fck", | ||
117 | .clockevent_rating = 200, | 116 | .clockevent_rating = 200, |
118 | }; | 117 | }; |
119 | 118 | ||
@@ -142,7 +141,6 @@ static struct platform_device tmu0_device = { | |||
142 | static struct sh_timer_config tmu1_platform_data = { | 141 | static struct sh_timer_config tmu1_platform_data = { |
143 | .channel_offset = 0x10, | 142 | .channel_offset = 0x10, |
144 | .timer_bit = 1, | 143 | .timer_bit = 1, |
145 | .clk = "tmu012_fck", | ||
146 | .clocksource_rating = 200, | 144 | .clocksource_rating = 200, |
147 | }; | 145 | }; |
148 | 146 | ||
@@ -171,7 +169,6 @@ static struct platform_device tmu1_device = { | |||
171 | static struct sh_timer_config tmu2_platform_data = { | 169 | static struct sh_timer_config tmu2_platform_data = { |
172 | .channel_offset = 0x1c, | 170 | .channel_offset = 0x1c, |
173 | .timer_bit = 2, | 171 | .timer_bit = 2, |
174 | .clk = "tmu012_fck", | ||
175 | }; | 172 | }; |
176 | 173 | ||
177 | static struct resource tmu2_resources[] = { | 174 | static struct resource tmu2_resources[] = { |
@@ -199,7 +196,6 @@ static struct platform_device tmu2_device = { | |||
199 | static struct sh_timer_config tmu3_platform_data = { | 196 | static struct sh_timer_config tmu3_platform_data = { |
200 | .channel_offset = 0x04, | 197 | .channel_offset = 0x04, |
201 | .timer_bit = 0, | 198 | .timer_bit = 0, |
202 | .clk = "tmu345_fck", | ||
203 | }; | 199 | }; |
204 | 200 | ||
205 | static struct resource tmu3_resources[] = { | 201 | static struct resource tmu3_resources[] = { |
@@ -227,7 +223,6 @@ static struct platform_device tmu3_device = { | |||
227 | static struct sh_timer_config tmu4_platform_data = { | 223 | static struct sh_timer_config tmu4_platform_data = { |
228 | .channel_offset = 0x10, | 224 | .channel_offset = 0x10, |
229 | .timer_bit = 1, | 225 | .timer_bit = 1, |
230 | .clk = "tmu345_fck", | ||
231 | }; | 226 | }; |
232 | 227 | ||
233 | static struct resource tmu4_resources[] = { | 228 | static struct resource tmu4_resources[] = { |
@@ -255,7 +250,6 @@ static struct platform_device tmu4_device = { | |||
255 | static struct sh_timer_config tmu5_platform_data = { | 250 | static struct sh_timer_config tmu5_platform_data = { |
256 | .channel_offset = 0x1c, | 251 | .channel_offset = 0x1c, |
257 | .timer_bit = 2, | 252 | .timer_bit = 2, |
258 | .clk = "tmu345_fck", | ||
259 | }; | 253 | }; |
260 | 254 | ||
261 | static struct resource tmu5_resources[] = { | 255 | static struct resource tmu5_resources[] = { |