ARM: tegra: clock: Round frequency up in clock dividers
authorColin Cross <ccross@android.com>
Wed, 12 Jan 2011 00:59:55 +0000 (16:59 -0800)
committerColin Cross <ccross@android.com>
Wed, 12 Jan 2011 00:59:55 +0000 (16:59 -0800)
commit55bfef75ea06908d4f30ccfec8f7e239a5592705
tree8cada21544c787f140c0f414ca1a273ee4c79d1d
parent4ce07d6140b09aa49bfa823edbdd182ee74fa04e
ARM: tegra: clock: Round frequency up in clock dividers

When picking clock divider values, the clock framework picks
the closest frequency that is lower than the requested
frequency.  If the value from a clock divider rounds down,
and then the new rounded down frequency is requested, it
will get rounded down again, resulting in a frequency two
steps lower than the original requested frequency.

Fix the problem by rounding up when calculating the frequency
coming out of a clock divider, so if that frequency is
requested again, the same divider value will be picked.

Change-Id: Ieaf74448f67d91aeb7ba08226e48c092d8afaa2b
Signed-off-by: Colin Cross <ccross@android.com>
arch/arm/mach-tegra/clock.c
arch/arm/mach-tegra/tegra2_clocks.c