[ARM] twd: Allow twd rescaling to match cpu frequency
authorColin Cross <ccross@google.com>
Fri, 20 Aug 2010 05:07:43 +0000 (22:07 -0700)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:27:39 +0000 (16:27 -0700)
commit128f79c82dccb1ac9eacf8fa0b4d52bb29e05278
tree84254d83c464104ee55b5be7467603a482b6cab8
parentdada76ee1116155b3195c7dee63332ba74be6cb8
[ARM] twd: Allow twd rescaling to match cpu frequency

The clock to the ARM TWD local timer scales with the cpu
frequency.  To allow the cpu frequency to change while
maintaining a constant TWD frequency, pick a lower target
frequency for the TWD and use the prescaler to divide down
to the closest lower frequency.

This patch provides a new initialization function that takes
a target TWD frequency and the relation between the cpu
clock and the TWD clock, required to be an integer divider
>= 2 by the ARM spec.  It also provides a function to be
called from cpufreq drivers to set the prescaler whenever
the cpu frequency changes.

Also fixes a typo in the printk of the calibrated frequency.

Change-Id: I3fa8ef718ff5518170f1b2bab29efe960741853e
Signed-off-by: Colin Cross <ccross@google.com>
arch/arm/include/asm/smp_twd.h
arch/arm/kernel/smp_twd.c