[PATCH 1/3] OMAP3 clock: Fix the DPLL freqsel computations

Paul Walmsley paul at pwsan.com
Mon Nov 16 08:36:53 EST 2009


From: Rajendra Nayak <rnayak at ti.com>

Fix the freqsel value computation. Use n instead of (n+1)

The formula in the TRM uses a zero-based N, hence the (n+1); however
at this point in the clock34xx.c code, N is one-based.

Hayati Bayrakdar <h-bayrakdar at ti.com> and Nishanth Menon <nm at ti.com> helped
track down this bug.

Signed-off-by: Rajendra Nayak <rnayak at ti.com>
Signed-off-by: Paul Walmsley <paul at pwsan.com>
[paul at pwsan.com: modified commit message]
Cc: Hayati Bayrakdar <h-bayrakdar at ti.com>
Cc: Nishanth Menon <nm at ti.com>
---
 arch/arm/mach-omap2/clock34xx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index c258f87..225c1a7 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -473,7 +473,7 @@ static u16 _omap3_dpll_compute_freqsel(struct clk *clk, u8 n)
 	unsigned long fint;
 	u16 f = 0;
 
-	fint = clk->dpll_data->clk_ref->rate / (n + 1);
+	fint = clk->dpll_data->clk_ref->rate / n;
 
 	pr_debug("clock: fint is %lu\n", fint);
 





More information about the linux-arm-kernel mailing list