aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/board-sh7785lcr.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-05-13 04:55:00 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-05-13 04:55:00 -0400
commita77b5ac0ea8e47c77008d3a9a9976dcfbc01c42a (patch)
tree981fb1cf5b98a5e98a0c02e9dd2f950dc2759231 /arch/sh/boards/board-sh7785lcr.c
parent253b0887b3736160feac9ccdcf146a2073e41463 (diff)
sh: clkfwk: Update SH7785 for refactored clock framework.
This updates the SH7785 CPU code as well as the SH7785LCR board support code for making use of the newly refactored clock framework. Support for the legacy CPG clocks is dropped at this point, with the extal frequency fed in from the board code. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/board-sh7785lcr.c')
-rw-r--r--arch/sh/boards/board-sh7785lcr.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/arch/sh/boards/board-sh7785lcr.c b/arch/sh/boards/board-sh7785lcr.c
index 6f94f17adc46..33b194b0454d 100644
--- a/arch/sh/boards/board-sh7785lcr.c
+++ b/arch/sh/boards/board-sh7785lcr.c
@@ -2,12 +2,12 @@
2 * Renesas Technology Corp. R0P7785LC0011RL Support. 2 * Renesas Technology Corp. R0P7785LC0011RL Support.
3 * 3 *
4 * Copyright (C) 2008 Yoshihiro Shimoda 4 * Copyright (C) 2008 Yoshihiro Shimoda
5 * Copyright (C) 2009 Paul Mundt
5 * 6 *
6 * This file is subject to the terms and conditions of the GNU General Public 7 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive 8 * License. See the file "COPYING" in the main directory of this archive
8 * for more details. 9 * for more details.
9 */ 10 */
10
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/platform_device.h> 12#include <linux/platform_device.h>
13#include <linux/sm501.h> 13#include <linux/sm501.h>
@@ -19,8 +19,11 @@
19#include <linux/i2c-pca-platform.h> 19#include <linux/i2c-pca-platform.h>
20#include <linux/i2c-algo-pca.h> 20#include <linux/i2c-algo-pca.h>
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <asm/heartbeat.h> 22#include <linux/clk.h>
23#include <linux/errno.h>
23#include <mach/sh7785lcr.h> 24#include <mach/sh7785lcr.h>
25#include <asm/heartbeat.h>
26#include <asm/clock.h>
24 27
25/* 28/*
26 * NOTE: This board has 2 physical memory maps. 29 * NOTE: This board has 2 physical memory maps.
@@ -273,6 +276,20 @@ void __init init_sh7785lcr_IRQ(void)
273 plat_irq_setup_pins(IRQ_MODE_IRQ3210); 276 plat_irq_setup_pins(IRQ_MODE_IRQ3210);
274} 277}
275 278
279static int sh7785lcr_clk_init(void)
280{
281 struct clk *clk;
282 int ret;
283
284 clk = clk_get(NULL, "extal");
285 if (!clk || IS_ERR(clk))
286 return PTR_ERR(clk);
287 ret = clk_set_rate(clk, 33333333);
288 clk_put(clk);
289
290 return ret;
291}
292
276static void sh7785lcr_power_off(void) 293static void sh7785lcr_power_off(void)
277{ 294{
278 unsigned char *p; 295 unsigned char *p;
@@ -309,6 +326,7 @@ static void __init sh7785lcr_setup(char **cmdline_p)
309static struct sh_machine_vector mv_sh7785lcr __initmv = { 326static struct sh_machine_vector mv_sh7785lcr __initmv = {
310 .mv_name = "SH7785LCR", 327 .mv_name = "SH7785LCR",
311 .mv_setup = sh7785lcr_setup, 328 .mv_setup = sh7785lcr_setup,
329 .mv_clk_init = sh7785lcr_clk_init,
312 .mv_init_irq = init_sh7785lcr_IRQ, 330 .mv_init_irq = init_sh7785lcr_IRQ,
313}; 331};
314 332