aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-03-29 04:03:15 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-03-29 04:03:15 -0400
commite21d2aa76e1fc91cbf18c4b593d32112d954fab5 (patch)
tree7cab10366209b04a0e447ca49b5cdc092292fb5d /arch/sh/kernel
parentc2a25e819717ea34e8f682d67a3fa76f4893395b (diff)
sh: sh7786 clkdev lookups.
This plugs in clkdev lookups for the SH7786 clocks and migrates off of clock string usage for the TMU clocks. Previously the TMU clocks were aliased to the peripheral clock, so this gets the driver actually toggling the proper clocks now as well. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7786.c68
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7786.c12
2 files changed, 68 insertions, 12 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
index 85e8d57f4971..c4a84bb2f3d9 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
@@ -13,6 +13,8 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/clk.h> 14#include <linux/clk.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/clk.h>
17#include <asm/clkdev.h>
16#include <asm/clock.h> 18#include <asm/clock.h>
17#include <asm/freq.h> 19#include <asm/freq.h>
18 20
@@ -120,12 +122,78 @@ static struct clk mstp_clks[] = {
120 SH_CLK_MSTP32("ether_fck", -1, NULL, MSTPCR1, 2, 0), 122 SH_CLK_MSTP32("ether_fck", -1, NULL, MSTPCR1, 2, 0),
121}; 123};
122 124
125static struct clk_lookup lookups[] = {
126 {
127 /* TMU0 */
128 .dev_id = "sh_tmu.0",
129 .con_id = "tmu_fck",
130 .clk = &mstp_clks[17], /* tmu012_fck */
131 }, {
132 /* TMU1 */
133 .dev_id = "sh_tmu.1",
134 .con_id = "tmu_fck",
135 .clk = &mstp_clks[17],
136 }, {
137 /* TMU2 */
138 .dev_id = "sh_tmu.2",
139 .con_id = "tmu_fck",
140 .clk = &mstp_clks[17],
141 }, {
142 /* TMU3 */
143 .dev_id = "sh_tmu.3",
144 .con_id = "tmu_fck",
145 .clk = &mstp_clks[16], /* tmu345_fck */
146 }, {
147 /* TMU4 */
148 .dev_id = "sh_tmu.4",
149 .con_id = "tmu_fck",
150 .clk = &mstp_clks[16],
151 }, {
152 /* TMU5 */
153 .dev_id = "sh_tmu.5",
154 .con_id = "tmu_fck",
155 .clk = &mstp_clks[16],
156 }, {
157 /* TMU6 */
158 .dev_id = "sh_tmu.6",
159 .con_id = "tmu_fck",
160 .clk = &mstp_clks[15], /* tmu678_fck */
161 }, {
162 /* TMU7 */
163 .dev_id = "sh_tmu.7",
164 .con_id = "tmu_fck",
165 .clk = &mstp_clks[15],
166 }, {
167 /* TMU8 */
168 .dev_id = "sh_tmu.8",
169 .con_id = "tmu_fck",
170 .clk = &mstp_clks[15],
171 }, {
172 /* TMU9 */
173 .dev_id = "sh_tmu.9",
174 .con_id = "tmu_fck",
175 .clk = &mstp_clks[14], /* tmu9_11_fck */
176 }, {
177 /* TMU10 */
178 .dev_id = "sh_tmu.10",
179 .con_id = "tmu_fck",
180 .clk = &mstp_clks[14],
181 }, {
182 /* TMU11 */
183 .dev_id = "sh_tmu.11",
184 .con_id = "tmu_fck",
185 .clk = &mstp_clks[14],
186 }
187};
188
123int __init arch_clk_init(void) 189int __init arch_clk_init(void)
124{ 190{
125 int i, ret = 0; 191 int i, ret = 0;
126 192
127 for (i = 0; i < ARRAY_SIZE(clks); i++) 193 for (i = 0; i < ARRAY_SIZE(clks); i++)
128 ret |= clk_register(clks[i]); 194 ret |= clk_register(clks[i]);
195 for (i = 0; i < ARRAY_SIZE(lookups); i++)
196 clkdev_add(&lookups[i]);
129 197
130 if (!ret) 198 if (!ret)
131 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), 199 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
index 542ced88e50f..f5599907ac3d 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -119,7 +119,6 @@ static struct platform_device scif5_device = {
119static struct sh_timer_config tmu0_platform_data = { 119static struct sh_timer_config tmu0_platform_data = {
120 .channel_offset = 0x04, 120 .channel_offset = 0x04,
121 .timer_bit = 0, 121 .timer_bit = 0,
122 .clk = "peripheral_clk",
123 .clockevent_rating = 200, 122 .clockevent_rating = 200,
124}; 123};
125 124
@@ -148,7 +147,6 @@ static struct platform_device tmu0_device = {
148static struct sh_timer_config tmu1_platform_data = { 147static struct sh_timer_config tmu1_platform_data = {
149 .channel_offset = 0x10, 148 .channel_offset = 0x10,
150 .timer_bit = 1, 149 .timer_bit = 1,
151 .clk = "peripheral_clk",
152 .clocksource_rating = 200, 150 .clocksource_rating = 200,
153}; 151};
154 152
@@ -177,7 +175,6 @@ static struct platform_device tmu1_device = {
177static struct sh_timer_config tmu2_platform_data = { 175static struct sh_timer_config tmu2_platform_data = {
178 .channel_offset = 0x1c, 176 .channel_offset = 0x1c,
179 .timer_bit = 2, 177 .timer_bit = 2,
180 .clk = "peripheral_clk",
181}; 178};
182 179
183static struct resource tmu2_resources[] = { 180static struct resource tmu2_resources[] = {
@@ -205,7 +202,6 @@ static struct platform_device tmu2_device = {
205static struct sh_timer_config tmu3_platform_data = { 202static struct sh_timer_config tmu3_platform_data = {
206 .channel_offset = 0x04, 203 .channel_offset = 0x04,
207 .timer_bit = 0, 204 .timer_bit = 0,
208 .clk = "peripheral_clk",
209}; 205};
210 206
211static struct resource tmu3_resources[] = { 207static struct resource tmu3_resources[] = {
@@ -233,7 +229,6 @@ static struct platform_device tmu3_device = {
233static struct sh_timer_config tmu4_platform_data = { 229static struct sh_timer_config tmu4_platform_data = {
234 .channel_offset = 0x10, 230 .channel_offset = 0x10,
235 .timer_bit = 1, 231 .timer_bit = 1,
236 .clk = "peripheral_clk",
237}; 232};
238 233
239static struct resource tmu4_resources[] = { 234static struct resource tmu4_resources[] = {
@@ -261,7 +256,6 @@ static struct platform_device tmu4_device = {
261static struct sh_timer_config tmu5_platform_data = { 256static struct sh_timer_config tmu5_platform_data = {
262 .channel_offset = 0x1c, 257 .channel_offset = 0x1c,
263 .timer_bit = 2, 258 .timer_bit = 2,
264 .clk = "peripheral_clk",
265}; 259};
266 260
267static struct resource tmu5_resources[] = { 261static struct resource tmu5_resources[] = {
@@ -289,7 +283,6 @@ static struct platform_device tmu5_device = {
289static struct sh_timer_config tmu6_platform_data = { 283static struct sh_timer_config tmu6_platform_data = {
290 .channel_offset = 0x04, 284 .channel_offset = 0x04,
291 .timer_bit = 0, 285 .timer_bit = 0,
292 .clk = "peripheral_clk",
293}; 286};
294 287
295static struct resource tmu6_resources[] = { 288static struct resource tmu6_resources[] = {
@@ -317,7 +310,6 @@ static struct platform_device tmu6_device = {
317static struct sh_timer_config tmu7_platform_data = { 310static struct sh_timer_config tmu7_platform_data = {
318 .channel_offset = 0x10, 311 .channel_offset = 0x10,
319 .timer_bit = 1, 312 .timer_bit = 1,
320 .clk = "peripheral_clk",
321}; 313};
322 314
323static struct resource tmu7_resources[] = { 315static struct resource tmu7_resources[] = {
@@ -345,7 +337,6 @@ static struct platform_device tmu7_device = {
345static struct sh_timer_config tmu8_platform_data = { 337static struct sh_timer_config tmu8_platform_data = {
346 .channel_offset = 0x1c, 338 .channel_offset = 0x1c,
347 .timer_bit = 2, 339 .timer_bit = 2,
348 .clk = "peripheral_clk",
349}; 340};
350 341
351static struct resource tmu8_resources[] = { 342static struct resource tmu8_resources[] = {
@@ -373,7 +364,6 @@ static struct platform_device tmu8_device = {
373static struct sh_timer_config tmu9_platform_data = { 364static struct sh_timer_config tmu9_platform_data = {
374 .channel_offset = 0x04, 365 .channel_offset = 0x04,
375 .timer_bit = 0, 366 .timer_bit = 0,
376 .clk = "peripheral_clk",
377}; 367};
378 368
379static struct resource tmu9_resources[] = { 369static struct resource tmu9_resources[] = {
@@ -401,7 +391,6 @@ static struct platform_device tmu9_device = {
401static struct sh_timer_config tmu10_platform_data = { 391static struct sh_timer_config tmu10_platform_data = {
402 .channel_offset = 0x10, 392 .channel_offset = 0x10,
403 .timer_bit = 1, 393 .timer_bit = 1,
404 .clk = "peripheral_clk",
405}; 394};
406 395
407static struct resource tmu10_resources[] = { 396static struct resource tmu10_resources[] = {
@@ -429,7 +418,6 @@ static struct platform_device tmu10_device = {
429static struct sh_timer_config tmu11_platform_data = { 418static struct sh_timer_config tmu11_platform_data = {
430 .channel_offset = 0x1c, 419 .channel_offset = 0x1c,
431 .timer_bit = 2, 420 .timer_bit = 2,
432 .clk = "peripheral_clk",
433}; 421};
434 422
435static struct resource tmu11_resources[] = { 423static struct resource tmu11_resources[] = {