Skip to content

Commit

Permalink
ARM: OMAP1: recalculate loops per jiffy after dpll1 reprogram
Browse files Browse the repository at this point in the history
Otherwise timing is inaccurate, resulting in devices which depend on it,
like omap-keypad, broken.

Tested on Amstrad Delta.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
[tony@atomide.com: removed comment referencing a development branch]
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Janusz Krzysztofik authored and Tony Lindgren committed Dec 5, 2011
1 parent c2cb211 commit 6560ee0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/arm/mach-omap1/clock_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#include <linux/kernel.h>
#include <linux/clk.h>
#include <linux/cpufreq.h>
#include <linux/delay.h>
#include <linux/io.h>

#include <asm/mach-types.h> /* for machine_is_* */
Expand Down Expand Up @@ -927,7 +929,9 @@ int __init omap1_clk_init(void)

void __init omap1_clk_late_init(void)
{
if (ck_dpll1.rate >= OMAP1_DPLL1_SANE_VALUE)
unsigned long rate = ck_dpll1.rate;

if (rate >= OMAP1_DPLL1_SANE_VALUE)
return;

/* System booting at unusable rate, force reprogramming of DPLL1 */
Expand All @@ -942,4 +946,5 @@ void __init omap1_clk_late_init(void)
}
propagate_rate(&ck_dpll1);
omap1_show_rates();
loops_per_jiffy = cpufreq_scale(loops_per_jiffy, rate, ck_dpll1.rate);
}

0 comments on commit 6560ee0

Please sign in to comment.