aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2010-05-10 10:01:12 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-05-10 22:48:35 -0400
commite4e06697977bf6731d940ab1bd84e16cb53c3ae3 (patch)
treee686c50654ca84fbaf20ad7323760443ca37462b /arch/sh/kernel
parentf3d51e13fea901729fef15bf1c32ca004d45476e (diff)
sh: scif and tmu clkdev changes
Modify sh7722/sh7723/sh7724 to use clkdev for TMU and SCIF clock lookups. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7722.c43
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7723.c42
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7724.c42
3 files changed, 112 insertions, 15 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
index e5b6f47ea8b0..ed57c631b09a 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
@@ -21,6 +21,7 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <asm/clkdev.h>
24#include <asm/clock.h> 25#include <asm/clock.h>
25#include <asm/hwblk.h> 26#include <asm/hwblk.h>
26#include <cpu/sh7722.h> 27#include <cpu/sh7722.h>
@@ -164,9 +165,9 @@ static struct clk mstp_clks[HWBLK_NR] = {
164 SH_HWBLK_CLK("cmt_fck", -1, R_CLK, HWBLK_CMT, 0), 165 SH_HWBLK_CLK("cmt_fck", -1, R_CLK, HWBLK_CMT, 0),
165 SH_HWBLK_CLK("rwdt0", -1, R_CLK, HWBLK_RWDT, 0), 166 SH_HWBLK_CLK("rwdt0", -1, R_CLK, HWBLK_RWDT, 0),
166 SH_HWBLK_CLK("flctl0", -1, P_CLK, HWBLK_FLCTL, 0), 167 SH_HWBLK_CLK("flctl0", -1, P_CLK, HWBLK_FLCTL, 0),
167 SH_HWBLK_CLK("sci_fck", 0, P_CLK, HWBLK_SCIF0, 0), 168 SH_HWBLK_CLK("sci_fck", -1, P_CLK, HWBLK_SCIF0, 0),
168 SH_HWBLK_CLK("sci_fck", 1, P_CLK, HWBLK_SCIF1, 0), 169 SH_HWBLK_CLK("sci_fck", -1, P_CLK, HWBLK_SCIF1, 0),
169 SH_HWBLK_CLK("sci_fck", 2, P_CLK, HWBLK_SCIF2, 0), 170 SH_HWBLK_CLK("sci_fck", -1, P_CLK, HWBLK_SCIF2, 0),
170 171
171 SH_HWBLK_CLK("i2c0", -1, P_CLK, HWBLK_IIC, 0), 172 SH_HWBLK_CLK("i2c0", -1, P_CLK, HWBLK_IIC, 0),
172 SH_HWBLK_CLK("rtc0", -1, R_CLK, HWBLK_RTC, 0), 173 SH_HWBLK_CLK("rtc0", -1, R_CLK, HWBLK_RTC, 0),
@@ -185,6 +186,40 @@ static struct clk mstp_clks[HWBLK_NR] = {
185 SH_HWBLK_CLK("lcdc0", -1, P_CLK, HWBLK_LCDC, 0), 186 SH_HWBLK_CLK("lcdc0", -1, P_CLK, HWBLK_LCDC, 0),
186}; 187};
187 188
189static struct clk_lookup lookups[] = {
190 {
191 /* TMU0 */
192 .dev_id = "sh_tmu.0",
193 .con_id = "tmu_fck",
194 .clk = &mstp_clks[HWBLK_TMU],
195 }, {
196 /* TMU1 */
197 .dev_id = "sh_tmu.1",
198 .con_id = "tmu_fck",
199 .clk = &mstp_clks[HWBLK_TMU],
200 }, {
201 /* TMU2 */
202 .dev_id = "sh_tmu.2",
203 .con_id = "tmu_fck",
204 .clk = &mstp_clks[HWBLK_TMU],
205 }, {
206 /* SCIF0 */
207 .dev_id = "sh-sci.0",
208 .con_id = "sci_fck",
209 .clk = &mstp_clks[HWBLK_SCIF0],
210 }, {
211 /* SCIF1 */
212 .dev_id = "sh-sci.1",
213 .con_id = "sci_fck",
214 .clk = &mstp_clks[HWBLK_SCIF1],
215 }, {
216 /* SCIF2 */
217 .dev_id = "sh-sci.2",
218 .con_id = "sci_fck",
219 .clk = &mstp_clks[HWBLK_SCIF2],
220 },
221};
222
188int __init arch_clk_init(void) 223int __init arch_clk_init(void)
189{ 224{
190 int k, ret = 0; 225 int k, ret = 0;
@@ -198,6 +233,8 @@ int __init arch_clk_init(void)
198 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) 233 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
199 ret = clk_register(main_clks[k]); 234 ret = clk_register(main_clks[k]);
200 235
236 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
237
201 if (!ret) 238 if (!ret)
202 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); 239 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
203 240
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
index 390bdb5cabc5..d92d7cddd099 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
@@ -179,12 +179,12 @@ static struct clk mstp_clks[] = {
179 SH_HWBLK_CLK("dmac1", -1, B_CLK, HWBLK_DMAC1, 0), 179 SH_HWBLK_CLK("dmac1", -1, B_CLK, HWBLK_DMAC1, 0),
180 SH_HWBLK_CLK("tmu345_fck", -1, P_CLK, HWBLK_TMU1, 0), 180 SH_HWBLK_CLK("tmu345_fck", -1, P_CLK, HWBLK_TMU1, 0),
181 SH_HWBLK_CLK("flctl0", -1, P_CLK, HWBLK_FLCTL, 0), 181 SH_HWBLK_CLK("flctl0", -1, P_CLK, HWBLK_FLCTL, 0),
182 SH_HWBLK_CLK("sci_fck", 0, P_CLK, HWBLK_SCIF0, 0), 182 SH_HWBLK_CLK("sci_fck", -1, P_CLK, HWBLK_SCIF0, 0),
183 SH_HWBLK_CLK("sci_fck", 1, P_CLK, HWBLK_SCIF1, 0), 183 SH_HWBLK_CLK("sci_fck", -1, P_CLK, HWBLK_SCIF1, 0),
184 SH_HWBLK_CLK("sci_fck", 2, P_CLK, HWBLK_SCIF2, 0), 184 SH_HWBLK_CLK("sci_fck", -1, P_CLK, HWBLK_SCIF2, 0),
185 SH_HWBLK_CLK("sci_fck", 3, B_CLK, HWBLK_SCIF3, 0), 185 SH_HWBLK_CLK("sci_fck", -1, B_CLK, HWBLK_SCIF3, 0),
186 SH_HWBLK_CLK("sci_fck", 4, B_CLK, HWBLK_SCIF4, 0), 186 SH_HWBLK_CLK("sci_fck", -1, B_CLK, HWBLK_SCIF4, 0),
187 SH_HWBLK_CLK("sci_fck", 5, B_CLK, HWBLK_SCIF5, 0), 187 SH_HWBLK_CLK("sci_fck", -1, B_CLK, HWBLK_SCIF5, 0),
188 SH_HWBLK_CLK("msiof0", -1, B_CLK, HWBLK_MSIOF0, 0), 188 SH_HWBLK_CLK("msiof0", -1, B_CLK, HWBLK_MSIOF0, 0),
189 SH_HWBLK_CLK("msiof1", -1, B_CLK, HWBLK_MSIOF1, 0), 189 SH_HWBLK_CLK("msiof1", -1, B_CLK, HWBLK_MSIOF1, 0),
190 SH_HWBLK_CLK("meram0", -1, SH_CLK, HWBLK_MERAM, 0), 190 SH_HWBLK_CLK("meram0", -1, SH_CLK, HWBLK_MERAM, 0),
@@ -244,6 +244,36 @@ static struct clk_lookup lookups[] = {
244 .dev_id = "sh_tmu.5", 244 .dev_id = "sh_tmu.5",
245 .con_id = "tmu_fck", 245 .con_id = "tmu_fck",
246 .clk = &mstp_clks[HWBLK_TMU1], 246 .clk = &mstp_clks[HWBLK_TMU1],
247 }, {
248 /* SCIF0 */
249 .dev_id = "sh-sci.0",
250 .con_id = "sci_fck",
251 .clk = &mstp_clks[HWBLK_SCIF0],
252 }, {
253 /* SCIF1 */
254 .dev_id = "sh-sci.1",
255 .con_id = "sci_fck",
256 .clk = &mstp_clks[HWBLK_SCIF1],
257 }, {
258 /* SCIF2 */
259 .dev_id = "sh-sci.2",
260 .con_id = "sci_fck",
261 .clk = &mstp_clks[HWBLK_SCIF2],
262 }, {
263 /* SCIF3 */
264 .dev_id = "sh-sci.3",
265 .con_id = "sci_fck",
266 .clk = &mstp_clks[HWBLK_SCIF3],
267 }, {
268 /* SCIF4 */
269 .dev_id = "sh-sci.4",
270 .con_id = "sci_fck",
271 .clk = &mstp_clks[HWBLK_SCIF4],
272 }, {
273 /* SCIF5 */
274 .dev_id = "sh-sci.5",
275 .con_id = "sci_fck",
276 .clk = &mstp_clks[HWBLK_SCIF5],
247 }, 277 },
248}; 278};
249 279
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
index c5d4891d38a4..0c2aa34c7847 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
@@ -196,12 +196,12 @@ static struct clk mstp_clks[HWBLK_NR] = {
196 SH_HWBLK_CLK("rwdt0", -1, R_CLK, HWBLK_RWDT, 0), 196 SH_HWBLK_CLK("rwdt0", -1, R_CLK, HWBLK_RWDT, 0),
197 SH_HWBLK_CLK("dmac1", -1, B_CLK, HWBLK_DMAC1, 0), 197 SH_HWBLK_CLK("dmac1", -1, B_CLK, HWBLK_DMAC1, 0),
198 SH_HWBLK_CLK("tmu345_fck", -1, P_CLK, HWBLK_TMU1, 0), 198 SH_HWBLK_CLK("tmu345_fck", -1, P_CLK, HWBLK_TMU1, 0),
199 SH_HWBLK_CLK("sci_fck", 0, P_CLK, HWBLK_SCIF0, 0), 199 SH_HWBLK_CLK("sci_fck", -1, P_CLK, HWBLK_SCIF0, 0),
200 SH_HWBLK_CLK("sci_fck", 1, P_CLK, HWBLK_SCIF1, 0), 200 SH_HWBLK_CLK("sci_fck", -1, P_CLK, HWBLK_SCIF1, 0),
201 SH_HWBLK_CLK("sci_fck", 2, P_CLK, HWBLK_SCIF2, 0), 201 SH_HWBLK_CLK("sci_fck", -1, P_CLK, HWBLK_SCIF2, 0),
202 SH_HWBLK_CLK("sci_fck", 3, B_CLK, HWBLK_SCIF3, 0), 202 SH_HWBLK_CLK("sci_fck", -1, B_CLK, HWBLK_SCIF3, 0),
203 SH_HWBLK_CLK("sci_fck", 4, B_CLK, HWBLK_SCIF4, 0), 203 SH_HWBLK_CLK("sci_fck", -1, B_CLK, HWBLK_SCIF4, 0),
204 SH_HWBLK_CLK("sci_fck", 5, B_CLK, HWBLK_SCIF5, 0), 204 SH_HWBLK_CLK("sci_fck", -1, B_CLK, HWBLK_SCIF5, 0),
205 SH_HWBLK_CLK("msiof0", -1, B_CLK, HWBLK_MSIOF0, 0), 205 SH_HWBLK_CLK("msiof0", -1, B_CLK, HWBLK_MSIOF0, 0),
206 SH_HWBLK_CLK("msiof1", -1, B_CLK, HWBLK_MSIOF1, 0), 206 SH_HWBLK_CLK("msiof1", -1, B_CLK, HWBLK_MSIOF1, 0),
207 207
@@ -266,6 +266,36 @@ static struct clk_lookup lookups[] = {
266 .dev_id = "sh_tmu.5", 266 .dev_id = "sh_tmu.5",
267 .con_id = "tmu_fck", 267 .con_id = "tmu_fck",
268 .clk = &mstp_clks[HWBLK_TMU1], 268 .clk = &mstp_clks[HWBLK_TMU1],
269 }, {
270 /* SCIF0 */
271 .dev_id = "sh-sci.0",
272 .con_id = "sci_fck",
273 .clk = &mstp_clks[HWBLK_SCIF0],
274 }, {
275 /* SCIF1 */
276 .dev_id = "sh-sci.1",
277 .con_id = "sci_fck",
278 .clk = &mstp_clks[HWBLK_SCIF1],
279 }, {
280 /* SCIF2 */
281 .dev_id = "sh-sci.2",
282 .con_id = "sci_fck",
283 .clk = &mstp_clks[HWBLK_SCIF2],
284 }, {
285 /* SCIF3 */
286 .dev_id = "sh-sci.3",
287 .con_id = "sci_fck",
288 .clk = &mstp_clks[HWBLK_SCIF3],
289 }, {
290 /* SCIF4 */
291 .dev_id = "sh-sci.4",
292 .con_id = "sci_fck",
293 .clk = &mstp_clks[HWBLK_SCIF4],
294 }, {
295 /* SCIF5 */
296 .dev_id = "sh-sci.5",
297 .con_id = "sci_fck",
298 .clk = &mstp_clks[HWBLK_SCIF5],
269 }, 299 },
270}; 300};
271 301