]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ARM: tegra: fix U16 divider range check
authorStephen Warren <swarren@nvidia.com>
Tue, 24 Jul 2012 21:48:12 +0000 (15:48 -0600)
committerStephen Warren <swarren@nvidia.com>
Fri, 3 Aug 2012 17:50:27 +0000 (11:50 -0600)
commitb2f47745467d7e9574a79050c8068f3264432fb5
treef66d3cfaccde1b4b1b63affc2a0f046efbf94901
parente1a8a4d5f446cf19f15cc30714dafadd5aa76bdf
ARM: tegra: fix U16 divider range check

A U16 divider can divide a clock by 1..64K. However, the range-check
in clk_div16_get_divider() limited the range to 1..256. Fix this. NVIDIA's
downstream kernels already have the fixed range-check.

In practice this is a problem on Whistler's I2C bus, which uses a bus
clock rate of 100KHz (rather than the more common 400KHz on Tegra boards),
which requires a HW module clock of 8*100KHz. The parent clock is 216MHz,
leading to a desired divider of 270. Prior to conversion to the common
clock framework, this range error was somehow ignored/irrelevant and
caused no problems. However, the common clock framework evidently has
more rigorous error-checking, so this failure causes the I2C bus to fail
to operate correctly.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
arch/arm/mach-tegra/tegra2_clocks.c