* [PATCH] sh: sh7785 pll configuration from mode pin
@ 2009-05-28 12:06 Magnus Damm
0 siblings, 0 replies; only message in thread
From: Magnus Damm @ 2009-05-28 12:06 UTC (permalink / raw)
To: linux-sh
From: Magnus Damm <damm@igel.co.jp>
This patch modifies the sh7785 clock code to use the MODE4
value to switch between 72x and 36x PLL multiplication.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
---
arch/sh/kernel/cpu/sh4a/clock-sh7785.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- 0001/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
+++ work/arch/sh/kernel/cpu/sh4a/clock-sh7785.c 2009-05-28 16:42:18.000000000 +0900
@@ -16,6 +16,7 @@
#include <linux/cpufreq.h>
#include <asm/clock.h>
#include <asm/freq.h>
+#include <cpu/sh7785.h>
static unsigned int div2[] = { 1, 2, 4, 6, 8, 12, 16, 18,
24, 32, 36, 48 };
@@ -80,12 +81,11 @@ static struct clk_ops frqmr_clk_ops = {
static unsigned long pll_recalc(struct clk *clk)
{
- /*
- * XXX: PLL1 multiplier is locked for the default clock mode,
- * when mode pin detection and configuration support is added,
- * select the multiplier dynamically.
- */
- return clk->parent->rate * 36;
+ int multiplier;
+
+ multiplier = test_mode_pin(MODE_PIN_MODE4) ? 36 : 72;
+
+ return clk->parent->rate * multiplier;
}
static struct clk_ops pll_clk_ops = {
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-05-28 12:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-28 12:06 [PATCH] sh: sh7785 pll configuration from mode pin Magnus Damm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox