aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-03-29 04:10:06 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-03-29 04:10:06 -0400
commitc55fbdd3f97a468d51cbdb03bb7c9c7287fbda2f (patch)
tree0686a6e20a86b1dd79929a4f7b571dff479bbb2d /arch/sh
parente21d2aa76e1fc91cbf18c4b593d32112d954fab5 (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')
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7785.c39
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7785.c6
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
117static 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
116int __init arch_clk_init(void) 151int __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 = {
113static struct sh_timer_config tmu0_platform_data = { 113static 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 = {
142static struct sh_timer_config tmu1_platform_data = { 141static 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 = {
171static struct sh_timer_config tmu2_platform_data = { 169static 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
177static struct resource tmu2_resources[] = { 174static struct resource tmu2_resources[] = {
@@ -199,7 +196,6 @@ static struct platform_device tmu2_device = {
199static struct sh_timer_config tmu3_platform_data = { 196static 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
205static struct resource tmu3_resources[] = { 201static struct resource tmu3_resources[] = {
@@ -227,7 +223,6 @@ static struct platform_device tmu3_device = {
227static struct sh_timer_config tmu4_platform_data = { 223static 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
233static struct resource tmu4_resources[] = { 228static struct resource tmu4_resources[] = {
@@ -255,7 +250,6 @@ static struct platform_device tmu4_device = {
255static struct sh_timer_config tmu5_platform_data = { 250static 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
261static struct resource tmu5_resources[] = { 255static struct resource tmu5_resources[] = {