From 10d80feaba3fb23dc389c053ffd0c37648a604e7 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Tue, 19 Jan 2010 20:09:28 +0900 Subject: [PATCH] --- yaml --- r: 181123 b: refs/heads/master c: dea3cf1c3935047a5b0d21b21d26718e09135f97 h: refs/heads/master i: 181121: f3f4b10590e05239117b632a84c1e406d4849262 181119: e118208a5e4c64dcbcb83c4e3dcb0206da95d0e1 v: v3 --- [refs] | 2 +- trunk/arch/sh/boards/board-urquell.c | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index a7b406e35a99..db790b483419 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c8098218271d19e7123d8b9137b9a4b87e5ffec0 +refs/heads/master: dea3cf1c3935047a5b0d21b21d26718e09135f97 diff --git a/trunk/arch/sh/boards/board-urquell.c b/trunk/arch/sh/boards/board-urquell.c index 268f09e46568..8aeac64810dc 100644 --- a/trunk/arch/sh/boards/board-urquell.c +++ b/trunk/arch/sh/boards/board-urquell.c @@ -2,7 +2,7 @@ * Renesas Technology Corp. SH7786 Urquell Support. * * Copyright (C) 2008 Kuninori Morimoto - * Copyright (C) 2009 Paul Mundt + * Copyright (C) 2009, 2010 Paul Mundt * * Based on board-sh7785lcr.c * Copyright (C) 2008 Yoshihiro Shimoda @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -175,6 +176,27 @@ static int urquell_mode_pins(void) return __raw_readw(UBOARDREG(MDSWMR)); } +static int urquell_clk_init(void) +{ + struct clk *clk; + int ret; + + /* + * Only handle the EXTAL case, anyone interfacing a crystal + * resonator will need to provide their own input clock. + */ + if (test_mode_pin(MODE_PIN9)) + return -EINVAL; + + clk = clk_get(NULL, "extal"); + if (!clk || IS_ERR(clk)) + return PTR_ERR(clk); + ret = clk_set_rate(clk, 33333333); + clk_put(clk); + + return ret; +} + /* Initialize the board */ static void __init urquell_setup(char **cmdline_p) { @@ -191,4 +213,5 @@ static struct sh_machine_vector mv_urquell __initmv = { .mv_setup = urquell_setup, .mv_init_irq = urquell_init_irq, .mv_mode_pins = urquell_mode_pins, + .mv_clk_init = urquell_clk_init, };